:root {
  --bg: #0f1420; --card: #171e2d; --card2: #1e2739; --line: #263049; --text: #e8ecf5; --muted: #8b95ab;
  --accent: #3d6bff; --ok: #3ddc84; --warn: #f2c14e; --bad: #ff6b6b; --info: #2ec4d6;
  --r: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + var(--safe-b)); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.top h1 { font-size: 22px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { font-size: 26px; padding: 0 8px 0 0; background: none; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.card.tap:active { background: var(--card2); }
.status { padding: 18px 16px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid var(--line); }
.status .big { font-size: 22px; font-weight: 700; }
.status.ok { background: linear-gradient(135deg, #12301f, #171e2d); border-color: #1f5c3a; }
.status.warn { background: linear-gradient(135deg, #3a2f12, #171e2d); border-color: #6b5520; }
.status.urgent { background: linear-gradient(135deg, #3d1717, #171e2d); border-color: #7a2a2a; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 2px 8px; }

.att { display: flex; gap: 12px; align-items: flex-start; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--muted); }
.dot.urgent, .dot.failed, .dot.bad { background: var(--bad); }
.dot.warn, .dot.unknown, .dot.interrupted { background: var(--warn); }
.dot.info { background: var(--info); }
.dot.ok, .dot.running.vm, .dot.done { background: var(--ok); }
.dot.stopped { background: #59627a; }
.dot.job { background: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loc { border-left: 4px solid var(--accent); }
.num { font-size: 26px; font-weight: 700; }

.search { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; }
.input, textarea { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; }
.input:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 140px; resize: vertical; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.vm { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list .vm:last-child { border-bottom: 0; }
.vm:active { background: var(--card2); }
.vm .name { font-weight: 600; }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; font-size: 15px; }
.vm.sel .check { background: var(--accent); border-color: var(--accent); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); white-space: nowrap; }

.btn { display: block; width: 100%; min-height: 54px; border-radius: 14px; border: 0; background: var(--accent); color: #fff; font-weight: 650; font-size: 17px; padding: 0 16px; margin-top: 10px; position: relative; overflow: hidden; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: #c43c3c; }
.btn.ghost.danger { background: transparent; color: var(--bad); border: 1px solid #7a2a2a; }
.btn.small { min-height: 42px; font-size: 15px; width: auto; display: inline-block; margin: 0; }
.btn .fill { position: absolute; inset: 0; width: 0; background: rgba(255,255,255,.28); }
.btn .lbl { position: relative; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.kv .k { color: var(--muted); }
.copy { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; font-size: 14px; }
.bar { height: 6px; background: var(--card2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.steps { list-style: none; padding: 0; margin: 8px 0 0; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.si { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; background: var(--card2); color: var(--muted); }
.si.done { background: var(--ok); color: #0b2416; }
.si.running { background: var(--accent); color: #fff; animation: pulse 0.8s infinite alternate; }
.si.failed { background: var(--bad); color: #fff; }
.si.skipped { background: #39425a; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: rgba(15,20,32,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 9px; font-size: 11px; color: var(--muted); }
.tabs a .ti { font-size: 20px; line-height: 24px; }
.tabs a.on { color: var(--accent); }

.selbar { position: fixed; left: 0; right: 0; bottom: calc(60px + var(--safe-b)); z-index: 15; padding: 10px 14px; background: var(--card2); border-top: 1px solid var(--line); }
.selbar .in { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
.selbar .btn { margin: 0; min-height: 46px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--card); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); max-height: 88vh; overflow-y: auto; padding: 8px 16px calc(18px + var(--safe-b)); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 8px; font-size: 19px; }
@media (min-width: 700px) { .sheet { max-width: 560px; margin: 0 auto; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); z-index: 40; background: #2a3550; border: 1px solid var(--line); color: var(--text); padding: 12px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.bad { background: #4a1f24; border-color: #7a2a2a; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; }

.login { max-width: 380px; margin: 12vh auto 0; padding: 20px; }
.login h1 { font-size: 26px; margin: 0 0 4px; }
.login .input { margin-top: 12px; }
.err { color: var(--bad); margin-top: 10px; min-height: 20px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.warnbox { background: #3a2f12; border: 1px solid #6b5520; border-radius: 12px; padding: 12px; margin: 10px 0; }
.badbox { background: #3d1717; border: 1px solid #7a2a2a; border-radius: 12px; padding: 12px; margin: 10px 0; }
.okbox { background: #12301f; border: 1px solid #1f5c3a; border-radius: 12px; padding: 12px; margin: 10px 0; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }
.colors { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.sw.on { border-color: #fff; }

.ministeps { display: flex; gap: 4px; margin: 6px 0 4px; }
.ms { flex: 1; height: 5px; border-radius: 3px; background: var(--card2); }
.ms.done { background: var(--ok); } .ms.running { background: var(--accent); animation: pulse .8s infinite alternate; }
.ms.failed { background: var(--bad); } .ms.skipped { background: #39425a; }
.rk { padding: 9px 0; border-top: 1px solid rgba(255,255,255,.08); gap: 12px; }
.rk input { width: 22px; height: 22px; accent-color: var(--bad); flex: none; }

/* sessions screen */
.big2 { font-size: 18px; font-weight: 700; }
.chip .cn { opacity: .75; }
.chip.small { padding: 5px 11px; font-size: 13px; }
.vm.sess { align-items: flex-start; }
.vm.sess .dot { margin-top: 7px; }
.ram { width: 92px; flex: none; text-align: right; }
.ram .bar { margin-top: 4px; }
.ram .hot { color: var(--bad); font-weight: 700; }
.okt { color: var(--ok); } .warnt { color: var(--warn); }
.note { margin-top: 12px; }
.tabs a { font-size: 10.5px; }

/* departments / locations / network isolation */
.btn.big { min-height: 64px; font-size: 18px; margin-top: 14px; }
.btn.hold { touch-action: none; user-select: none; -webkit-user-select: none; }
.center { text-align: center; margin-top: 6px; }
.nettag { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: #4a1f1f; color: #ff9b9b; }
.nettag.partial { background: #4a3d16; color: #f2c14e; }
.card.loc.off { box-shadow: inset 0 0 0 1px #7a2a2a; }
.nodept { display: block; margin-top: 14px; }
.pw { font-size: 18px; word-break: break-all; user-select: all; -webkit-user-select: all; }
button.vm { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; }
h1.ell { min-width: 0; flex: 1; }
