* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d8dee5;
  --text: #1f2933;
  --muted: #687582;
  --soft: #f9fafb;
  --accent: #0f766e;
  --accent-weak: #e7f6f2;
  --warn: #b45309;
  --warn-weak: #fff4df;
  --bad: #b91c1c;
  --bad-weak: #fde8e8;
}
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { min-height: 36px; border: 1px solid #1f2933; border-radius: 6px; padding: 0 13px; background: #1f2933; color: #fff; cursor: pointer; }
button.secondary { background: #fff; color: var(--text); border-color: var(--line); }
button.linklike { min-height: 0; border: 0; padding: 0; background: transparent; color: var(--accent); text-align: left; }
input { height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: #fff; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 15px; line-height: 1.35; }
p { color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #eef2f5; }
.login-wrap { width: min(420px, calc(100vw - 32px)); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08); }
.login-card h1 { font-size: 28px; margin-bottom: 6px; }
.login-form { margin-top: 24px; display: grid; gap: 14px; }
.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.login-form input { width: 100%; }
.form-status { min-height: 20px; font-size: 13px; }
.form-status.error, .status.error { color: var(--bad); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { background: #101820; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; }
.brand h1 { font-size: 24px; line-height: 1.1; }
.brand span { color: #9fb0bf; font-size: 13px; }
.nav { display: grid; gap: 6px; }
.nav button { width: 100%; justify-content: flex-start; text-align: left; border: 0; background: transparent; color: #dce5ed; padding: 0 12px; }
.nav button.active, .nav button:hover { background: #22303b; }
.workspace { min-width: 0; }
.topbar { min-height: 76px; padding: 18px 24px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar p { margin-top: 5px; font-size: 13px; }
.actions { display: flex; align-items: center; gap: 8px; }
.user-badge { color: var(--muted); font-size: 13px; }
.content { padding: 22px 24px 34px; }
.status { min-height: 22px; margin-bottom: 14px; color: var(--muted); }
.view { display: none; }
.view.active { display: block; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-height: 86px; }
.metric span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font-size: 24px; line-height: 1.1; }
.panel, .detail-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel { margin-bottom: 18px; }
.section-head { min-height: 48px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.section-head span { color: var(--muted); font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 8px; }
.section-actions button { min-height: 30px; padding: 0 10px; }
.grid-two { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 18px; }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.detail-panel { padding: 16px; position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow: auto; }
.table-wrap { overflow-x: auto; }
.table-wrap.collapsed { display: none; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
.compact table { min-width: 620px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.selectable { cursor: pointer; }
tr.selectable:hover td, tr.active-row td { background: #f6fbfa; }
tr.active-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #eef1f4; color: var(--text); font-weight: 600; }
.badge.ok { background: var(--accent-weak); color: var(--accent); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.bad { background: var(--bad-weak); color: var(--bad); }
.kv { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; background: #0f1720; color: #e8edf2; border-radius: 6px; padding: 12px; }
.docs-layout { position: relative; min-height: calc(100vh - 134px); }
.docs-open-list { display: none; position: sticky; top: 92px; z-index: 12; margin-bottom: 12px; }
.docs-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 24, 32, 0.28); z-index: 20; }
.docs-list-mode .docs-layout { display: block; }
.docs-list-mode .docs-panel { width: 100%; }
.docs-list-mode .doc-preview, .docs-list-mode .docs-open-list { display: none; }
.docs-list-mode #toggleDocsList { display: none; }
.docs-detail-mode .docs-layout { display: block; }
.docs-detail-mode .doc-preview { min-height: calc(100vh - 134px); }
.docs-detail-mode .docs-open-list { display: inline-flex; align-items: center; }
.docs-detail-mode .docs-panel { position: fixed; left: 256px; top: 100px; bottom: 24px; width: min(560px, calc(100vw - 288px)); max-width: calc(100vw - 32px); z-index: 30; margin: 0; transform: translateX(calc(-100% - 32px)); transition: transform 160ms ease; box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18); }
.docs-detail-mode .docs-panel .table-wrap { max-height: calc(100vh - 174px); overflow: auto; }
.docs-detail-mode.docs-drawer-open .docs-panel { transform: translateX(0); }
.docs-detail-mode.docs-drawer-open .docs-backdrop { display: block; }
.file-browser { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.file-tree { max-height: calc(100vh - 134px); overflow: auto; }
.tree { padding: 10px; }
.tree details { margin-left: 8px; }
.tree summary { cursor: pointer; min-height: 28px; color: var(--text); }
.tree button { display: block; width: 100%; border: 0; background: transparent; color: var(--accent); text-align: left; padding: 5px 8px; min-height: 28px; }
.file-preview { min-height: calc(100vh - 134px); }
.markdown-body { padding: 18px; line-height: 1.65; overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 18px 0 8px; color: var(--text); }
.markdown-body h1 { font-size: 26px; line-height: 1.2; }
.markdown-body h2 { font-size: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.markdown-body h3 { font-size: 16px; }
.markdown-body h4 { font-size: 14px; }
.markdown-body p { margin: 8px 0; color: var(--text); }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 24px; color: var(--text); }
.markdown-body li { margin: 5px 0; }
.markdown-body code { background: #eef2f5; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.markdown-body pre code { background: transparent; padding: 0; }
.markdown-body blockquote { margin: 12px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: #f6fbfa; color: var(--text); }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.markdown-body table { display: block; width: 100%; min-width: 0; margin: 14px 0; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { min-width: 140px; padding: 9px 11px; border: 1px solid var(--line); white-space: normal; vertical-align: top; }
.markdown-body th { background: var(--soft); color: var(--muted); font-weight: 700; }
.markdown-body tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.message { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; }
.message strong { display: block; margin-bottom: 6px; }
@media (max-width: 1100px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; } .nav { grid-template-columns: repeat(6, minmax(0, 1fr)); } .split-view, .file-browser, .grid-two { grid-template-columns: 1fr; } .docs-detail-mode .docs-panel { left: 16px; top: 88px; width: min(560px, calc(100vw - 32px)); } .detail-panel { position: static; max-height: none; } }
@media (max-width: 760px) { .topbar { align-items: stretch; flex-direction: column; } .actions { flex-wrap: wrap; } .content { padding: 16px; } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nav { grid-template-columns: 1fr 1fr; } .docs-detail-mode .docs-panel { top: 132px; } }
