:root {
  --bg: #08111f;
  --panel: rgba(15, 25, 42, 0.72);
  --panel-strong: rgba(17, 24, 39, 0.92);
  --line: rgba(255,255,255,0.09);
  --text: #eef4ff;
  --muted: #8ea3c2;
  --accent: #7dd3fc;
  --accent-2: #60a5fa;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(125,211,252,.12), transparent 28%),
    linear-gradient(180deg, #06101c, #0a1221 50%, #08111f);
  color: var(--text);
}
.app-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.glow { position: absolute; filter: blur(80px); border-radius: 999px; pointer-events: none; }
.glow-a { width: 240px; height: 240px; top: -40px; right: 8%; background: rgba(96,165,250,.18); }
.glow-b { width: 300px; height: 300px; bottom: -120px; left: -40px; background: rgba(34,197,94,.10); }
.topbar {
  max-width: 1280px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: space-between;
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-dot { width: 14px; height: 14px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 24px rgba(125,211,252,.65); }
.brand-copy .tiny { font-size: 11px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.brand-title { font-weight: 700; }
.icon-btn, .action-btn, .device-card, select, input {
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text);
}
.icon-btn { width: 46px; height: 46px; border-radius: 16px; cursor: pointer; backdrop-filter: blur(18px); }
.main-grid {
  max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.35fr .95fr; gap: 22px;
}
.hero-card, .glass-card {
  position: relative; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); border-radius: 28px; box-shadow: var(--shadow);
}
.hero-card { padding: 24px; min-height: 520px; }
.side-panel { display: grid; gap: 22px; }
.glass-card { padding: 24px; }
.logs-card { max-width: 1280px; margin: 22px auto 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-head.compact { margin-bottom: 14px; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 10px; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: .96; }
.pill { min-width: 54px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-weight: 700; }
.pill.muted { color: var(--muted); }
.devices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.device-card {
  width: 100%; text-align: left; padding: 18px; border-radius: 22px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
}
.device-card:hover { transform: translateY(-2px); border-color: rgba(125,211,252,.38); }
.device-card.selected { border-color: rgba(125,211,252,.52); box-shadow: inset 0 0 0 1px rgba(125,211,252,.18), 0 12px 30px rgba(96,165,250,.12); }
.device-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.status-dot { width: 11px; height: 11px; border-radius: 999px; background: #64748b; }
.status-dot.online { background: var(--ok); box-shadow: 0 0 14px rgba(34,197,94,.6); }
.status-dot.offline { background: #f59e0b; }
.transport-pill { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.device-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.device-serial, .device-stats, .selected-meta, .mini-cell span { color: var(--muted); font-size: 13px; line-height: 1.5; word-break: break-word; }
.selected-name { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.form-grid, .action-stack, .mini-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 8px; }
.field span { font-size: 13px; color: var(--muted); }
input, select { min-height: 52px; border-radius: 18px; padding: 0 16px; outline: none; font: inherit; }
.action-btn { min-height: 52px; border-radius: 18px; cursor: pointer; font-size: 15px; font-weight: 700; }
.action-btn.primary { background: linear-gradient(135deg, rgba(125,211,252,.18), rgba(96,165,250,.16)); border-color: rgba(125,211,252,.35); }
.action-btn.danger { color: #fecaca; border-color: rgba(239,68,68,.28); }
.action-stack.mini { grid-template-columns: repeat(2, 1fr); }
.action-stack.mini .danger { grid-column: span 2; }
.message { margin-top: 14px; min-height: 44px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.03); font-size: 13px; }
.message.muted { color: var(--muted); }
.message.info { color: #dbeafe; border-color: rgba(96,165,250,.22); }
.message.error { color: #fecaca; border-color: rgba(239,68,68,.22); }
.message.success { color: #bbf7d0; border-color: rgba(34,197,94,.22); }
.mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-cell { padding: 14px; border: 1px solid rgba(255,255,255,.06); border-radius: 18px; background: rgba(255,255,255,.03); display: grid; gap: 8px; }
.mini-cell strong { font-size: 16px; }
.mini-cell.wide { grid-column: span 2; }
.logs { display: grid; gap: 10px; max-height: 360px; overflow: auto; }
.log-line { padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,.04); color: var(--text); font-size: 12px; border: 1px solid rgba(255,255,255,.05); display: grid; grid-template-columns: 70px 1fr; gap: 12px; }
.log-line .time { color: var(--muted); }
.empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); border-radius: 22px; border: 1px dashed rgba(255,255,255,.09); }
@media (max-width: 980px) {
  .main-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: auto; }
  .action-stack.mini { grid-template-columns: 1fr; }
  .action-stack.mini .danger { grid-column: span 1; }
}
