:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #111827;
  color: #f9fafb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #2dd4bf;
  color: #0f172a;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: #9ca3af;
  font-size: 13px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #d1d5db;
  text-align: left;
  cursor: pointer;
}

.tab:hover,
.tab.is-active {
  background: #263241;
  color: #ffffff;
}

.runtime {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: #d1d5db;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
}

.status-dot.is-online {
  background: #22c55e;
}

.workspace {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h2 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 4px 0 0;
  color: #64748b;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.auth-panel,
.panel,
.notice {
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
}

.auth-panel,
.panel {
  padding: 18px;
}

.notice {
  padding: 12px 14px;
  color: #92400e;
  background: #fffbeb;
}

.notice.is-error {
  color: #991b1b;
  background: #fef2f2;
}

.notice.is-success {
  color: #065f46;
  background: #ecfdf5;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.compact-form {
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: #1f2933;
}

input:focus,
select:focus {
  outline: 2px solid #2dd4bf;
  outline-offset: 1px;
}

.wide {
  grid-column: span 2;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
}

.primary-button {
  background: #2563eb;
  color: #ffffff;
}

.secondary-button,
.icon-button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.view {
  display: none;
  gap: 18px;
}

.view.is-active {
  display: grid;
}

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

.metric {
  min-height: 92px;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.metric span {
  color: #64748b;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 28px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 17px;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.copy-token {
  max-width: 220px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-token:hover {
  color: #0f766e;
  text-decoration: underline;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475569;
  font-weight: 700;
}

td {
  color: #1f2933;
}

.muted {
  color: #64748b;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .tabs {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }

  .tab {
    text-align: center;
  }

  .panel-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 16px;
  }

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

  .metric strong {
    font-size: 24px;
  }
}
