:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8edf8;
  --muted: rgba(232, 237, 248, 0.72);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New";
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  --accent: #7c5cff;
  --accent2: #26d1ff;
  --danger: #ff4d6d;
  --ok: #2ee59d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(124, 92, 255, 0.20), transparent 60%),
    radial-gradient(900px 520px at 90% 20%, rgba(38, 209, 255, 0.16), transparent 55%),
    radial-gradient(900px 520px at 60% 100%, rgba(46, 229, 157, 0.10), transparent 55%);
  pointer-events: none;
  filter: saturate(110%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(11, 16, 32, 0.60);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(38, 209, 255, 0.20));
}
.logo.branded {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.logo.lg {
  width: 84px;
  height: 84px;
  border-radius: 20px;
}
.logo-img {
  width: 26px;
  height: 26px;
  display: block;
}
.logo.lg .logo-img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
}
.login-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin: 0 auto 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.14);
}
.login-logo.branded {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.brand-title { font-weight: 750; letter-spacing: 0.2px; }
.brand-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.statusbar { display: none; gap: 8px; align-items: center; }
@media (min-width: 860px) { .statusbar { display: flex; } }
.status-pill {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.14);
  color: rgba(232,237,248,0.88);
}
.status-pill.ok { border-color: rgba(46, 229, 157, 0.45); color: rgba(46, 229, 157, 0.95); }
.status-pill.bad { border-color: rgba(255, 77, 109, 0.55); color: rgba(255, 77, 109, 0.95); }
.status-pill.warn { border-color: rgba(255, 199, 0, 0.55); color: rgba(255, 199, 0, 0.95); }

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(720px, calc(100vw - 28px));
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(232,237,248,0.95);
}
.toast.ok { border-color: rgba(46, 229, 157, 0.45); color: rgba(46, 229, 157, 0.95); }
.toast.bad { border-color: rgba(255, 77, 109, 0.55); color: rgba(255, 77, 109, 0.95); }
.toast.warn { border-color: rgba(255, 199, 0, 0.55); color: rgba(255, 199, 0, 0.95); }

.container { width: min(1200px, calc(100vw - 32px)); margin: 18px auto 40px; position: relative; display: grid; gap: 16px; }

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(1100px 700px at 10% 10%, rgba(124, 92, 255, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(38, 209, 255, 0.14), transparent 55%),
    rgba(12, 16, 28, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.auth-card {
  width: min(460px, 100%);
}
.auth-card .grid2 {
  grid-template-columns: 1fr;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  padding: 16px;
}

.panel-title { font-weight: 700; letter-spacing: 0.2px; margin-bottom: 12px; }

.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}

.mono { font-family: var(--mono); font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.field { display: block; margin-bottom: 10px; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field-input, .field-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  padding: 10px 10px;
  outline: none;
}
select.field-input { color-scheme: dark; }
select.field-input option { background: rgba(12, 16, 28, 0.98); color: var(--text); }
.field-input:focus, .field-textarea:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.btn {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(38, 209, 255, 0.14));
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.small {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.btn.secondary { background: rgba(255,255,255,0.06); }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.syslog-box{
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(0,0,0,0.14);
  max-height:560px;
  overflow:auto;
}
.syslog-row{
  display:grid;
  grid-template-columns: 150px 140px 1fr;
  gap:10px;
  padding:8px 10px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  align-items:start;
}
.syslog-row:last-child{border-bottom:0}
.syslog-time{font-family:var(--mono);font-size:12px;color:rgba(232,237,248,0.72);white-space:nowrap}
.syslog-src{font-family:var(--mono);font-size:12px;color:rgba(232,237,248,0.72);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.syslog-msg{font-family:var(--mono);font-size:12px;white-space:pre-wrap;word-break:break-word}
.syslog-warn .syslog-msg{color:rgba(255,211,77,0.98);font-weight:800}
.syslog-error .syslog-msg{color:rgba(255,77,109,0.95);font-weight:900}
.syslog-kind-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
  font-weight:900;
  max-width:100%;
}
.syslog-kind-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.syslog-lvl-dot{
  width:8px;height:8px;border-radius:999px;
  background:rgba(232,237,248,0.55);
  flex:0 0 auto;
}
.syslog-warn .syslog-lvl-dot{background:rgba(255,211,77,0.98)}
.syslog-error .syslog-lvl-dot{background:rgba(255,77,109,0.95)}

.table-wrap {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(0,0,0,0.12);
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  vertical-align: middle;
}
.table th {
  font-size: 12px;
  color: rgba(232,237,248,0.78);
  background: rgba(0,0,0,0.10);
}

.response-body {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
}

.disclaimer-box {
  margin: 10px 0 14px 0;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  font-size: 12px;
  color: rgba(232,237,248,0.86);
  line-height: 1.55;
}

.disclaimer-box h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
}

.disclaimer-box ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.loader {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  font-size: 12px;
  color: rgba(232,237,248,0.86);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
  position: relative;
  cursor: pointer;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(232,237,248,0.92);
  transition: transform 120ms ease;
}

.switch input:checked {
  border-color: rgba(70, 213, 143, 0.55);
  background: rgba(70, 213, 143, 0.18);
}

.switch input:checked::after {
  transform: translateX(18px);
}

.switch-label {
  font-size: 12px;
  color: rgba(232,237,248,0.78);
}
