:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e5e7eb;
  --paper: #f6f7f9;
  --white: #ffffff;
  --navy: #111827;
  --accent: #635bff;
  --accent-soft: #efefff;
  --green: #12b76a;
  --red: #d92d20;
  --shadow: 0 18px 50px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }

.login-body { background: var(--navy); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-brand { color: white; padding: clamp(42px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -250px; top: -170px; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.018); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; background: var(--accent); border-radius: 14px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 68px; }
.eyebrow { margin: 0 0 12px; font-size: 11px; letter-spacing: .18em; font-weight: 750; color: #98a2b3; }
.login-brand h1 { max-width: 720px; margin: 0; font-size: clamp(42px, 5vw, 74px); line-height: .98; letter-spacing: -.055em; }
.lead { max-width: 610px; margin: 30px 0 0; color: #98a2b3; font-size: 18px; line-height: 1.65; }
.signal-line { display: flex; gap: 8px; align-items: end; height: 34px; margin-top: 68px; }
.signal-line span { width: 5px; border-radius: 4px; background: var(--accent); height: 30%; }
.signal-line span:nth-child(2) { height: 55%; opacity: .8; }
.signal-line span:nth-child(3) { height: 82%; opacity: .6; }
.signal-line span:nth-child(4) { height: 100%; opacity: .4; }
.login-card { background: var(--white); padding: clamp(36px, 7vw, 112px); display: flex; flex-direction: column; justify-content: center; }
.card-heading { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); margin-bottom: 50px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(18,183,106,.12); }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.035em; }
.login-card > p { margin: 12px 0 32px; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 20px; }
.auth-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 650; }
.auth-form input { width: 100%; border: 1px solid #d0d5dd; border-radius: 10px; padding: 13px 14px; outline: none; transition: .18s ease; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99,91,255,.12); }
.auth-form button, .primary-action { border: 0; border-radius: 10px; padding: 14px 17px; background: var(--accent); color: white; font-weight: 700; display: flex; justify-content: space-between; align-items: center; transition: transform .18s ease, opacity .18s ease; }
.auth-form button:hover, .primary-action:hover { transform: translateY(-1px); }
.auth-form button:disabled, .primary-action:disabled { opacity: .65; cursor: wait; transform: none; }
.test-note { font-size: 12px; text-align: center; }
code { background: #f2f4f7; border-radius: 5px; padding: 2px 6px; color: #344054; }
.alert { padding: 12px 14px; margin: -14px 0 18px; border-radius: 8px; color: var(--red); background: #fef3f2; font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: var(--navy); color: white; display: flex; flex-direction: column; }
.logo { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 0 9px 35px; }
.logo > span { width: 38px; height: 38px; display: grid; place-items: center; background: var(--accent); border-radius: 10px; font-weight: 800; }
.logo strong { font-size: 13px; line-height: 1.05; letter-spacing: -.01em; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { color: #98a2b3; text-decoration: none; padding: 11px 12px; border-radius: 8px; display: flex; align-items: center; gap: 11px; font-size: 14px; }
.sidebar nav a.active { color: white; background: rgba(255,255,255,.08); }
.sidebar nav a.disabled { cursor: default; }
.sidebar nav small { margin-left: auto; background: rgba(255,255,255,.08); border-radius: 10px; padding: 1px 7px; }
.nav-icon { width: 19px; color: #667085; }
.sidebar-footer { margin-top: auto; padding: 18px 6px 0; border-top: 1px solid rgba(255,255,255,.08); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.mini-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #344054; font-weight: 700; }
.sidebar-footer strong, .sidebar-footer span { display: block; font-size: 12px; }
.sidebar-footer span { color: #667085; margin-top: 2px; }
.sidebar-footer form button { border: 0; color: #98a2b3; background: transparent; font-size: 17px; }
.content { padding: 42px clamp(28px, 5vw, 76px) 70px; overflow: hidden; }
.topbar, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.topbar h1 { font-size: 32px; margin: 0; letter-spacing: -.04em; }
.system-pill { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); background: white; border: 1px solid var(--line); padding: 9px 13px; border-radius: 999px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 38px 0 48px; border: 1px solid var(--line); background: var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.metrics article { padding: 22px 24px; background: white; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 11px; }
.metrics strong { display: block; margin: 10px 0 4px; font-size: 20px; letter-spacing: -.025em; }
.metrics strong.good { color: var(--green); }
.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.ghost { border: 1px solid var(--line); background: white; color: #98a2b3; padding: 9px 13px; border-radius: 8px; }
.adapter-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 25px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 22px; box-shadow: var(--shadow); }
.adapter-icon { width: 58px; height: 58px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 25px; }
.adapter-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.adapter-title h3 { margin: 0; font-size: 18px; }
.adapter-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.badge { background: #f2f4f7; color: #475467; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 700; }
[data-status="online"] .badge { color: #027a48; background: #ecfdf3; }
[data-status="checking"] .badge { color: #6941c6; background: #f4f3ff; }
[data-status="error"] .badge { color: #b42318; background: #fef3f2; }
.adapter-endpoint { display: flex; gap: 10px; margin: 15px 0; font-size: 11px; color: var(--muted); }
.adapter-endpoint code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adapter-meta { display: grid; grid-template-columns: 1fr .6fr 1.4fr; gap: 24px; }
.adapter-meta span, .adapter-meta strong { display: block; font-size: 11px; }
.adapter-meta span { color: var(--muted); margin-bottom: 5px; }
.adapter-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.primary-action { min-width: 205px; }
.activity { margin-top: 46px; }
.section-heading.compact { justify-content: flex-start; }
.empty-state { min-height: 130px; border: 1px dashed #d0d5dd; border-radius: 12px; display: flex; justify-content: center; align-items: center; gap: 16px; color: var(--muted); }
.empty-state > span { font-size: 26px; color: #98a2b3; }
.empty-state strong { color: #344054; font-size: 13px; }
.empty-state p { margin: 5px 0 0; font-size: 12px; }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 42px; }
  .login-brand .brand-mark { margin-bottom: 36px; }
  .login-card { min-height: 58vh; padding: 42px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .adapter-card { grid-template-columns: auto 1fr; }
  .primary-action { grid-column: 2; }
}

@media (max-width: 700px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px 18px; flex-direction: row; align-items: center; }
  .logo { padding: 0; }
  .logo strong, .sidebar nav a:not(.active), .sidebar-footer { display: none; }
  .sidebar nav { margin-left: auto; }
  .content { padding: 26px 18px 50px; }
  .system-pill { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; margin-top: 28px; }
  .metrics article { padding: 17px; }
  .adapter-card { grid-template-columns: 1fr; }
  .adapter-icon { width: 48px; height: 48px; }
  .adapter-meta { grid-template-columns: 1fr; gap: 12px; }
  .primary-action { grid-column: auto; width: 100%; }
}

