/* Панель Site Monitor. Палитра общая с лендингом: глубокий зелёный акцент, цвета состояний несут смысл. */
:root {
  --bg: #f3f5f4; --card: #ffffff; --text: #17211e; --muted: #5f6d67; --line: #e1e7e4; --hover: #eef2f0;
  --accent: #0f6e5c; --accent-ink: #ffffff; --accent-soft: #e2f0eb;
  --ok: #1d8a52; --warn: #b8780b; --bad: #c63b2a;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 40, 32, .05), 0 6px 20px rgba(20, 40, 32, .05);
  --side: #10201b; --side-ink: #c9d6d1; --side-on: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1513; --card: #171f1c; --text: #e6ece9; --muted: #96a59f; --line: #26302c; --hover: #1d2723;
          --accent: #3fb393; --accent-ink: #0b1411; --accent-soft: #1b3029;
          --ok: #4cc283; --warn: #e2ae45; --bad: #f0715f; --shadow: none;
          --side: #0b110f; --side-ink: #9fb0a9; --side-on: #ffffff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Golos Text", system-ui, -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; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Боковое меню */
body.has-side { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: var(--side-on); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; padding: 4px 10px 10px; }
.side .brand:hover { text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #4cc283; box-shadow: 0 0 0 4px rgba(76, 194, 131, .18); }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side .group { margin: 14px 10px 4px; font-size: 12px; color: color-mix(in srgb, var(--side-ink) 70%, transparent); }
.side nav a { color: var(--side-ink); padding: 8px 10px; border-radius: 9px; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: var(--side-on); text-decoration: none; }
.side nav a.on { background: rgba(76, 194, 131, .16); color: var(--side-on); font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2a8a6f; color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.who-name { display: flex; flex-direction: column; color: var(--side-on); font-size: 14px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name small { color: var(--side-ink); font-size: 12px; }
button.ghost { background: transparent; color: var(--side-ink); border: 1px solid rgba(255, 255, 255, .14); padding: 5px 10px; font-size: 13px; }
button.ghost:hover { color: var(--side-on); border-color: rgba(255, 255, 255, .3); }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 32px 56px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 28px 0 12px; } h3 { font-size: 16px; } h4 { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); } .stat.bad b { color: var(--bad); }
.stat.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); } .stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--ok); }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 500; color: var(--muted); background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
tbody tr:hover td { background: var(--hover); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--hover); color: var(--muted); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.badge.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
form.inline { display: inline; margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=search], input[type=number], select, textarea { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; min-height: 160px; }
button, .btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 8px 16px; cursor: pointer;
  display: inline-block; font-weight: 500; }
button:hover, .btn:hover { filter: brightness(1.07); text-decoration: none; }
button.secondary, .btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover, .btn.secondary:hover { background: var(--hover); filter: none; }
button.danger, .btn.danger { background: var(--bad); color: #fff; }
button.link { background: none; color: var(--accent); padding: 0 4px; font-weight: 400; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--card);
  border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.flash.ok { border-left-color: var(--ok); } .flash.warn { border-left-color: var(--warn); }
.note.ok { color: var(--ok); } .note.warn { color: var(--warn); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre.cmd { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; user-select: all; }
.login { max-width: 420px; margin: 14vh auto; text-align: center; padding: 32px; }
svg.chart { width: 100%; height: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
svg.chart text { fill: var(--muted); font-size: 11px; } svg.chart .grid { stroke: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin: 8px 0 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

@media (max-width: 900px) {
  body.has-side { display: block; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 6px; }
  .side .brand { padding: 4px 6px; }
  .side nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; gap: 4px; scrollbar-width: none; }
  .side .group { display: none; }
  .side nav a { white-space: nowrap; padding: 6px 10px; }
  .who { border: 0; padding: 0; margin-left: auto; } .who-name { display: none; }
  main { padding: 20px 16px 48px; }
}
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }
h3 { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } h4 { margin: 18px 0 8px; }
section.site { scroll-margin-top: 16px; } section.site:target { border-color: var(--accent); }
.site-cell { white-space: nowrap; } .site-cell a { display: block; color: var(--text); }
.site-state.down { color: var(--bad); } .site-state.degraded { color: var(--warn); }
.plan-row { padding: 10px; } .plan-form { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, 90px) 110px minmax(120px, 1fr) 80px 60px 110px; gap: 8px; align-items: center; }
.plan-form input { width: 100%; min-width: 0; } .plan-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .plan-name input { flex: 1 1 140px; }
.plan-form .count { text-align: center; } .plan-actions { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.plan-assign .days { width: 76px; padding: 4px 6px; } .plan-assign select { padding: 4px 6px; }
@media (max-width: 900px) { .plan-form { grid-template-columns: 1fr 1fr; } .plan-name { grid-column: 1 / -1; } }
.plans { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.plans .plan-row { border-bottom: 1px solid var(--line); } .plans .plan-row:last-child { border-bottom: 0; } .plan-row.off { opacity: .65; }
.plan-head { padding: 8px 10px; font-size: 12px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); border-radius: var(--radius) 10px 0 0; }
@media (max-width: 900px) { .plan-head { display: none; } }
.server h2 { margin: 0; } .server-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; } .meter-top b { font-size: 22px; }
.bar { height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.meter.warn .bar i { background: var(--warn); } .meter.bad .bar i { background: var(--bad); }
.meter.warn b { color: var(--warn); } .meter.bad b { color: var(--bad); }
.server-kv { grid-template-columns: 160px 1fr; }
