:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #687583;
  --line: #d9e1e8;
  --accent: #0f766e;
  --accent-dark: #0b5e58;
  --warn: #b54708;
  --off: #7a8494;
  --sidebar: #111827;
  --sidebar-2: #1f2937;
  --shadow: 0 18px 45px rgba(20, 32, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #edf4f6 0, var(--bg) 260px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  background: linear-gradient(180deg, var(--sidebar), #18202b);
  color: #eef5f6;
  padding: 22px 16px;
  box-shadow: 12px 0 36px rgba(17, 24, 39, 0.16);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.28);
}

.brand small {
  display: block;
  color: #b7c3ca;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  color: #dbe7ed;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav a span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  color: #8edbd2;
}

.nav a:hover {
  background: var(--sidebar-2);
  color: white;
  transform: translateX(2px);
}

.nav-label {
  margin: 16px 12px 4px;
  color: #7f8d9c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.main {
  margin-left: 252px;
  min-height: 100vh;
  padding: 26px 28px 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  font-weight: 800;
}

h2 {
  font-size: 16px;
  font-weight: 800;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #3b82f6);
}

.stat span {
  color: var(--muted);
  font-weight: 700;
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.stat small {
  display: block;
  color: #8a95a3;
  margin-top: 4px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.hint {
  color: var(--muted);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f7f9fb;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdfd;
}

.actions {
  position: sticky;
  left: 0;
  text-align: right;
  background: #fff;
  box-shadow: 10px 0 16px rgba(20, 32, 45, 0.04);
  z-index: 1;
}

th.actions {
  background: #f7f9fb;
  z-index: 2;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #e8edf2;
  color: var(--ink);
  box-shadow: none;
}

.button.full {
  width: 100%;
}

.icon-link, .link-button {
  color: var(--accent);
  font-weight: 700;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: #edf7f6;
  color: var(--accent);
  font-weight: 800;
}

.mini-button + .mini-button {
  margin-left: 6px;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

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

.inline-form {
  display: inline;
  margin-left: 10px;
}

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

.pill.ok {
  background: #def7ec;
  color: #0f5c4f;
}

.pill.off {
  background: #eef0f3;
  color: var(--off);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  border-radius: 6px;
  background: #e8f6f4;
  color: #0f5c4f;
}

.message.danger {
  background: #fff0e8;
  color: var(--warn);
}

.form-panel {
  max-width: 760px;
  padding: 20px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  color: #3b4652;
  font-weight: 700;
}

.input, input[type="text"], input[type="password"], input[type="file"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.input:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="file"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(20, 184, 166, 0.18);
  border-color: #14b8a6;
}

.checkbox {
  width: 18px;
  height: 18px;
}

.mono, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.error {
  color: var(--warn);
}

.form-actions {
  display: flex;
  gap: 10px;
}

.token-result {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.token-result label {
  display: block;
  margin-bottom: 6px;
  color: #3b4652;
  font-weight: 700;
}

.token-meta {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #f7f9fb;
}

.token-box {
  min-height: 116px;
  resize: vertical;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.92), rgba(31, 41, 55, 0.95)),
    #18212b;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 48px;
  width: min(980px, calc(100vw - 32px));
}

.login-copy {
  color: white;
}

.login-copy h1 {
  max-width: 620px;
  font-size: 42px;
  line-height: 1.14;
}

.login-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: #d8edea;
  font-size: 16px;
  line-height: 1.8;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-panel {
  width: 100%;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.login-brand {
  color: var(--ink);
  margin-bottom: 24px;
}

.detail-row pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
  }

  .stats, .split {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-copy h1 {
    font-size: 32px;
  }
}

.raybot-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f5f7fa;
}

.raybot-login {
  position: relative;
  width: min(1440px, 100vw);
  min-height: min(900px, 100vh);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.64)),
    radial-gradient(circle at 18% 18%, rgba(36, 107, 254, 0.09), transparent 30%),
    radial-gradient(circle at 82% 74%, rgba(16, 167, 157, 0.08), transparent 32%),
    #f5f7fa;
  overflow: hidden;
}

.raybot-login-brand {
  position: absolute;
  left: clamp(24px, 4vw, 58px);
  top: clamp(24px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 3;
}

.raybot-login-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(23, 52, 95, 0.16);
}

.raybot-login-brand-title {
  font-size: 20px;
  font-weight: 700;
  color: #172033;
}

.raybot-login-left {
  padding: 126px clamp(32px, 5vw, 72px) 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 42px;
}

.raybot-login-headline {
  max-width: 570px;
}

.raybot-login-headline h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(34px, 3.05vw, 44px);
  line-height: 1.16;
  font-weight: 760;
  letter-spacing: 0;
}

.raybot-login-flow-panel {
  width: min(560px, 100%);
  border: 1px solid rgba(220, 227, 236, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(22, 31, 50, 0.09);
  overflow: hidden;
}

.raybot-login-flow {
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.raybot-login-step {
  min-height: 172px;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  padding: 28px 24px;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.raybot-login-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -22px;
  width: 22px;
  height: 1px;
  background: #cfd8e6;
}

.raybot-login-step:last-child::after {
  display: none;
}

.raybot-login-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 760;
  background: #246bfe;
}

.raybot-login-step:nth-child(2) .raybot-login-step-icon {
  background: #10a79d;
}

.raybot-login-step strong {
  display: block;
  margin-top: 22px;
  font-size: 24px;
  font-weight: 760;
  color: #253149;
}

.raybot-login-right {
  display: grid;
  place-items: center;
  padding: 80px clamp(28px, 5vw, 76px) 60px 34px;
  background:
    linear-gradient(90deg, rgba(233, 238, 246, 0.54), rgba(255, 255, 255, 0.5)),
    #f9fbfd;
  border-left: 1px solid rgba(218, 225, 235, 0.8);
}

.raybot-login-card {
  width: min(430px, 100%);
  border: 1px solid rgba(220, 227, 236, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 42, 68, 0.11);
  padding: 40px 40px 34px;
}

.raybot-login-card h2 {
  margin: 0 0 32px;
  color: #172033;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 760;
}

.raybot-login-field {
  margin-bottom: 18px;
}

.raybot-login-field label {
  display: block;
  margin-bottom: 8px;
  color: #374157;
  font-size: 15px;
  font-weight: 700;
}

.raybot-login-field input {
  height: 46px;
  border: 1px solid #d5dde9;
  border-radius: 6px;
  padding: 0 14px;
  color: #1d273a;
  font-size: 14px;
  background: #fff;
}

.raybot-login-field input:focus {
  outline: 2px solid rgba(36, 107, 254, 0.16);
  border-color: #246bfe;
}

.raybot-login-button {
  height: 48px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #246bfe;
  font-size: 15px;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(36, 107, 254, 0.2);
}

.raybot-login-button:hover {
  background: #1d5fe7;
}

@media (max-width: 900px) {
  .raybot-login {
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .raybot-login-left {
    padding: 110px 24px 30px;
    gap: 28px;
  }

  .raybot-login-right {
    padding: 30px 24px 44px;
    border-left: 0;
    border-top: 1px solid rgba(218, 225, 235, 0.8);
  }

  .raybot-login-flow {
    padding: 18px;
  }
}

@media (max-width: 560px) {
  .raybot-login-flow {
    grid-template-columns: 1fr;
  }

  .raybot-login-step {
    min-height: 128px;
  }

  .raybot-login-step::after {
    display: none;
  }

  .raybot-login-card {
    padding: 28px 22px 24px;
  }
}
