:root {
  color-scheme: dark;
  --bg: #1e1f22;
  --bg-deep: #111214;
  --sidebar: #2b2d31;
  --surface: #313338;
  --surface-2: #383a40;
  --surface-3: #232428;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --faint: #7d828a;
  --line: #444850;
  --accent: #5865f2;
  --accent-2: #23a559;
  --warn: #f0b232;
  --danger: #f23f42;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.16), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(35, 165, 89, 0.12), transparent 28%),
    var(--bg);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  align-items: center;
  gap: 48px;
  padding: 48px clamp(24px, 7vw, 96px);
}

.login-art {
  min-height: 540px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(49, 51, 56, 0.96), rgba(17, 18, 20, 0.88)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 88px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.orbital-ring {
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(88, 101, 242, 0.52);
  border-radius: 50%;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-16deg);
}

.ring-two {
  width: 620px;
  height: 620px;
  border-color: rgba(35, 165, 89, 0.32);
  transform: translate(-50%, -50%) rotate(22deg);
}

.signal-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, 78%);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 18px;
}

.signal-card {
  background: rgba(43, 45, 49, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.signal-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.signal-main strong {
  font-size: 24px;
  line-height: 1.1;
}

.signal-main small {
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.signal-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 8px rgba(35, 165, 89, 0.16);
}

.signal-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.8fr;
  gap: 12px;
}

.signal-row span,
.signal-meter {
  height: 68px;
  border-radius: var(--radius);
  background: rgba(49, 51, 56, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.signal-meter {
  height: 12px;
  overflow: hidden;
}

.signal-meter i {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.login-panel {
  background: var(--sidebar);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-mark,
.server-dot {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.brand-lockup p,
.brand-lockup h1 {
  margin: 0;
}

.brand-lockup p {
  color: var(--muted);
  font-size: 13px;
}

.brand-lockup h1 {
  font-size: 26px;
  line-height: 1.15;
}

.login-panel label {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.login-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid #1f2024;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.login-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.24);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.channel,
.rail-dot {
  border: 0;
  border-radius: 6px;
  color: var(--text);
}

.primary-button {
  width: 100%;
  height: 44px;
  background: var(--accent);
  font-weight: 800;
}

.primary-button:hover,
.ghost-button:hover,
.secondary-button:hover {
  filter: brightness(1.08);
}

.form-error {
  min-height: 20px;
  margin: 14px 0 0;
  color: #ffb7b8;
  font-size: 13px;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px 240px minmax(0, 1fr);
  background: var(--bg);
}

.rail {
  background: var(--bg-deep);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.server-dot {
  width: 48px;
  height: 48px;
  border-radius: 18px;
}

.rail-dot {
  width: 42px;
  height: 42px;
  background: var(--surface);
  position: relative;
}

.rail-dot::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  position: absolute;
  inset: 13px;
}

.rail-dot:hover,
.rail-dot:focus {
  background: var(--accent);
  outline: none;
}

.channel-sidebar {
  min-height: 100vh;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.28);
}

.sidebar-header strong {
  display: block;
  font-size: 15px;
}

.sidebar-header span {
  color: var(--muted);
  font-size: 13px;
}

.channel {
  margin: 6px 10px 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.channel span {
  color: var(--faint);
  font-size: 18px;
}

.channel.active,
.channel:hover {
  color: var(--text);
  background: var(--surface);
}

.sidebar-footer {
  margin-top: auto;
  min-height: 64px;
  padding: 10px;
  background: var(--surface-3);
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 10px;
}

.sidebar-footer small {
  display: block;
  color: var(--faint);
  font-size: 11px;
}

.sidebar-footer strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.icon-button {
  width: 36px;
  height: 36px;
  background: var(--surface);
  position: relative;
}

.icon-button span,
.icon-button::before {
  position: absolute;
  content: "";
  display: block;
}

.icon-button span {
  width: 14px;
  height: 2px;
  background: var(--danger);
  left: 11px;
  top: 17px;
}

.icon-button::before {
  width: 10px;
  height: 10px;
  border: 2px solid var(--danger);
  border-right: 0;
  left: 9px;
  top: 12px;
}

.workspace {
  min-width: 0;
  padding: 0 24px 32px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 22px;
}

.topbar h2,
.topbar p {
  margin: 0;
}

.topbar h2 {
  font-size: 20px;
}

.topbar p {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.ghost-button {
  height: 36px;
  padding: 0 14px;
  background: var(--surface);
  font-weight: 700;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.key-panel,
.panel,
.metric-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
}

.hero-copy {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 184px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.96;
}

.hero-copy p {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 520px;
}

.key-panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.key-panel small,
.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.key-panel strong {
  display: block;
  margin-top: 3px;
}

.key-panel code {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 12px;
  overflow-wrap: anywhere;
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  color: #d7dcff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

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

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric-card strong {
  font-size: 32px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card.accent {
  border-color: rgba(88, 101, 242, 0.42);
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.28), var(--surface));
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 22px;
  margin-bottom: 22px;
}

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

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

.panel-title h3,
.panel-title p {
  margin: 0;
}

.panel-title h3 {
  font-size: 17px;
}

.panel-title p {
  color: var(--muted);
  font-size: 13px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #e3e5e8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(35, 165, 89, 0.16);
  color: #88e0a3;
  font-weight: 800;
  font-size: 12px;
}

.status-pill.failed {
  background: rgba(242, 63, 66, 0.16);
  color: #ffb7b8;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.model-row {
  display: grid;
  gap: 8px;
}

.model-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.quota-card {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.quota-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.quota-card h4,
.quota-card p {
  margin: 0;
}

.quota-card h4 {
  font-size: 15px;
}

.quota-card p {
  color: var(--muted);
  font-size: 12px;
}

.quota-card .quota-reset {
  color: var(--text);
  font-weight: 800;
}

.quota-value {
  font-size: 30px;
  font-weight: 900;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 280px;
  }

  .dashboard {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .channel-sidebar {
    display: none;
  }

  .content-band,
  .split-layout,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-screen {
    padding: 24px 14px;
  }

  .login-art {
    display: none;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .workspace {
    padding: 0 14px 24px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 12px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 46%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 30%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 24%;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
