/* light-blue theme (default, owner 03.11 "голубой, как у Хостмен"); dark = the screenshot look, via the toggle */
:root {
  --bg: #eef3fb; --side: #ffffff; --card: #ffffff; --line: #e3e9f3; --text: #16191f; --muted: #7d8799;
  --accent: #3b6cf6; --link: #2f6bff; --yellow: #f5b800; --track: #e6ebf3;
  --green: #22b35e; --orange: #f08c00; --red: #e5484d; --in: #c95de0; --out: #5fae2e;
  --nav-active-bg: #e8f0ff; --nav-active-text: #2f6bff; --nav-hover: #f2f6fd; --chip: #f2f6fd;
  --btn: #ffffff; --btn-hover: #f2f6fd; --shadow: 0 1px 3px rgba(22, 40, 80, .07);
  --tooltip: #ffffff; --pill-bg: #eef2f8;
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --side: #161618; --card: #1a1a1c; --line: #2a2a2d; --text: #f2f2f3; --muted: #8e8e93;
  --accent: #8b7cf6; --link: #4c8dff; --yellow: #f5c518; --track: #3a3a3d;
  --green: #34c759; --orange: #ff9f0a; --red: #ff453a; --in: #e17bf0; --out: #8bc34a;
  --nav-active-bg: #000000; --nav-active-text: #f2f2f3; --nav-hover: #202023; --chip: #000000;
  --btn: #1f1f22; --btn-hover: #29292d; --shadow: none; --tooltip: #000000; --pill-bg: #2a2a2d;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { display: flex; min-height: 100vh; font: 14px/1.45 -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* sidebar */
.side { width: 252px; background: var(--side); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
        position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; padding: 0 6px; }
.brand .logo { width: 30px; height: 30px; stroke: none; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav .nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text);
           text-decoration: none; cursor: pointer; opacity: .82; user-select: none; }
nav .nav:hover { background: var(--nav-hover); opacity: 1; }
nav .nav.active { background: var(--nav-active-bg); color: var(--nav-active-text); opacity: 1; font-weight: 600; }
nav .ext { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 16px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; background: var(--chip); border-radius: 16px; padding: 12px; }
.me-av { width: 34px; height: 34px; border-radius: 50%; background: var(--track); display: grid; place-items: center; font-weight: 700; }
.me b { display: block; } .me span { color: var(--muted); font-size: 12px; }

/* main */
main { flex: 1; min-width: 0; padding: 26px 34px 40px; }
.top { display: flex; align-items: center; gap: 16px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: #e8562a; display: grid; place-items: center; }
.avatar svg { width: 30px; height: 30px; stroke: none; }
h1 { margin: 0 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.sub { display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.muted, .sub .muted { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.up { background: var(--green); } .dot.down { background: var(--red); }
.actions { margin-left: auto; display: flex; gap: 10px; }
.round { width: 46px; height: 46px; border-radius: 50%; background: var(--btn); border: 1px solid var(--line); color: var(--text);
         display: grid; place-items: center; cursor: pointer; text-decoration: none; box-shadow: var(--shadow); }
.round:hover { background: var(--btn-hover); }

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: 26px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 0 0 13px; font: inherit; font-size: 15px; cursor: pointer;
               border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-color: var(--text); font-weight: 600; }

.banner { display: none; background: rgba(255,159,10,.12); color: var(--orange); border: 1px solid rgba(255,159,10,.35);
          border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.banner.show { display: block; }

.range { font-size: 21px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.range select { background: transparent; color: var(--link); border: 0; font: inherit; cursor: pointer; padding: 0 4px; }
.range select option { background: var(--card); color: var(--text); }
.hint { font-size: 13px; font-weight: 400; color: var(--muted); }

.pane { display: none; } .pane.active { display: block; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px;
        box-shadow: var(--shadow); contain: layout paint; }   /* a redraw inside a card never re-lays out the page */
.card-h { display: flex; align-items: baseline; gap: 8px; font-weight: 600; margin-bottom: 12px; flex-wrap: wrap; }
.card-h .muted { font-weight: 400; font-size: 13px; }
.card-h .big { margin-left: auto; font-size: 18px; }
.chart { position: relative; height: 240px; }
.chart canvas { touch-action: pan-y; }        /* a finger on a chart scrolls the page at once */

.donut { position: relative; width: 176px; height: 176px; margin: 4px auto 16px; }
.ring { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 3.2; }
.ring-bg { stroke: var(--track); }
.ring-fg { stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ring-fg.disk { stroke: var(--yellow); } .ring-fg.mem { stroke: var(--accent); }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-c b { font-size: 32px; font-weight: 700; } .donut-c span { color: var(--muted); font-size: 13px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.trio div + div { border-left: 1px solid var(--line); }
.trio b { display: block; font-size: 15px; font-weight: 600; } .trio span { color: var(--muted); font-size: 12px; }

.info .row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.info .row:first-child { padding-top: 0; } .info .row:last-child { border: 0; padding-bottom: 0; }
.info .k { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.info .v { display: flex; align-items: center; gap: 8px; font-weight: 500; flex-wrap: wrap; }
.copy { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: grid; }
.copy:hover { color: var(--text); } .copy.done { color: var(--green); }
.svc i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

.legend { margin-left: auto; display: flex; gap: 10px; font-weight: 400; color: var(--muted); font-size: 13px; align-items: center; }
.lg { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lg.in { background: var(--in); } .lg.out { background: var(--out); }

.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--pill-bg); color: var(--muted); }
.pill.ok { background: rgba(52,199,89,.15); color: var(--green); }
.pill.warn { background: rgba(255,159,10,.15); color: var(--orange); }
.pill.down { background: rgba(255,69,58,.15); color: var(--red); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }
.proj { color: var(--text); text-decoration: none; display: block; }
a.proj:hover { border-color: var(--link); }
.proj-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.proj p { color: var(--muted); margin: 10px 0 12px; }
.where { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }
.dim { opacity: .65; }
table.ports { width: 100%; border-collapse: collapse; }
.ports th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ports td { padding: 12px 6px; border-bottom: 1px solid var(--line); }
.ports tr:last-child td { border: 0; }
.empty b { font-size: 16px; } .empty p { color: var(--muted); margin: 8px 0 0; }
.foot { color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
  body { display: block; }
  .side { position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 10px 16px; overflow-x: auto; }
  .brand b { display: none; }
  nav { flex-direction: row; } nav .nav { padding: 8px 10px; white-space: nowrap; } nav .ext { margin: 0; border: 0; padding-top: 8px; }
  .me { display: none; }
  main { padding: 18px 16px 30px; }
  .tabs { display: none; }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}
