:root {
  --bg: #0b0f14;
  --bg-elevated: #121820;
  --panel: #151c26;
  --ink: #e8edf4;
  --muted: #8b98a8;
  --line: rgba(255, 255, 255, 0.08);
  --line-focus: rgba(56, 189, 248, 0.45);
  --brand: #38bdf8;
  --brand-dim: rgba(56, 189, 248, 0.12);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 10px;
  --font: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(56, 189, 248, 0.07), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #7dd3fc; }

/* Login — 风机 / 充气城堡 / 手机遥控场景 */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr minmax(320px, 400px);
  align-items: center;
  gap: 40px;
  padding: 32px 48px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 18% 40%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(700px 420px at 70% 80%, rgba(251, 191, 36, 0.08), transparent 50%),
    linear-gradient(160deg, #070b12 0%, #0b1220 45%, #081018 100%);
}
.login-scene {
  position: relative;
  min-height: 520px;
  height: min(70vh, 620px);
}
.scene-caption {
  position: absolute;
  left: 8%;
  bottom: 4%;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}

.wind-layer span {
  position: absolute;
  width: 48px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.55), transparent);
  animation: windMove 4.5s linear infinite;
  opacity: 0.55;
}
.wind-layer span:nth-child(1) { top: 18%; left: -10%; animation-duration: 5s; }
.wind-layer span:nth-child(2) { top: 28%; left: -20%; animation-duration: 3.8s; width: 70px; }
.wind-layer span:nth-child(3) { top: 42%; left: -5%; animation-duration: 4.2s; }
.wind-layer span:nth-child(4) { top: 55%; left: -15%; animation-duration: 5.5s; width: 60px; }
.wind-layer span:nth-child(5) { top: 66%; left: -8%; animation-duration: 3.6s; }
.wind-layer span:nth-child(6) { top: 22%; left: 10%; animation-duration: 6s; width: 36px; opacity: 0.35; }
.wind-layer span:nth-child(7) { top: 48%; left: 5%; animation-duration: 4.8s; width: 80px; }
.wind-layer span:nth-child(8) { top: 72%; left: 0%; animation-duration: 5.2s; }

@keyframes windMove {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 0.6; }
  85% { opacity: 0.35; }
  100% { transform: translateX(70vw); opacity: 0; }
}

.scene-art {
  position: absolute;
  left: 0;
  right: 12%;
  bottom: 2%;
  width: 88%;
  z-index: 2;
}
.scene-art svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.35));
}
.castle-bounce { animation: castleFloat 3.2s ease-in-out infinite; transform-origin: 200px 318px; }
.flag { animation: flagWave 1.4s ease-in-out infinite; transform-origin: 200px 48px; }

@keyframes castleFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.012); }
}
@keyframes flagWave {
  0%, 100% { transform: skewX(0deg); }
  50% { transform: skewX(-10deg); }
}

/* 气流：风机(右) → 城堡(左) */
.duct-air {
  offset-path: path("M470 268 C430 268 400 272 370 272");
  offset-rotate: 0deg;
  animation: ductFlow 1.6s linear infinite;
  opacity: 0.9;
}
.duct-air.a2 { animation-delay: 0.5s; }
.duct-air.a3 { animation-delay: 1s; }
@keyframes ductFlow {
  0% { offset-distance: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 0.75; }
  100% { offset-distance: 100%; opacity: 0; }
}

.blower-body { animation: blowerShake 0.18s linear infinite; transform-origin: 600px 312px; }
.impeller {
  animation: spinFan 0.35s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.power-led { animation: signalBlink 1.2s ease-in-out infinite; }
.outlet-air path {
  stroke-dasharray: 6 8;
  animation: airDash 0.7s linear infinite;
}

@keyframes blowerShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(0.4px, -0.3px); }
  50% { transform: translate(-0.3px, 0.2px); }
  75% { transform: translate(0.2px, 0.3px); }
}
@keyframes spinFan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes airDash {
  to { stroke-dashoffset: -28; }
}

.phone-wrap {
  position: absolute;
  left: auto;
  right: 22%;
  top: 7%;
  z-index: 4;
  width: 168px;
}
.phone {
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-radius: 22px;
  padding: 10px 8px 12px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: phoneFloat 4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
.phone-notch {
  width: 42%;
  height: 6px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #020617;
}
.phone-screen {
  background: #020617;
  border-radius: 14px;
  padding: 10px 10px 12px;
  min-height: 220px;
}
.phone-app-bar {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.phone-device {
  font-size: 0.68rem;
  color: #34d399;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
.phone-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.phone-metrics div {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}
.phone-metrics b {
  display: block;
  font-size: 0.95rem;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}
.phone-metrics span {
  font-size: 0.62rem;
  color: #94a3b8;
}
.phone-btns {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.phone-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}
.phone-btn.on { background: #38bdf8; color: #041018; }
.phone-btn.off {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.phone-btn.pulse { animation: btnPulse 2s ease-in-out infinite; }
.phone-signal {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  color: #64748b;
  font-size: 0.58rem;
}
.phone-signal i {
  display: block;
  width: 3px;
  background: #34d399;
  border-radius: 1px;
}
.phone-signal i:nth-child(1) { height: 4px; }
.phone-signal i:nth-child(2) { height: 7px; }
.phone-signal i:nth-child(3) { height: 10px; }
.phone-signal i:nth-child(4) { height: 13px; opacity: 0.45; animation: signalBlink 1.8s ease-in-out infinite; }
.phone-signal span { margin-left: 6px; }

.control-wave {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 50%;
  animation: waveOut 2.4s ease-out infinite;
  z-index: 1;
  pointer-events: none;
}
.control-wave.delay { animation-delay: 1.2s; }

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(-2deg); }
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
}
@keyframes signalBlink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@keyframes waveOut {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(4.5); opacity: 0; }
}

.login-card {
  width: 100%;
  position: relative;
  z-index: 5;
  background: rgba(21, 28, 38, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 24px 16px 40px;
    gap: 12px;
  }
  .login-scene {
    min-height: 300px;
    height: 320px;
    order: -1;
  }
  .scene-art { width: 100%; right: 0; }
  .phone-wrap { width: 120px; left: auto; right: 18%; top: 4%; }
  .scene-caption { font-size: 0.7rem; }
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-mark .logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-dim);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand-mark h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-mark p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}
.field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.field-row .input,
.field-row select.input {
  flex: 1;
  min-width: 0;
}
.btn-add {
  flex: 0 0 auto;
  min-width: 42px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 600;
}
.input, select.input, textarea.input, input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9375rem;
  background: var(--bg-elevated);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select.input:focus {
  outline: none;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}
select.input option { background: #151c26; color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #041018;
  transition: filter .15s ease, opacity .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  filter: none;
  border-color: rgba(255, 255, 255, 0.16);
}
.btn-danger { background: var(--bad); color: #1a0505; }
.btn-warn { background: var(--warn); color: #1a1205; }
.btn-sm { padding: 6px 10px; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn-sent {
  background: rgba(52, 211, 153, 0.18) !important;
  color: var(--ok) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  cursor: default;
  opacity: 0.95;
}
.btn-sent:hover { filter: none; }
.btn.btn-offline,
.btn.btn-sm.btn-offline,
.btn.btn-offline:disabled,
.btn.btn-sm.btn-offline:disabled {
  background: #2a323c !important;
  color: #6b7280 !important;
  border: 1px solid #3a4450 !important;
  cursor: not-allowed !important;
  opacity: 1;
  filter: none !important;
  pointer-events: none;
}
.btn.btn-offline:hover,
.btn.btn-sm.btn-offline:hover {
  background: #2a323c !important;
  filter: none !important;
}
.btn-flash {
  animation: cmdFlash 1.2s ease;
}
@keyframes cmdFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.45); }
}
.cmd-confirm-q {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
}
.cmd-confirm-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: #fca5a5;
}
#cmdConfirmBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error-box {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.875rem;
}
.flash {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: var(--ok);
  font-size: 0.875rem;
}
.flash.error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

/* Layout */
.shell {
  display: grid;
  grid-template-columns: 228px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0e131a;
  border-right: 1px solid var(--line);
  padding: 22px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 22px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.sidebar .brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}
.sidebar .brand strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #f1f5f9;
}
.sidebar .brand span {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.brand-mark .logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}
.btn.danger {
  background: #ef4444;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  color: #a8b4c4;
  margin-bottom: 2px;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e8edf4;
}
.nav a.active {
  background: var(--brand-dim);
  color: #e0f2fe;
}
.nav .badge {
  min-width: 20px;
  text-align: center;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.nav a.active .badge {
  background: rgba(56, 189, 248, 0.18);
  color: var(--brand);
}

.main {
  padding: 26px 30px 48px;
  min-width: 0;
  max-width: 1280px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #f8fafc;
}
.topbar .meta {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--line);
}
.stat .label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}
.stat .value {
  margin-top: 8px;
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
}
.stat.ok .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }
.stat.brand .value { color: var(--brand); }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 18px 18px;
  margin-bottom: 14px;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-hd h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e2e8f0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.filters .field { margin: 0; min-width: 150px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 0.84375rem;
  font-weight: 500;
}
.tab:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.14); }
.tab.active {
  color: var(--brand);
  background: var(--brand-dim);
  border-color: rgba(56, 189, 248, 0.28);
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th, table.data td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
}
table.data tr:hover td { background: rgba(255, 255, 255, 0.02); }
table.data td {
  color: #d6dee8;
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.tag-online { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.tag-offline { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.tag-fault { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.tag-on { background: var(--brand-dim); color: var(--brand); }
.tag-off { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg-elevated);
}
.metric .k {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.metric .v {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}

.notice {
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.875rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

pre {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--line);
  color: #cbd5e1;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}
code {
  font-family: var(--font-mono);
  color: var(--brand);
  background: var(--brand-dim);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8125rem;
}

/* Screen */
.screen-body {
  min-height: 100vh;
  background:
    radial-gradient(800px 360px at 50% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
    #080c11;
  color: #e2e8f0;
  padding: 24px 28px 40px;
}
.screen-body a { color: var(--brand); }
.screen-body h1 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #f8fafc;
}
.screen-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.screen-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
}
.screen-card .label {
  color: var(--muted);
  font-size: 0.75rem;
}
.screen-card .value {
  margin-top: 8px;
  font-size: 1.7rem;
  font-weight: 650;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.screen-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 12px;
}
.screen-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
  min-height: 340px;
}
.screen-panel h3 {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  color: #cbd5e1;
}
.bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.chart-box {
  width: 100%;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 36px 12px !important;
}
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.72);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-card {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #151c26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 20px 22px 22px;
}
.modal-card-sm { width: min(440px, 100%); }
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-hd h3 { margin: 0; font-size: 1.05rem; }
.modal-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 20px 16px 40px; }
  .stats, .metric-grid, .screen-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .screen-layout { grid-template-columns: 1fr; }
}
