:root {
  --bg: #0f172a;
  --panel: #0b1226;
  --card: #0f1b35;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --warn: #f59e0b;
  --error: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.15), transparent 25%),
              radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.2), transparent 30%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0; }

p { color: var(--muted); margin: 0; }

.topbar {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
}

.sub { margin-top: 6px; max-width: 760px; }

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 0 16px 16px 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: block;
  font-weight: 600;
  margin: 10px 0 6px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

input:focus { border-color: var(--accent); }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #0b1226;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover:not(:disabled) { transform: translateY(-1px); }

.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.map-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 70vh;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  background: #0b1226;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.list-row:hover { border-color: rgba(56, 189, 248, 0.5); }

.list-main { display: flex; flex-direction: column; gap: 4px; }
.device-id { font-weight: 700; }
.meta { font-size: 13px; color: var(--muted); }
.list-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 10px;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  min-width: 120px;
  text-align: center;
}

.status-online { border-color: rgba(16, 185, 129, 0.6); color: #22c55e; }
.status-loading { border-color: rgba(56, 189, 248, 0.6); color: var(--accent); }
.status-warning { border-color: rgba(245, 158, 11, 0.6); color: var(--warn); }
.status-error { border-color: rgba(248, 113, 113, 0.6); color: var(--error); }
.status-offline { border-color: rgba(100, 116, 139, 0.6); color: var(--muted); }
.status-idle { color: var(--muted); }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .map-wrap, #map { min-height: 50vh; }
}
