:root {
  --bg: #0b1020;
  --bg-soft: #111935;
  --card: rgba(20, 28, 55, .92);
  --line: rgba(255,255,255,.08);
  --text: #ecf1ff;
  --muted: #95a2c6;
  --accent: #7c9bff;
  --accent-2: #69e2c2;
  --danger: #ff6f7d;
  --warning: #ffb86b;
  --shadow: 0 20px 45px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #17224a 0, var(--bg) 45%), var(--bg);
}
a { color: inherit; text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 26, .85);
  backdrop-filter: blur(10px);
  padding: 28px 20px;
  display: flex; flex-direction: column; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #081225; display: grid; place-items: center; font-weight: 800;
}
.brand-title { font-size: 1.08rem; font-weight: 700; }
.brand-sub, .muted, .user-mail { color: var(--muted); }
.nav a, .ghost-link { display: block; padding: 12px 14px; border-radius: 14px; color: var(--muted); }
.nav a:hover, .ghost-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user-name { font-weight: 700; margin-top: 6px; }
.content { padding: 34px; }
.content-full { padding: 0; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.hero-card, .auth-card, .panel-card, .feature-card, .bot-card {
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 26px;
}
.hero-card { margin: 42px 20px 42px 42px; padding: 40px; }
.auth-card { margin: 42px 42px 42px 20px; padding: 34px; align-self: center; }
.badge, .count-pill, .status {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 8px 12px; font-size: .86rem; font-weight: 700;
}
.badge, .count-pill { background: rgba(124, 155, 255, .14); color: #cbd7ff; border: 1px solid rgba(124, 155, 255, .24); }
.hero-card h1 { font-size: 3rem; line-height: 1.05; margin: 22px 0 18px; max-width: 12ch; }
.hero-list { margin: 26px 0 0; padding-left: 18px; color: var(--muted); }
.stack-form, .feature-list { display: grid; gap: 18px; }
label { display: grid; gap: 10px; color: var(--muted); font-size: .95rem; }
input, textarea, select {
  width: 100%; background: rgba(255,255,255,.03); color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 15px; outline: none;
}
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus, select:focus { border-color: rgba(124, 155, 255, .55); box-shadow: 0 0 0 4px rgba(124, 155, 255, .12); }
.btn {
  border: 0; cursor: pointer; border-radius: 16px; padding: 13px 16px; font-weight: 700;
  transition: transform .15s ease, opacity .15s ease; display: inline-flex; justify-content: center; align-items: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #9f7cff); color: white; }
.btn-secondary, .btn-oauth { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); }
.divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: var(--muted); margin: 6px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); }
.oauth-grid { display: grid; gap: 12px; }
.switcher { margin: 0; color: var(--muted); }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.page-header h1 { margin: 0 0 6px; font-size: 2rem; }
.panel-card { padding: 24px; margin-bottom: 22px; }
.inline-form, .button-row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.bot-grid, .tab-grid, .control-grid { display: grid; gap: 18px; }
.bot-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tab-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.control-grid { grid-template-columns: 1.1fr .9fr; }
.bot-card, .feature-card { padding: 22px; }
.bot-card:hover, .feature-card:hover { border-color: rgba(124, 155, 255, .38); }
.bot-top { display: flex; justify-content: space-between; gap: 12px; }
.bot-top h3, .feature-card h3 { margin: 0 0 8px; }
.bot-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; color: var(--muted); }
.status-online { background: rgba(105, 226, 194, .15); color: #9dffe7; }
.status-offline { background: rgba(255, 111, 125, .14); color: #ffc5cb; }
.status-updating, .status-starting { background: rgba(255,184,107,.14); color: #ffd7ae; }
.status-unknown, .status-not_installed { background: rgba(255,255,255,.08); color: #dbe3ff; }
.flash-stack { display: grid; gap: 12px; margin-bottom: 20px; }
.flash { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); }
.flash-success { background: rgba(105, 226, 194, .12); }
.flash-error { background: rgba(255, 111, 125, .12); }
.empty-state { color: var(--muted); padding: 20px 6px 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.toggle-row, .feature-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.toggle-row:first-of-type, .feature-toggle:first-of-type { border-top: 0; }
.feature-name { font-weight: 700; color: var(--text); }
.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.log-box { background: rgba(0,0,0,.24); border: 1px solid var(--line); padding: 16px; border-radius: 18px; max-height: 420px; overflow: auto; white-space: pre-wrap; }
.center-card { max-width: 560px; margin: 80px auto; text-align: center; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .auth-layout, .control-grid, .form-grid { grid-template-columns: 1fr; }
  .hero-card, .auth-card { margin: 18px; }
  .content { padding: 18px; }
  .field-span-2 { grid-column: span 1; }
}


.auth-page { min-height: 100vh; display: grid; align-items: center; padding: 32px; }
.auth-layout-wide { max-width: 1240px; margin: 0 auto; gap: 28px; align-items: stretch; }
.auth-card-wide { max-width: 520px; width: 100%; justify-self: end; }
.btn-block { width: 100%; }
.oauth-grid-2 { grid-template-columns: 1fr; }
.auth-note { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.03); }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.section-head h2 { margin:0; }
@media (min-width: 1100px) { .auth-layout-wide { grid-template-columns: minmax(560px, 1.2fr) minmax(420px, .8fr); } .oauth-grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) { .auth-page { padding: 12px; } .auth-card-wide { max-width: none; justify-self: stretch; } }
