:root {
  --bg: #eef1f6;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #f0f3f8;
  --text: #0f1b2d;
  --muted: #586a82;
  --muted-2: #94a1b5;
  --line: #e3e8f0;
  --line-2: #eef2f7;
  --line-strong: #d5dce7;
  --accent: #2f7ef5;
  --accent-strong: #1f6ae6;
  --accent-bg: #eaf2ff;
  --accent-soft: #dfeaff;
  --active-bg: #eaf2ff;
  --active-fg: #1f6ae6;
  --grad: linear-gradient(135deg, #4b93ff, #2f7ef5);
  --ok: #16a34a; --ok-bg: #e6f6ec; --ok-line: #bfe8cd;
  --warn: #e08a00; --warn-bg: #fff4dc; --warn-line: #f6dfa8;
  --err: #e2453a; --err-bg: #fdecea; --err-line: #f6cfcb;
  --muted-bg: #eef2f6;
  --gold: #f5a524;
  --shadow-sm: 0 1px 2px rgba(16, 27, 45, .06), 0 1px 3px rgba(16, 27, 45, .04);
  --shadow: 0 6px 20px rgba(16, 27, 45, .08), 0 2px 6px rgba(16, 27, 45, .05);
  --shadow-lg: 0 18px 50px rgba(16, 27, 45, .16);
  --accent-shadow: rgba(47, 126, 245, .28);
  --radius: 14px; --radius-sm: 10px;
  --console-bg: #101722;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0d1219;
  --bg-2: #151c26;
  --panel: #151c26;
  --panel-2: #1a222e;
  --panel-3: #202a38;
  --text: #e9eef6;
  --muted: #9fb0c4;
  --muted-2: #68788e;
  --line: #28323f;
  --line-2: #202a38;
  --line-strong: #35414f;
  --accent: #4b93ff;
  --accent-strong: #67a4ff;
  --accent-bg: #16273f;
  --accent-soft: #1b3352;
  --active-bg: #16273f;
  --active-fg: #67a4ff;
  --ok: #37c982; --ok-bg: #12291f; --ok-line: #1f5138;
  --warn: #f2b34a; --warn-bg: #2a2110; --warn-line: #57431c;
  --err: #ff6b5e; --err-bg: #2c1614; --err-line: #5a2a25;
  --muted-bg: rgba(148, 163, 184, .14);
  --gold: #f5b942;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  --accent-shadow: rgba(75, 147, 255, .3);
  --console-bg: #0a0f16;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; letter-spacing: inherit; }
.num { font-variant-numeric: tabular-nums; }
.spacer { margin-left: auto; }
.mt16 { margin-top: 16px; }

.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; letter-spacing: -.03em;
  box-shadow: 0 4px 12px var(--accent-shadow);
}
.brand-text b { display: block; font-size: 14.5px; font-weight: 750; letter-spacing: -.02em; }
.brand-text span { font-size: 10.5px; color: var(--muted-2); font-weight: 600; }

.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); padding: 15px 10px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border: none; border-radius: 11px;
  background: none; color: var(--muted); cursor: pointer;
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  width: 100%; text-align: left; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--panel-3); color: var(--text); }
.nav-item.active { background: var(--active-bg); color: var(--active-fg); font-weight: 650; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item .count {
  margin-left: auto; font-style: italic; font-size: 11px; font-weight: 700;
  background: var(--panel-3); color: var(--muted);
  padding: 1px 8px; border-radius: 20px; min-width: 22px; text-align: center;
}
.nav-item.soon { opacity: .72; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 66px; padding: 0 26px; flex: none;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  position: sticky; top: 0; z-index: 30;
}
.ph-text b { display: block; font-size: 21px; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; }
.ph-text span { font-size: 13px; color: var(--muted); }

.status-pill {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border-radius: 22px; background: var(--muted-bg);
  font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.status-pill.off .dot { background: var(--muted-2); }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 11px 5px 6px; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--line); cursor: pointer;
  position: relative;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--panel-3); }
.me-av {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #3f8bff, #7c5cff); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.me-info b { display: block; font-size: 12.5px; font-weight: 650; }
.me-info span { font-size: 10.5px; color: var(--muted-2); }

.user-menu {
  position: absolute; top: 50px; right: 0; min-width: 170px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.user-menu.on { display: block; }
.user-menu a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text);
}
.user-menu a:hover { background: var(--panel-3); }
.user-menu a.danger { color: var(--err); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 15px; height: 40px; border: none; border-radius: 11px;
  cursor: pointer; font-size: 13.5px; font-weight: 650; white-space: nowrap;
  transition: all .16s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--accent-shadow); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel-3); border-color: var(--line-strong); }
.btn.plain { background: none; color: var(--muted); }
.btn.plain:hover { background: var(--panel-3); color: var(--text); }
.btn.danger { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 40px; padding: 0; }

.body-area { padding: 22px 26px 64px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.kpi::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--kc, var(--accent)); opacity: .85; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .kt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .ki {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--kbg, var(--accent-bg)); color: var(--kc, var(--accent)); flex: none;
}
.kpi .ki svg { width: 15px; height: 15px; stroke-width: 2; fill: none; stroke: currentColor; }
.kpi .kv { font-size: 26px; font-weight: 780; letter-spacing: -.035em; margin-top: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .kv i { font-style: normal; font-size: 15px; font-weight: 600; color: var(--muted-2); letter-spacing: -.02em; }
.kpi .kd { margin-top: 7px; font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 5px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 1px 6px; border-radius: 20px; font-size: 11px; }
.trend.up { color: var(--ok); background: var(--ok-bg); }
.trend.down { color: var(--err); background: var(--err-bg); }
.trend.flat { color: var(--muted); background: var(--muted-bg); }

.cards-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 12px; }
.card-head b { font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; }
.card-head .sub { font-size: 12px; color: var(--muted-2); font-weight: 500; }
.card-body { padding: 4px 18px 18px; }
.card-body.pad { padding: 6px 18px 18px; display: grid; gap: 14px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 108px; }
.bars .col { flex: 1; display: grid; gap: 3px; align-content: end; border-radius: 6px; padding: 2px; cursor: default; }
.bars .col:hover { background: var(--panel-3); }
.bars .seg { border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .seg.a { background: var(--accent); }
.bars .seg.b { background: var(--accent-soft); }
.bars-x { display: flex; gap: 8px; margin-top: 9px; }
.bars-x span { flex: 1; text-align: center; font-size: 11px; color: var(--muted-2); font-weight: 600; }
.bars-x span.today { color: var(--accent-strong); font-weight: 750; }
.distro-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-2); }
.lg .sw { width: 11px; height: 11px; border-radius: 3.5px; flex: none; }

.alert { display: flex; align-items: flex-start; gap: 11px; padding: 11px 18px; }
.alert + .alert { border-top: 1px solid var(--line); }
.alert .ai { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; }
.alert b { display: block; font-size: 13px; font-weight: 650; }
.alert span { font-size: 11.5px; color: var(--muted-2); }

.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.grid th, .grid td { padding: 0 16px; text-align: left; border-bottom: 1px solid var(--line-2); }
.grid th:first-child, .grid td:first-child { padding-left: 22px; }
.grid th:last-child, .grid td:last-child { padding-right: 22px; }
.grid thead th {
  height: 42px; background: var(--panel-2); color: var(--muted);
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid tbody tr { height: 56px; }
.grid tbody tr:hover td { background: var(--panel-2); }
.grid tbody tr:last-child td { border-bottom: none; }
.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.grid td.mono { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.grid td.name { font-weight: 650; }
.grid td.empty { text-align: center; color: var(--muted-2); padding: 34px 16px; }
.trunc { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.stt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  padding: 4px 10px; border-radius: 20px;
}
.stt i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.stt.ok { color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok-line); }
.stt.warn { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.stt.err { color: var(--err); background: var(--err-bg); border: 1px solid var(--err-line); }
.stt.neu { color: var(--muted); background: var(--muted-bg); border: 1px solid transparent; }
.stt.acc { color: var(--accent-strong); background: var(--accent-bg); border: 1px solid var(--accent-soft); }

.acc-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acc-ava {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
  background: var(--grad);
}
.acc-ava.r { border-radius: 50%; }
img.acc-ava { object-fit: cover; }
.acc-cell .an b { display: block; font-weight: 650; font-size: 13px; }
.acc-cell .an em { font-style: normal; display: block; color: var(--muted-2); font-size: 11px; font-family: var(--mono); }

.pbar { height: 7px; border-radius: 20px; background: var(--panel-3); overflow: hidden; min-width: 90px; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 20px; }

label.f { display: grid; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.inp {
  width: 100%; padding: 10px 13px; height: 40px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel-2); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
select.inp { cursor: pointer; }
.inp:focus { border-color: var(--accent); background: var(--bg-2); box-shadow: 0 0 0 3px var(--accent-shadow); }
.inp::placeholder { color: var(--muted-2); }
.hintline { font-size: 11.5px; color: var(--muted-2); font-weight: 500; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 14px; }
.search { position: relative; flex: 1; min-width: 190px; max-width: 340px; margin: 0; }
.search .inp { padding-left: 38px; }
.search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); fill: none; stroke: currentColor; stroke-width: 2; pointer-events: none; }

.segbar { display: inline-flex; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; gap: 3px; }
.segbar button, .segbar a {
  border: none; background: none; cursor: pointer; padding: 6px 13px;
  border-radius: 8px; font-size: 12.5px; color: var(--muted); font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.segbar button:hover, .segbar a:hover { color: var(--text); }
.segbar button[aria-pressed="true"], .segbar a.on { background: var(--bg-2); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.segbar em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.segbar a.on em { color: var(--accent-strong); }

.bulkbar {
  display: none; align-items: center; gap: 9px;
  margin: 0 18px 14px; padding: 10px 14px;
  background: var(--accent-bg); border: 1px solid var(--accent-soft); border-radius: 12px;
}
.bulkbar.on { display: flex; }
.bulkbar b { font-size: 13px; font-weight: 700; color: var(--accent-strong); }

.pager { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.pager .off { opacity: .45; pointer-events: none; }

tr.row-busy td { opacity: .5; }
tr.row-busy { position: relative; }

.cntlink {
  border: none; background: var(--accent-bg); color: var(--accent-strong);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; padding: 3px 11px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px; transition: background .15s;
}
.cntlink::after {
  content: ""; width: 13px; height: 13px; flex: none;
  background: currentColor; opacity: .6;
  -webkit-mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4"><path d="M9 6l6 6-6 6"/></svg>');
  mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4"><path d="M9 6l6 6-6 6"/></svg>');
}
.cntlink:hover { background: var(--accent-soft); }

.tgt-list { display: grid; gap: 8px; max-height: 56vh; overflow-y: auto; }
.tgt-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2);
}
.tgt-item:hover { border-color: var(--line-strong); background: var(--panel-3); }
.tgt-ava {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  background: var(--grad);
}
img.tgt-ava { object-fit: cover; background: var(--panel-3); }
.tgt-main { min-width: 0; flex: 1; }
.tgt-main b { display: block; font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-main .tgt-sub { font-size: 11.5px; color: var(--muted-2); }
.tgt-metric { text-align: right; flex: none; }
.tgt-metric b { display: block; font-size: 13.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tgt-metric span { font-size: 10.5px; color: var(--muted-2); }
.tgt-open {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); color: var(--muted);
}
.tgt-open:hover { border-color: var(--accent); color: var(--accent); }
.tgt-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.tgt-empty { padding: 34px 16px; text-align: center; color: var(--muted-2); font-size: 13px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; padding: 6px 18px 20px; }
.pgrid .empty-box { grid-column: 1 / -1; text-align: center; color: var(--muted-2); padding: 40px 16px; font-size: 13.5px; }
.pcard {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 15px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 13px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pcard.row-busy { opacity: .55; pointer-events: none; }
.pcard-head { display: flex; align-items: flex-start; gap: 11px; }
.pcard-ava {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
  background: var(--grad); object-fit: cover;
}
.pcard-name { min-width: 0; flex: 1; }
.pcard-name b { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-name .cat { font-size: 11.5px; color: var(--muted-2); }
.pcard-name .ids { display: block; font-size: 11px; color: var(--faint, var(--muted-2)); font-family: var(--mono); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.pcard-foot { display: flex; align-items: center; gap: 16px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.pcard-stat { display: grid; gap: 1px; }
.pcard-stat b, .pcard-stat .cntlink { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; padding: 0; }
.pcard-stat .cntlink { background: none; color: var(--accent-strong); }
.pcard-stat .cntlink:hover { background: var(--accent-bg); }
.pcard-stat span { font-size: 10.5px; color: var(--muted-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pcard-foot .grow { margin-left: auto; }

.chk { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; }
.chk input { margin-top: 2px; flex: none; }
.chk b { display: block; font-weight: 650; }
.chk > span > span { font-size: 11.5px; color: var(--muted-2); }

textarea.inp {
  height: auto; min-height: 96px; resize: vertical; border-radius: 12px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 12px 13px;
}
.r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(9, 15, 25, .58);
  display: none; place-items: center; padding: 22px; z-index: 80; backdrop-filter: blur(3px);
}
.modal-back.on { display: grid; }
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  width: min(580px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.modal-body { padding: 18px 20px; display: grid; gap: 15px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 16px 16px; }
.modal-foot .btn.danger { margin-right: auto; }

.msg.neu { background: var(--muted-bg); color: var(--muted); border: 1px solid var(--line); }
.msg.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
#formMsg { display: grid; gap: 8px; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 600; animation: toast-in .22s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast.run { border-left-color: var(--accent); display: grid; grid-template-columns: 1fr auto; gap: 9px 10px; align-items: center; }
.toast.run b { font-weight: 700; }
.toast.run .tp { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toast.run .pbar { grid-column: 1 / -1; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.soon-box {
  display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 64px 24px;
}
.soon-box .si {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent);
}
.soon-box .si svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.soon-box h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.03em; }
.soon-box p { margin: 0; color: var(--muted); max-width: 460px; font-size: 13.5px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 30px 28px;
}
.login-card .brand { justify-content: center; padding: 0 0 4px; }
.login-card h1 { margin: 14px 0 4px; font-size: 20px; font-weight: 750; letter-spacing: -.03em; text-align: center; }
.login-card .lead { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-form { display: grid; gap: 15px; }
.msg { padding: 11px 14px; border-radius: 11px; font-size: 12.5px; font-weight: 600; }
.msg.err { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); }
.msg.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }

@media (max-width: 1120px) {
  .cards-2 { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .brand { padding: 0 14px 0 4px; }
  .brand-text span, .nav-label, .nav-item .count { display: none; }
  .nav-item { width: auto; }
  .topbar { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .ph-text span { display: none; }
  .body-area { padding: 16px 16px 60px; }
  .me-info { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
