:root, [data-theme="light"] {
  --bg: #f2f4f7; --card: #ffffff; --side: #ffffff; --text: #16202a; --muted: #66727f; --line: #e2e7ec;
  --ok: #1f9d55; --warn: #c27c00; --bad: #d64545; --down: #b8c0c8; --accent: #16a34a; --hover: #eef2f7;
  --ok-bg: #e5f6ec; --warn-bg: #fff3dc; --bad-bg: #fde8e8; --down-bg: #eef1f4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b0f14; --card: #121821; --side: #121821; --text: #e6edf3; --muted: #8b98a8; --line: #263140; --hover: #19212c;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --accent: #22c55e;
  --ok-bg: #12301f; --warn-bg: #3a2b0c; --bad-bg: #3d1a1a; --down-bg: #1d2731; --down: #4a5664;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
/* каркас: меню слева, справа шапка и страница */
.shell { display: flex; min-height: 100vh; }
/* боковая панель как в DaTa Boot: узкая (иконки) ↔ широкая (подписи), стрелка » / « */
.side { width: 66px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: width .18s;
  background: linear-gradient(180deg, var(--side), color-mix(in srgb, var(--side) 85%, var(--bg)));
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }
.side.wide { width: 220px; }
.brand-row { display: flex; align-items: center; justify-content: center; padding: 14px 8px 6px; }
.side.wide .brand-row { justify-content: space-between; padding: 14px 14px 6px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.logo { font-size: 17px; letter-spacing: .5px; color: var(--accent); } .logo i { font-style: normal; color: var(--text); }
.brand span, .side nav a span, .side-foot a span, .nav-sec span, #navClubs .cnt { display: none; white-space: nowrap; }
.side.wide .brand span, .side.wide nav a span, .side.wide .side-foot a span, .side.wide .nav-sec span, .side.wide #navClubs .cnt { display: inline; }
.side-toggle { text-align: center; padding: 6px; margin: 2px 8px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; user-select: none; }
.side-toggle:hover { background: var(--hover); color: var(--text); }
.side.wide .side-toggle { text-align: right; }
.nav { display: flex; flex-direction: column; padding: 0 6px; gap: 3px; flex: 1; }
.side nav a, .side-foot a { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 11px 6px; border-radius: 10px;
  color: var(--muted); font-size: 14px; cursor: pointer; transition: background-color .15s, color .15s; }
.side.wide nav a, .side.wide .side-foot a { justify-content: flex-start; padding: 10px 14px; }
.side nav a .ico, .side-foot a .ico { font-style: normal; font-size: 18px; line-height: 1; width: 22px; text-align: center; flex: none; }
.side nav a:hover, .side-foot a:hover { background: var(--hover); color: var(--text); }
.side nav a.on { background: color-mix(in srgb, var(--accent) 16%, var(--hover)); color: var(--accent); }
.nav-sec { height: 1px; background: var(--line); margin: 8px 10px; }
.side.wide .nav-sec { height: auto; background: none; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin: 10px 14px 2px; }
#navClubs a .ico { font-size: 13px; font-weight: 700; position: relative; }
#navClubs a .ico .dot { position: absolute; right: -2px; top: -3px; width: 8px; height: 8px; }
#navClubs .cnt { margin-left: auto; color: var(--muted); font-size: 12px; }
.side-foot { padding: 8px 6px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.side-foot #demo { align-self: center; }
.mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.page-title { font-size: 17px; }
/* вкладки в шапке, как в DaTa Boot */
.tab-strip { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab-strip .tab { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--muted); cursor: pointer;
  white-space: nowrap; font-size: 14px; border: 1px solid transparent; max-width: 220px; }
.tab-strip .tab span { overflow: hidden; text-overflow: ellipsis; }
.tab-strip .tab:hover { background: var(--hover); color: var(--text); }
.tab-strip .tab.on { background: color-mix(in srgb, var(--accent) 14%, var(--hover)); color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tab-x { font-weight: 400; opacity: .6; padding: 0 2px; } .tab-x:hover { opacity: 1; color: var(--bad); }
.tab-add, .tb-btn { min-height: 32px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 16px; }
.tab-add:hover, .tb-btn:hover { color: var(--text); background: var(--hover); }
.tb-btn.spin { animation: spin .6s linear; } @keyframes spin { to { transform: rotate(360deg); } }
.tab-menu { position: absolute; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px #0005; min-width: 200px; }
.tab-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); cursor: pointer; } .tab-menu a:hover { background: var(--hover); }
@media (max-width: 860px) { .tab-strip, #tbWin { display: none; } }
.spacer { flex: 1; }
.only-m { display: none; }
main { padding: 16px; max-width: 1400px; width: 100%; }
@media (max-width: 860px) {
  .only-m { display: inline-flex; }
  .side { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px #0007; width: 240px !important; }
  .side .brand span, .side nav a span, .side-foot a span, .side .nav-sec span, .side #navClubs .cnt { display: inline; }
  .side nav a, .side-foot a { justify-content: flex-start; padding: 10px 14px; }
  .side .nav-sec { height: auto; background: none; color: var(--muted); font-size: 11px; text-transform: uppercase; margin: 10px 14px 2px; }
  .side-toggle { display: none; }
  .side.open { transform: none; }
  main { padding: 12px; }
}
/* обзор: одна строка на клуб */
.kpis4 { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
@media (max-width: 860px) { .kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nav a { position: relative; }
#dfxCnt:empty { display: none; }
#dfxCnt { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 6px; border-radius: 9px; text-align: center; background: var(--warn-bg); color: var(--warn); }
.side:not(.wide) #dfxCnt { position: absolute; top: 2px; left: 34px; padding: 0 4px; min-width: 14px; font-size: 10px; }
.dfx { border-left: 4px solid var(--line); margin-bottom: 12px; }
.dfx.sev-l-bad { border-left-color: var(--bad); } .dfx.sev-l-warn { border-left-color: var(--warn); }
.dfx-snoozed { opacity: .6; }
.dfx details summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
.kpi4 { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi4 .v { font-size: 24px; font-weight: 700; margin-top: 2px; }
.kpi4.warn { background: var(--warn-bg); border-color: transparent; } .kpi4.warn .v { color: var(--warn); }
.kpi4.bad { background: var(--bad-bg); border-color: transparent; } .kpi4.bad .v { color: var(--bad); }
.ctable { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.crow { display: grid; grid-template-columns: 1.3fr .7fr 1.1fr 1fr 1.2fr 1.3fr; gap: 10px; align-items: center; padding: 11px 14px;
  border-top: 1px solid var(--line); cursor: pointer; color: var(--text); }
.crow:hover { background: var(--hover); }
.crow.head { border-top: none; color: var(--muted); font-size: 13px; cursor: default; background: none; }
.crow.st-warn { background: color-mix(in srgb, var(--warn-bg) 60%, transparent); }
.crow.st-bad { background: color-mix(in srgb, var(--bad-bg) 70%, transparent); }
.crow .lbl { display: none; color: var(--muted); font-size: 12px; }
.cname { display: flex; align-items: center; gap: 8px; font-weight: 600; }
@media (max-width: 860px) {
  .crow.head { display: none; }
  .crow { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .crow .cname { grid-column: 1 / -1; font-size: 16px; }
  .crow .lbl { display: block; }
}
.alerts { margin-top: 14px; }
.alert { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.alert:first-of-type { border-top: none; }
.seg { display: inline-flex; background: var(--hover); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 12px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.seg a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px #0002; }
.dbcard { max-width: 640px; }
.dbrow { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1.2fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); }
.dbrow.head { border-top: none; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .dbrow.head { display: none; } .dbrow { grid-template-columns: 1fr 1fr; } }
.center { text-align: center; padding: 40px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h2 { font-size: 20px; margin: 4px 0 14px; }
h3 { font-size: 16px; margin: 18px 0 10px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card.link { cursor: pointer; } .card.link:active { transform: scale(.99); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--down); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--down-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin-top: 8px; }
.kv > :nth-child(odd) { color: var(--muted); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; min-height: 40px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { border: none; background: none; color: var(--muted); }
button:disabled { opacity: .55; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); min-height: 40px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tabs a { padding: 8px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ports { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  background: linear-gradient(#2a333d, #1f262e); padding: 10px; border-radius: 12px; }
.port { position: relative; border-radius: 8px; padding: 4px 3px 5px; text-align: center; cursor: pointer; background: #303a45;
  display: flex; flex-direction: column; align-items: center; gap: 1px; color: #e6edf3; border: 1px solid #3c4752; transition: transform .08s; }
.port:hover { transform: translateY(-1px); border-color: #6b7a89; }
.pnum { font-size: 12px; font-weight: 700; color: #cfd8e1; line-height: 1.2; }
.pspeed { font-size: 11px; font-weight: 600; line-height: 1.2; }
.pname { font-size: 10.5px; color: #aab6c2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; min-height: 12px; }
.pname.last { opacity: .55; font-style: italic; }
.jack { width: 46px; height: 39px; display: block; }
.jbody { fill: #1a2027; stroke: #59656f; stroke-width: 1.2; }
.jhole { fill: #0b0e12; stroke: #0b0e12; }
.jpin { fill: #c9a640; }
.led { fill: #3a434c; }
.lv-ok .jbody { fill: #134a2c; stroke: #2fbf6b; } .lv-ok .led { fill: #39e07c; filter: drop-shadow(0 0 2px #39e07c); } .lv-ok .pspeed { color: #4be38a; }
.lv-warn .jbody { fill: #4d3a0c; stroke: #f0b429; } .lv-warn .led.l1 { fill: #ffc233; filter: drop-shadow(0 0 2px #ffc233); } .lv-warn .led.l2 { fill: #39e07c; } .lv-warn .pspeed { color: #ffcc4d; }
.lv-bad .jbody { fill: #5a1717; stroke: #ff5a5a; } .lv-bad .led { fill: #ff4d4d; filter: drop-shadow(0 0 3px #ff4d4d); } .lv-bad .pspeed { color: #ff7a7a; }
.lv-bad { border-color: #ff5a5a; box-shadow: 0 0 0 1px #ff5a5a55; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #ff5a5a33; } }
.lv-idle { opacity: .75; } .lv-idle .jbody { fill: #26303a; stroke: #6b7a89; } .lv-idle .led { fill: #4a5664; } .lv-idle .pspeed { color: #9aa6b2; }
.pill.idle { background: var(--down-bg); color: var(--muted); }
.lv-down { opacity: .55; } .lv-down .pspeed { color: #8a96a3; }
.lv-off { opacity: .7; background: repeating-linear-gradient(135deg, #303a45 0 6px, #3a2a2e 6px 12px); }
.ptag { position: absolute; top: 2px; left: 3px; font-size: 9px; padding: 0 3px; border-radius: 4px; background: #b3423f; color: #fff; }
.ptag.lim { background: #a7781c; }
.pmenu { position: fixed; z-index: 40; min-width: 210px; background: var(--card); border: 1px solid #4a5663; border-radius: 10px; padding: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.pmenu button { display: block; width: 100%; text-align: left; margin: 2px 0; background: transparent; border: 0; padding: 8px 10px; border-radius: 6px; }
.pmenu button:hover:not([disabled]) { background: #3a4654; }
.pmenu button[disabled] { opacity: .5; cursor: default; }
.pmenu button.danger { color: #ff8a80; }
.pmenu-h { font-weight: 600; padding: 4px 10px 6px; font-size: 13px; }
.pmenu-sep { border-top: 1px solid #3c4752; margin: 4px 0; padding: 4px 10px 0; font-size: 11px; color: #8a96a3; }
.pmenu-lock { padding: 6px 10px; font-size: 12px; color: #c9b27a; max-width: 260px; }
button.danger { background: #8e2f2c; border-color: #b3423f; color: #fff; }
.badge { position: absolute; top: 2px; right: 3px; background: #ff4d4d; color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: 11px; line-height: 15px; text-align: center; font-weight: 800; }
.legend .badge { position: static; display: inline-block; margin-right: 4px; }
.lg { width: 14px !important; height: 11px !important; border-radius: 3px !important; border: 1.5px solid; }
.lg.ok { background: #134a2c; border-color: #2fbf6b; } .lg.warn { background: #4d3a0c; border-color: #f0b429; }
.lg.bad { background: #5a1717; border-color: #ff5a5a; } .lg.down { background: #1a2027; border-color: #59656f; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input { flex: 1; min-width: 160px; }
.sev-bad { color: var(--bad); } .sev-warn { color: var(--warn); } .sev-ok { color: var(--ok); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-body { background: var(--card); width: 100%; max-width: 720px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px 28px; position: relative; }
@media (min-width: 800px) { .sheet { align-items: center; } .sheet-body { border-radius: 18px; } }
.close { position: absolute; right: 10px; top: 10px; border: none; background: none; font-size: 18px; color: var(--muted); }
.unmanaged { border-style: dashed; }
.bar { height: 6px; background: var(--down-bg); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi-v { font-size: 30px; font-weight: 700; margin: 4px 0; } .kpi-v small { font-size: 14px; font-weight: 500; color: var(--muted); }
.spark { width: 100%; height: 46px; display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-line2 { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.lossbar { fill: var(--bad); opacity: .35; }
.pill.info { background: var(--down-bg); color: var(--muted); }
.spark-fill { fill: var(--accent); opacity: .12; stroke: none; }
@media (max-width: 700px) { .card[style*="span 2"] { grid-column: auto !important; } }
.pwwrap { position: relative; display: inline-flex; flex: 1; min-width: 160px; }
.pwwrap input { flex: 1; width: 100%; padding-right: 44px; }
.login .pwwrap, #ownf .pwwrap { display: flex; margin: 10px 0; } .login .pwwrap input, #ownf .pwwrap input { margin: 0 !important; }
.eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: none; background: none; min-height: 36px; padding: 4px 8px; font-size: 16px; cursor: pointer; }
.ros table { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ros th { font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.ros td, .ros th { padding: 5px 6px; white-space: nowrap; } .ros td:last-child { white-space: normal; min-width: 180px; }
.gauge-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; margin-top: 10px; }
.gauge { width: 300px; max-width: 100%; }
.g-arc { fill: none; stroke: var(--down-bg); stroke-width: 18; stroke-linecap: round; }
.g-dl { fill: none; stroke: #3b82f6; stroke-width: 18; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.g-tick { font-size: 10px; fill: var(--muted); text-anchor: middle; font-family: system-ui, sans-serif; }
.g-needle { transition: transform .6s cubic-bezier(.3,1.4,.5,1); transform-origin: 150px 150px; }
.g-needle.dl line { stroke: #3b82f6; } .g-needle.ul line { stroke: #22c55e; }
.g-hub { fill: var(--text); }
.g-read { text-align: center; min-width: 140px; }
.g-read .v { font-size: 34px; font-weight: 800; line-height: 1.1; } .g-read .u { font-size: 13px; color: var(--muted); }
.g-read.dl .v { color: #3b82f6; } .g-read.ul .v { color: #22c55e; }
.g-prog { height: 6px; background: var(--down-bg); border-radius: 3px; overflow: hidden; margin-top: 8px; } .g-prog i { display: block; height: 100%; background: linear-gradient(90deg,#3b82f6,#22c55e); transition: width 1s linear; }
.login { max-width: 340px; margin: 60px auto; }
.login input { width: 100%; margin: 10px 0; }
pre.out { white-space: pre-wrap; background: var(--bg); padding: 10px; border-radius: 10px; font-size: 13px; overflow-x: auto; }

/* DataFix: место обрыва в трассировке */
.dfx-hop-break td { background: color-mix(in srgb, var(--bad, #e5484d) 22%, transparent); font-weight: 600; }

