:root {
  --ink: #102436;
  --muted: #5d7180;
  --paper: #f5f7f7;
  --panel: #ffffff;
  --line: #d7e0e3;
  --teal: #087f7a;
  --teal-dark: #075b59;
  --amber: #c77813;
  --nav-width: 238px;
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { min-width: 320px; }
a { color: var(--teal-dark); }
.layout { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); min-height: 100vh; }
.layout.collapsed { --nav-width: 62px; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 16px 12px; background: #0b2233; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand img { width: 38px; height: 38px; }
.brand span { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.collapsed .brand span, .collapsed .nav-label { display: none; }
.nav-toggle { width: 100%; margin: 14px 0; padding: 8px; color: white; border: 1px solid #3c5869; background: transparent; border-radius: 6px; cursor: pointer; }
nav a { display: flex; align-items: center; gap: 9px; color: #dce8ec; text-decoration: none; padding: 9px 8px; border-radius: 6px; margin: 2px 0; }
nav a:hover, nav a.active { background: #16445a; color: white; }
.nav-icon { width: 22px; text-align: center; flex: 0 0 22px; }
main { padding: 24px 28px 48px; min-width: 0; }
.hero { max-width: 980px; padding: 24px; background: linear-gradient(125deg, #0c3a4e, #0b706d); color: white; border-radius: 12px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.65rem, 4vw, 2.5rem); }
.hero p { max-width: 760px; margin: 0; color: #d8f0ef; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 22px; }
.card { min-width: 175px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 2px 7px #1736490b; }
.card .value { display: block; font-size: 1.65rem; font-weight: 700; color: var(--teal-dark); }
.card .label { color: var(--muted); font-size: .9rem; }
.panel { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); max-width: 1160px; }
.panel h2 { margin-top: 0; }
.good { color: #086542; font-weight: 650; }
.warn { color: #9b5a00; font-weight: 650; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 14px 0 8px; }
.toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: .84rem; }
.toolbar input, .toolbar select, .toolbar button { min-height: 34px; border: 1px solid #aebdc3; border-radius: 5px; background: white; padding: 6px 9px; }
.toolbar button { cursor: pointer; }
.table-status { color: var(--muted); margin: 6px 0; }
.table-wrap { overflow: visible; }
table { width: max-content; min-width: min(100%, 900px); border-collapse: collapse; background: white; font-size: .88rem; }
th, td { padding: 2px; border: 1px solid var(--line); text-align: left; vertical-align: top; max-width: 420px; }
th { position: relative; background: #e7f0f1; color: #173849; cursor: pointer; user-select: none; overflow-wrap: anywhere; }
td.numeric { text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resize-handle { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; }
.context-menu { position: fixed; z-index: 50; min-width: 250px; max-height: 70vh; overflow-y: auto; padding: 8px; background: white; border: 1px solid #9badb4; border-radius: 7px; box-shadow: 0 8px 28px #10243640; }
.context-menu label, .context-menu button { display: block; width: 100%; padding: 5px; text-align: left; background: transparent; border: 0; }
.context-menu button { cursor: pointer; border-top: 1px solid var(--line); }
.pagination { display: flex; gap: 6px; align-items: center; margin: 10px 0; }
.pagination button { min-width: 34px; min-height: 32px; }
.subtabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.subtabs a, .subtabs button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--teal-dark); text-decoration: none; cursor: pointer; }
.subtabs a.active, .subtabs button.active { color: white; background: var(--teal-dark); border-color: var(--teal-dark); }
.notice { border-left: 4px solid var(--amber); padding-left: 12px; }
.observation-block, .obs80 { white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, "Courier New", monospace; font-variant-ligatures: none; font-size: .82rem; line-height: 1.45; tab-size: 8; }
footer { margin-top: 28px; color: var(--muted); font-size: .85rem; }
code { background: #edf2f3; padding: 1px 4px; border-radius: 3px; }
@media (max-width: 760px) {
  :root { --nav-width: 62px; }
  .brand span, .nav-label { display: none; }
  main { padding: 16px 12px 38px; }
  .sidebar { padding: 12px 7px; }
  .card { min-width: 145px; flex: 1; }
}
