:root {
  --bg: #0f1419;
  --panel: #161c24;
  --panel-2: #1d2530;
  --border: #2a3441;
  --text: #e6edf3;
  --text-dim: #8b98a5;
  --accent: #4f8cff;
  --ok: #2ea043;
  --warn: #d29922;
  --crit: #f85149;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.su-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { font-weight: 700; letter-spacing: .02em; padding: 0 16px 16px; display: flex; align-items: center; gap: 8px; }
.sidebar-brand img { height: 26px; width: auto; display: block; }
.login-logo { display: block; height: 40px; width: auto; margin: 0 0 16px; }
.sidebar-brand span { color: var(--accent); }
.sidebar-nav { flex: 1; }
.sidebar-group { margin-bottom: 18px; }
.sidebar-group-label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; padding: 0 16px 6px; }
.sidebar-link { display: block; padding: 8px 16px; color: var(--text); font-size: 14px; border-left: 3px solid transparent; }
.sidebar-link:hover { background: var(--panel-2); text-decoration: none; }
.sidebar-link.active { border-left-color: var(--accent); background: var(--panel-2); color: var(--accent); font-weight: 600; }
.sidebar-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 24px; width: 100%; min-width: 0; }

@media (max-width: 760px) {
  .su-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .sidebar-brand { padding: 6px 10px; }
  .sidebar-nav { display: flex; flex-wrap: wrap; }
  .sidebar-group { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 4px; margin-right: 12px; }
  .sidebar-group-label { padding: 0 8px 0 0; }
  .sidebar-link { padding: 6px 10px; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-link.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-footer { width: 100%; border-top: none; }
}

.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; min-width: 160px; flex: 1;
}
.stat-val { font-size: 28px; font-weight: 700; }
.stat-lbl { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.stat-val.ok { color: var(--ok); }
.stat-val.warn { color: var(--warn); }
.stat-val.crit { color: var(--crit); }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
.panel h2 { margin-top: 0; font-size: 16px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.tbl tr:hover td { background: var(--panel-2); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(46,160,67,.15); color: var(--ok); }
.badge.warning { background: rgba(210,153,34,.15); color: var(--warn); }
.badge.critical { background: rgba(248,81,73,.15); color: var(--crit); }
.badge.unknown { background: rgba(139,152,165,.15); color: var(--text-dim); }
.badge.info { background: rgba(79,140,255,.15); color: var(--accent); }
.badge.company { background: rgba(168,85,247,.15); color: #a855f7; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 9px 16px; font-size: 14px; cursor: pointer;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn.danger { background: var(--crit); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.input, textarea.input, select.input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 9px 10px; font-size: 14px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-dim);
  border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.doc-render { line-height: 1.6; max-width: 860px; }
.doc-render h1, .doc-render h2, .doc-render h3 { margin-top: 28px; }
.doc-render h1:first-child, .doc-render h2:first-child { margin-top: 0; }
.doc-render pre { background: var(--panel-2); padding: 12px; border-radius: 6px; overflow-x: auto; }
.doc-render code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.doc-render pre code { background: none; padding: 0; }
.doc-render blockquote { border-left: 3px solid var(--accent); padding-left: 12px; margin-left: 0; color: var(--text-dim); }
.doc-render table.tbl { margin: 12px 0; }
.doc-render img { border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; }
.doc-render ul, .doc-render ol { padding-left: 22px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 340px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.login-box h1 { font-size: 18px; margin-top: 0; }
.error-box { background: rgba(248,81,73,.12); border: 1px solid var(--crit); color: #ffb4b0; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.muted { color: var(--text-dim); font-size: 13px; }
