:root {
  --bg: #060b11;
  --bg-soft: #081019;
  --panel: #0b141d;
  --panel-2: #0e1924;
  --panel-3: #111f2c;
  --line: rgba(150, 181, 201, 0.14);
  --line-strong: rgba(150, 181, 201, 0.26);
  --text: #e7eff6;
  --text-2: #b6c7d4;
  --muted: #7d93a5;
  --dim: #526879;
  --accent: #35e0c8;
  --accent-deep: #159d8b;
  --accent-soft: rgba(53, 224, 200, 0.12);
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.13);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.12);
  --blue: #6ea8fe;
  --blue-soft: rgba(110, 168, 254, 0.12);
  --radius: 14px;
  --sidebar: 232px;
  --topbar: 58px;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { display: flex; height: 100vh; }

/* ------------------------------------------------------------------ sidebar */
.sidebar {
  width: var(--sidebar);
  flex: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(53, 224, 200, 0.07), transparent 34%),
    linear-gradient(180deg, #081019 0%, #071018 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  position: relative;
  z-index: 5;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: .4;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-mark { width: 34px; height: 38px; color: var(--accent); filter: drop-shadow(0 0 12px rgba(53, 224, 200, .35)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-type { display: flex; flex-direction: column; line-height: 1; }
.brand-type strong { font-size: 21px; letter-spacing: 4px; font-weight: 650; }
.brand-type span { font-family: var(--mono); font-size: 8px; letter-spacing: 2.8px; color: var(--muted); margin-top: 5px; }

.workspace {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: var(--text-2);
  transition: border-color .2s, background .2s;
}
.workspace:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.workspace .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }
.workspace span:nth-child(2) { display: flex; flex-direction: column; font-size: 11.5px; flex: 1; }
.workspace small { color: var(--dim); font-size: 9.5px; letter-spacing: .5px; margin-bottom: 1px; }
.workspace .icon { width: 14px; height: 14px; color: var(--dim); }

.nav { margin-top: 20px; flex: 1; overflow-y: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-label {
  padding: 13px 10px 7px;
  font-size: 9.5px;
  letter-spacing: 2px;
  color: var(--dim);
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #91a6b7;
  font-size: 13px;
  text-align: left;
  position: relative;
  transition: color .18s, background .18s;
}
.nav-item .icon { width: 17px; height: 17px; opacity: .9; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--accent); background: linear-gradient(90deg, rgba(53,224,200,.14), rgba(53,224,200,.04)); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(53,224,200,.7);
}
.nav-badge {
  margin-left: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  min-width: 20px; text-align: center;
  padding: 1px 6px;
  border-radius: 9px;
  color: var(--accent);
  background: rgba(53,224,200,.12);
}
.nav-badge.amber { color: var(--amber); background: var(--amber-soft); }

.sidebar-foot { padding-top: 12px; }
.link-health {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  border-radius: 10px;
  padding: 10px 11px 8px;
  overflow: hidden;
}
.lh-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 10px; }
.lh-head b { color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.lh-chart { width: 100%; height: 30px; color: var(--accent); margin: 3px 0 2px; }
.lh-meta { display: flex; gap: 13px; color: var(--dim); font-size: 9.5px; }
.lh-meta span { display: flex; align-items: center; gap: 4px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--accent); box-shadow: 0 0 7px rgba(53,224,200,.7); }
.dot.idle { background: var(--blue); }
.dot.warn { background: var(--amber); box-shadow: 0 0 7px rgba(245,165,36,.6); }
.dot.bad { background: var(--red); box-shadow: 0 0 7px rgba(255,93,108,.6); }
.account { display: flex; align-items: center; gap: 9px; padding: 13px 4px 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1f8f83, #0d4d54);
  color: #d9fff8; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(53,224,200,.3);
}
.account-type { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.account-type strong { font-size: 12px; font-weight: 550; }
.account-type span { color: var(--dim); font-size: 9.5px; }

/* ------------------------------------------------------------------- main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.main::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 78% -10%, rgba(53,224,200,.055), transparent 34%),
    radial-gradient(circle at 10% 100%, rgba(110,168,254,.035), transparent 28%);
}
.topbar {
  height: var(--topbar); flex: none;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  background: rgba(7, 14, 21, .78);
  backdrop-filter: blur(14px);
  position: relative; z-index: 4;
}
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--dim); }
.crumbs strong { color: var(--text-2); font-weight: 500; }
.crumbs i { font-style: normal; color: #334552; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  min-width: 250px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  background: rgba(255,255,255,.018);
  font-size: 11px;
  text-align: left;
}
.search-trigger .icon { width: 15px; height: 15px; }
.search-trigger span { flex: 1; }
.search-trigger kbd {
  font-family: var(--mono); font-size: 9px; color: var(--dim);
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
  position: relative;
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; }
.icon-btn.small .icon { width: 15px; height: 15px; }
.notify {
  position: absolute; top: 6px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 6px var(--amber);
}
.clock { display: flex; flex-direction: column; line-height: 1.1; padding-left: 8px; border-left: 1px solid var(--line); }
.clock b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: .3px; }
.clock span { color: var(--dim); font-size: 8.5px; letter-spacing: 1px; }

.page {
  flex: 1; overflow-y: auto; padding: 24px 28px 18px;
  position: relative; z-index: 2;
  scrollbar-width: thin; scrollbar-color: #233746 transparent;
}
.page::-webkit-scrollbar { width: 8px; }
.page::-webkit-scrollbar-thumb { background: #233746; border-radius: 8px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.eyebrow { color: var(--accent); font-size: 9.5px; letter-spacing: 2.2px; text-transform: uppercase; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(53,224,200,.5);
  animation: pulse 2.4s infinite;
}
.pulse.small { width: 5px; height: 5px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53,224,200,.45); }
  70% { box-shadow: 0 0 0 7px rgba(53,224,200,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,224,200,0); }
}
.page-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.live-pill {
  font-family: var(--mono); font-size: 8px; letter-spacing: 1.4px;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(53,224,200,.28);
  padding: 3px 7px; border-radius: 4px;
  position: relative; top: 2px;
}
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.page-actions { display: flex; gap: 8px; padding-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-2);
  transition: border-color .18s, background .18s, color .18s, transform .18s;
  white-space: nowrap;
}
.btn .icon { width: 15px; height: 15px; }
.btn:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); color: var(--text); }
.btn.primary {
  background: linear-gradient(180deg, #41e6cf, #25c8b3);
  border-color: transparent; color: #04211e; font-weight: 600;
  box-shadow: 0 4px 18px rgba(53,224,200,.18);
}
.btn.primary:hover { background: linear-gradient(180deg, #5af0db, #2fd5bf); color: #031a18; }
.btn.ghost { background: rgba(255,255,255,.018); }
.btn.block { width: 100%; height: 38px; }

/* --------------------------------------------------------------- telemetry */
.telemetry {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(14,25,36,.86), rgba(9,17,25,.86));
  overflow: hidden;
  margin-bottom: 16px;
}
.metric {
  padding: 13px 16px 12px;
  border-right: 1px solid var(--line);
  position: relative;
  min-width: 0;
}
.metric:last-child { border-right: 0; }
.metric.alert { background: linear-gradient(180deg, rgba(245,165,36,.035), transparent); }
.metric-label { color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.metric-value { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.metric-value b { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -.5px; }
.metric-value span { color: var(--dim); font-size: 10.5px; }
.metric.alert .metric-value b { color: var(--amber); }
.metric-foot { display: flex; gap: 10px; color: var(--dim); font-size: 9.5px; margin-top: 3px; position: relative; z-index: 2; }
.trend.up { color: var(--accent); }
.trend.good { color: var(--accent); }
.trend.warn { color: var(--amber); }
.spark { position: absolute; right: 12px; bottom: 12px; width: 92px; height: 30px; color: var(--accent); opacity: .75; }
.spark.blue { color: var(--blue); }
.spark.amber { color: var(--amber); }

/* ----------------------------------------------------------------- toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
  transition: all .18s;
}
.chip em { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--dim); }
.chip:hover { color: var(--text-2); background: rgba(255,255,255,.035); }
.chip.active { color: var(--accent); background: var(--accent-soft); border-color: rgba(53,224,200,.22); }
.chip.active em { color: var(--accent); }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.inline-search {
  display: flex; align-items: center; gap: 6px;
  height: 30px; width: 150px;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0 9px;
  background: rgba(255,255,255,.018);
  color: var(--dim);
}
.inline-search .icon { width: 14px; height: 14px; }
.inline-search input { width: 100%; background: none; border: 0; outline: none; color: var(--text-2); font-size: 11px; }
.inline-search input::placeholder { color: var(--dim); }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); }
.segmented button {
  width: 27px; height: 24px; border-radius: 5px;
  color: var(--dim); font-family: var(--mono); font-size: 10px;
}
.segmented button.active { color: var(--accent); background: var(--accent-soft); }
.interval {
  height: 30px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); font-family: var(--mono); font-size: 10px;
  display: flex; align-items: center; gap: 6px;
}

/* -------------------------------------------------------------------- wall */
.wall {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 13px;
}
.device-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
  animation: cardIn .35s both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.device-card:hover { transform: translateY(-2px); border-color: rgba(53,224,200,.4); box-shadow: 0 12px 30px rgba(0,0,0,.28), 0 0 0 1px rgba(53,224,200,.08); }
.device-card.alert { border-color: rgba(245,165,36,.42); }
.device-card.alert:hover { box-shadow: 0 12px 30px rgba(0,0,0,.3), 0 0 0 1px rgba(245,165,36,.15); }
.device-card.offline .shot img { filter: grayscale(1) brightness(.7); }
.device-card.offline:hover { border-color: var(--line-strong); }
.shot { aspect-ratio: 16 / 9; position: relative; background: #0a1118; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.device-card:hover .shot img { transform: scale(1.015); }
.shot-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,9,14,.58) 0%, transparent 30%, transparent 55%, rgba(4,9,14,.86) 100%);
  pointer-events: none;
}
.shot-top { position: absolute; top: 9px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 7px;
  border-radius: 5px;
  background: rgba(6,12,17,.72);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  font-size: 9.5px;
  white-space: nowrap;
}
.status-pill .dot { width: 5px; height: 5px; }
.status-pill.warn { color: #ffd18a; border-color: rgba(245,165,36,.32); }
.status-pill.bad { color: #ffb6bd; border-color: rgba(255,93,108,.3); }
.latency {
  font-family: var(--mono); font-size: 9.5px; color: rgba(230,240,248,.75);
  background: rgba(6,12,17,.58); padding: 2px 6px; border-radius: 4px;
  backdrop-filter: blur(5px);
}
.latency.good { color: #8ef5e4; }
.latency.mid { color: #ffd18a; }
.latency.bad { color: #ff9aa4; }
.shot-bottom {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.shot-bottom h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .2px; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.shot-bottom p { margin: 2px 0 0; color: rgba(210,224,234,.72); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.quick-connect {
  width: 27px; height: 27px; border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(53,224,200,.94); color: #04211e;
  opacity: 0; transform: translateY(3px);
  transition: opacity .18s, transform .18s;
  flex: none;
}
.quick-connect .icon { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.device-card:hover .quick-connect { opacity: 1; transform: none; }
.alert-flag {
  position: absolute; top: 9px; right: 10px;
  display: none;
}
.device-card.alert .alert-flag, .device-card.has-alert .alert-flag { display: flex; }
.device-card.alert .latency, .device-card.has-alert .latency { display: none; }
.device-card.offline.has-alert { border-color: rgba(255, 93, 108, 0.32); }
.alert-flag span {
  display: flex; align-items: center; gap: 4px;
  background: rgba(65,38,8,.86); border: 1px solid rgba(245,165,36,.4);
  color: #ffd18a; border-radius: 5px; padding: 2px 6px; font-size: 9px;
  backdrop-filter: blur(6px);
}
.alert-flag .icon { width: 11px; height: 11px; }
.card-body { padding: 9px 12px 10px; border-top: 1px solid rgba(150,181,201,.08); }
.user-row { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; margin-bottom: 7px; }
.user-row .icon { width: 13px; height: 13px; color: var(--dim); }
.user-row .uname { color: var(--text-2); }
.session-tag { margin-left: auto; color: var(--dim); font-size: 9.5px; }
.session-tag.live { color: var(--accent); }
.metrics { display: flex; gap: 10px; align-items: center; }
.metric-mini { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 9px; font-family: var(--mono); }
.metric-mini .icon { width: 12px; height: 12px; color: #4d6272; }
.bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); opacity: .75; }
.bar.amber i { background: var(--amber); }
.bar.blue i { background: var(--blue); }
.bar.red i { background: var(--red); }
.metric-mini b { font-weight: 400; color: #8fa6b7; min-width: 24px; text-align: right; }

.wall-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 14px; padding: 0 2px; }
.legend { display: flex; gap: 14px; color: var(--dim); font-size: 9.5px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.wall-note { color: var(--dim); font-size: 9.5px; display: flex; align-items: center; gap: 6px; }
.wall-note .icon { width: 13px; height: 13px; color: var(--accent-deep); }

.statusbar {
  height: 30px; flex: none;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 11px;
  padding: 0 26px;
  color: var(--dim);
  font-size: 9.5px;
  background: #071018;
  position: relative; z-index: 3;
}
.statusbar > div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.statusbar b { color: var(--text-2); font-weight: 500; font-family: var(--mono); font-size: 9px; }
.status-sep { width: 1px; height: 10px; background: var(--line); }
.status-right { margin-left: auto; gap: 16px !important; }
.status-right span:last-child { font-family: var(--mono); }

/* ---------------------------------------------------------------- table views */
.view-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.view-head h1 { margin: 0; font-size: 24px; font-weight: 600; }
.view-head p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table-toolbar .muted { color: var(--dim); font-size: 10.5px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 9px 14px; color: var(--dim); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 500; background: rgba(255,255,255,.018); border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid rgba(150,181,201,.075); font-size: 11.5px; color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; cursor: pointer; }
tbody tr:hover { background: rgba(53,224,200,.035); }
.cell-device { display: flex; align-items: center; gap: 9px; }
.cell-device .mini-avatar { width: 28px; height: 28px; border-radius: 6px; background: #122430; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line); }
.cell-device .mini-avatar .icon { width: 14px; height: 14px; }
.cell-device strong { display: block; font-size: 11.5px; font-weight: 550; }
.cell-device span { display: block; color: var(--dim); font-size: 9.5px; margin-top: 1px; }
.cell-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; }
.cell-mono { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.cell-actions { display: flex; gap: 5px; justify-content: flex-end; }
.mini-btn { height: 25px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 9.5px; display: inline-flex; align-items: center; gap: 4px; }
.mini-btn:hover { color: var(--accent); border-color: rgba(53,224,200,.3); }
.mini-btn .icon { width: 12px; height: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 9px; }
.pill.ok { color: var(--accent); background: var(--accent-soft); }
.pill.warn { color: var(--amber); background: var(--amber-soft); }
.pill.bad { color: var(--red); background: var(--red-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }

/* ---------------------------------------------------------------- drawer */
.scrim {
  position: fixed; inset: 0; background: rgba(2,6,9,.62);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 20;
  backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px;
  background: linear-gradient(180deg, #0a141e, #08111a);
  border-left: 1px solid var(--line-strong);
  z-index: 21; transform: translateX(102%);
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px rgba(0,0,0,.4);
}
.drawer.show { transform: none; }
.drawer-head { padding: 20px 20px 14px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .4px; }
.drawer-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.drawer-preview { margin: 14px 20px 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); position: relative; background: #050a0f; }
.drawer-preview img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.preview-overlay { position: absolute; left: 8px; right: 8px; bottom: 7px; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 9px; color: var(--text-2); }
.drawer-actions { display: flex; gap: 6px; padding: 12px 20px 4px; }
.drawer-actions .btn.block { flex: 1; }
.icon-btn.bordered { border: 1px solid var(--line); width: 38px; height: 38px; }
.tabs { display: flex; gap: 18px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.tabs button { padding: 0 0 9px; color: var(--dim); font-size: 11px; position: relative; }
.tabs button.active { color: var(--accent); }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 10px 12px; font-size: 11px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--text-2); }
.section-label { color: var(--dim); font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; margin: 20px 0 10px; }
.resource-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 10px; color: var(--muted); }
.resource-row .icon { width: 13px; height: 13px; color: var(--dim); }
.resource-row .bar { height: 4px; }
.resource-row b { width: 34px; text-align: right; font-family: var(--mono); font-size: 9.5px; color: var(--text-2); font-weight: 400; }
.link-card { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: rgba(255,255,255,.018); }
.link-path { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--text-2); }
.link-path .icon { width: 14px; height: 14px; color: var(--accent); }
.link-path b { font-family: var(--mono); font-size: 9.5px; color: var(--dim); font-weight: 400; margin-left: auto; }
.link-line { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
.link-line span { height: 3px; flex: 1; border-radius: 3px; background: rgba(53,224,200,.3); }
.link-line span:nth-child(2) { background: rgba(53,224,200,.55); }
.link-line span:nth-child(3) { background: var(--accent); }
.link-meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 9px; margin-top: 6px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 11px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); background: var(--panel); margin-top: 3px; flex: none; z-index: 1; }
.tl-dot.amber { border-color: var(--amber); }
.tl-dot.gray { border-color: var(--dim); }
.tl-content { flex: 1; }
.tl-content b { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-2); }
.tl-content span { display: block; color: var(--dim); font-size: 9px; margin-top: 2px; }
.tl-content time { color: var(--dim); font-family: var(--mono); font-size: 8.5px; }

/* ---------------------------------------------------------------- modal */
.modal-wrap {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(2,6,9,.72);
  backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-wrap.show { opacity: 1; pointer-events: auto; }
.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: linear-gradient(180deg, #0d1924, #09131c);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  transform: translateY(8px) scale(.99); transition: transform .2s;
}
.modal-wrap.show .modal { transform: none; }
.modal-head { display: flex; gap: 13px; align-items: flex-start; }
.modal-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(53,224,200,.25); color: var(--accent); display: grid; place-items: center; flex: none; }
.modal-icon .icon { width: 19px; height: 19px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-head h2 span { color: var(--accent); }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-device { display: flex; gap: 11px; align-items: center; margin: 18px 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.02); }
.modal-device img { width: 118px; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; }
.modal-device-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.modal-device-meta strong { font-size: 12px; font-weight: 550; }
.modal-device-meta > span:last-child { color: var(--dim); font-size: 9.5px; }
.modal-device-meta .status-pill { width: fit-content; height: 19px; }
.form-row { margin: 15px 0; }
.form-row > label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-card { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--muted); position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card .icon { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--dim); }
.radio-card b { font-size: 11px; font-weight: 550; color: var(--text-2); }
.radio-card span { font-size: 9px; color: var(--dim); }
.radio-card.active { border-color: rgba(53,224,200,.42); background: var(--accent-soft); }
.radio-card.active .icon { color: var(--accent); }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row > .switch-line, .switch-line { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin: 0 !important; }
.switch-line > span { display: flex; flex-direction: column; flex: 1; }
.switch-line b { font-size: 10.5px; font-weight: 550; color: var(--text-2); }
.switch-line small { font-size: 8.5px; color: var(--dim); margin-top: 1px; }
.switch-line input { position: absolute; opacity: 0; }
.switch { width: 28px; height: 16px; border-radius: 10px; background: #243543; position: relative; transition: background .18s; flex: none; }
.switch::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #7d93a5; top: 2px; left: 2px; transition: all .18s; }
.switch-line input:checked + .switch { background: rgba(53,224,200,.4); }
.switch-line input:checked + .switch::after { background: var(--accent); transform: translateX(12px); }
.notice { display: flex; gap: 8px; padding: 9px 10px; border-radius: 7px; background: rgba(110,168,254,.07); border: 1px solid rgba(110,168,254,.18); color: #9db9d8; font-size: 9.5px; line-height: 1.5; }
.notice .icon { width: 14px; height: 14px; color: var(--blue); flex: none; margin-top: 1px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* --------------------------------------------------------------- session */
.session-view {
  position: fixed; inset: 0; z-index: 40; background: #020609;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.session-view.show { opacity: 1; pointer-events: auto; }
.sv-top { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #071018; border-bottom: 1px solid var(--line); }
.sv-title { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.sv-title b { color: var(--text); font-size: 12px; font-weight: 550; }
.sv-actions { display: flex; align-items: center; gap: 14px; }
.rec { display: flex; align-items: center; gap: 5px; color: #ff9aa4; font-family: var(--mono); font-size: 9.5px; }
.rec i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.icon-btn.light { color: var(--text-2); }
.sv-canvas { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; background: #020609; }
.sv-canvas img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sv-watermark { position: absolute; right: 22px; bottom: 18px; text-align: right; color: rgba(255,255,255,.32); font-family: var(--mono); pointer-events: none; }
.sv-watermark b { display: block; font-size: 10px; font-weight: 500; }
.sv-watermark span { display: block; font-size: 9px; margin-top: 2px; }
.sv-watermark small { display: block; font-size: 8px; margin-top: 2px; opacity: .7; }
.sv-toolbar { height: 60px; flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; background: #071018; border-top: 1px solid var(--line); padding: 0 14px; }
.sv-toolbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; height: 44px; justify-content: center; border-radius: 6px; color: var(--muted); font-size: 8.5px; }
.sv-toolbar button:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sv-toolbar button .icon { width: 17px; height: 17px; }
.sv-toolbar button.danger { color: #ff8e98; }
.sv-divider { width: 1px; height: 22px; background: var(--line); margin: 0 8px; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 22px; bottom: 42px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #0d1b26; border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  color: var(--text-2); font-size: 10.5px;
  padding: 10px 13px; border-radius: 7px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  animation: toastIn .22s both;
  max-width: 360px;
}
.toast .icon { width: 14px; height: 14px; color: var(--accent); }
.toast.amber { border-left-color: var(--amber); }
.toast.amber .icon { color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(5px); } }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1380px) {
  .wall { gap: 11px; }
  .shot-bottom p { max-width: 180px; }
  .telemetry .spark { width: 68px; opacity: .55; }
}
@media (max-width: 1180px) {
  :root { --sidebar: 76px; }
  .sidebar { padding-left: 10px; padding-right: 10px; align-items: center; }
  .brand { padding-left: 0; padding-right: 0; }
  .brand-type, .workspace span:nth-child(2), .workspace .icon, .nav-label, .nav-item span, .nav-badge, .sidebar-foot .link-health, .account-type, .account .icon-btn { display: none; }
  .workspace { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .workspace .ws-dot { width: 9px; height: 9px; }
  .nav { width: 100%; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item .icon { width: 20px; height: 20px; }
  .account { justify-content: center; }
  .wall { --cols: 2 !important; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .topbar { padding: 0 14px; }
  .search-trigger { min-width: 0; width: 34px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .clock { display: none; }
  .page { padding: 16px 14px; }
  .page-head { flex-direction: column; }
  .page-head h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .telemetry { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: space-between; }
  .wall { --cols: 1 !important; }
  .wall-foot { flex-direction: column; align-items: flex-start; }
  .drawer { width: 100%; }
  .statusbar { padding: 0 14px; gap: 7px; }
  .statusbar > div:nth-child(3), .statusbar > div:nth-child(4), .statusbar > div:nth-child(5) { display: none; }
  .status-right span:first-child { display: none; }
  .sv-toolbar { overflow-x: auto; justify-content: flex-start; }
  .form-row.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------- alt views */
.alt-view { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-grid.three { grid-template-columns: repeat(3, 1fr); }
.summary-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(15,27,39,.9), rgba(9,17,25,.9));
  padding: 15px 16px;
  min-width: 0;
}
.summary-card > span { display: block; color: var(--muted); font-size: 10px; }
.summary-card b { display: flex; align-items: baseline; gap: 3px; margin: 4px 0 3px; font-family: var(--mono); font-size: 25px; font-weight: 500; }
.summary-card b em { color: var(--dim); font-size: 11px; font-style: normal; }
.summary-card small { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 9.5px; }
.summary-card.accent { border-color: rgba(53,224,200,.24); background: linear-gradient(180deg, rgba(53,224,200,.075), rgba(9,17,25,.9)); }
.summary-card.accent b { color: var(--accent); }
.summary-card.warn { border-color: rgba(245,165,36,.24); }
.summary-card.warn b { color: var(--amber); }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.panel-head b { font-size: 11px; font-weight: 550; }
.panel-head > span { color: var(--dim); font-size: 9.5px; }
.panel-body { padding: 14px; }
.health-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(150,181,201,.075); font-size: 10.5px; color: var(--text-2); }
.health-row:last-child { border-bottom: 0; }
.health-row span { display: flex; align-items: center; gap: 7px; }
.health-row b { font-weight: 400; color: var(--muted); }
.placeholder-panel { border: 1px dashed var(--line-strong); border-radius: 13px; padding: 70px 30px; text-align: center; background: rgba(255,255,255,.012); }
.ph-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; border: 1px solid rgba(53,224,200,.2); }
.ph-icon .icon { width: 22px; height: 22px; }
.placeholder-panel b { display: block; font-size: 15px; font-weight: 550; }
.placeholder-panel p { max-width: 540px; margin: 7px auto 14px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-inline { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: 9px; }
.empty-inline .icon { width: 24px; height: 24px; color: var(--dim); margin-bottom: 8px; }
.empty-inline b { font-size: 11px; font-weight: 550; }
.empty-inline span { color: var(--dim); font-size: 9.5px; margin-top: 3px; max-width: 250px; }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--dim); }
.empty-state .icon { width: 28px; height: 28px; margin-bottom: 10px; }
.empty-state b { color: var(--text-2); font-size: 12px; font-weight: 500; }
.empty-state span { font-size: 10px; margin-top: 4px; }

@media (max-width: 1180px) {
  .summary-grid, .summary-grid.three { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .summary-grid, .summary-grid.three { grid-template-columns: 1fr 1fr; }
  .summary-card b { font-size: 21px; }
}

/* --------------------------------------------------------------- auth + operations */
.auth-screen {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: radial-gradient(circle at 70% 20%, rgba(53,224,200,.12), transparent 32%), #050b11;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.auth-screen.show { opacity: 1; pointer-events: auto; }
.auth-card { width: min(420px, calc(100vw - 32px)); padding: 30px; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(180deg, #0d1924, #09131c); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 38px; color: var(--accent); }
.auth-brand .brand-mark { width: 32px; height: 36px; }
.auth-brand strong { display: block; color: var(--text); font-size: 18px; letter-spacing: 1px; }
.auth-brand span { display: block; color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 1.5px; margin-top: 4px; }
.auth-card h1 { margin: 0; font-size: 25px; }
.auth-card > p { margin: 7px 0 22px; color: var(--muted); font-size: 11px; }
.auth-form { display: grid; gap: 13px; }
.auth-form label, .provision-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.auth-form input, .provision-form input, .provision-form textarea, .file-toolbar input { width: 100%; border: 1px solid var(--line); border-radius: 7px; outline: none; background: rgba(255,255,255,.03); color: var(--text); padding: 10px 11px; }
.auth-form input:focus, .provision-form input:focus, .provision-form textarea:focus { border-color: rgba(53,224,200,.55); box-shadow: 0 0 0 3px rgba(53,224,200,.08); }
.auth-card small { display: block; margin-top: 18px; color: var(--dim); font-size: 9px; line-height: 1.65; }
.auth-error { min-height: 16px; color: var(--red); font-size: 10px; }
.provision-modal { width: min(620px, calc(100vw - 32px)); }
.provision-form { display: grid; gap: 13px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.provision-result { margin-top: 14px; }
.provision-success { border: 1px solid rgba(53,224,200,.3); background: var(--accent-soft); border-radius: 9px; padding: 13px; color: var(--text-2); font-size: 10px; }
.provision-success b { color: var(--accent); font-size: 12px; }
.provision-success p { margin: 6px 0; }
.provision-success code { display: block; padding: 8px; border-radius: 6px; background: rgba(0,0,0,.22); color: #baffef; font-family: var(--mono); line-height: 1.7; }
.provision-success small { display: block; margin-top: 7px; color: var(--muted); }
.files-modal { width: min(650px, calc(100vw - 32px)); }
.file-toolbar { display: flex; gap: 8px; align-items: center; margin: 18px 0 12px; }
.file-toolbar input { flex: 1; padding: 7px; font-size: 10px; }
.file-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid rgba(150,181,201,.08); }
.file-row:last-child { border-bottom: 0; }
.file-row > .icon { color: var(--accent); width: 16px; height: 16px; }
.file-row > div { min-width: 0; flex: 1; }
.file-row b, .file-row span { display: block; }
.file-row b { color: var(--text-2); font-size: 11px; }
.file-row span { color: var(--dim); font-size: 9px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--dim); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.sv-resolution { position: absolute; left: 18px; bottom: 16px; color: rgba(220,235,242,.65); background: rgba(4,9,14,.65); border: 1px solid rgba(150,181,201,.18); border-radius: 5px; padding: 4px 7px; font-family: var(--mono); font-size: 9px; }
@media (max-width: 600px) { .auth-card { padding: 24px; } .form-grid { grid-template-columns: 1fr; } .file-toolbar { flex-direction: column; align-items: stretch; } }
