:root {
  --navy: #0b1728;
  --navy-2: #111f33;
  --panel: #16283f;
  --gold: #d9a441;
  --gold-soft: #e9c887;
  --text: #e8eef6;
  --muted: #8aa0b8;
  --ok: #2ecc71;
  --warn: #e67e22;
  --danger: #e74c3c;
  --border: #223349;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--navy);
  color: var(--text);
}
.hidden { display: none !important; }

/* Login */
.login-screen {
  height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2f4d, var(--navy));
}
.login-card {
  width: 340px; background: var(--panel); border: 1px solid #22364f;
  border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.brand { font-weight: 700; letter-spacing: .18em; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.sub { color: var(--muted); margin: -6px 0 6px; font-size: 13px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  background: var(--navy-2); border: 1px solid #26384f; color: var(--text);
  padding: 10px 12px; border-radius: 8px; font-family: "IBM Plex Mono", monospace;
}
input:focus { outline: none; border-color: var(--gold); }
button {
  background: var(--gold); color: #1a1206; border: none; padding: 11px; border-radius: 8px;
  font-weight: 700; cursor: pointer; letter-spacing: .04em;
}
button:hover { background: var(--gold-soft); }
.error { color: var(--danger); font-size: 13px; min-height: 16px; margin: 0; }
.switch { color: var(--muted); font-size: 13px; text-align: center; margin: 2px 0 0; }
.switch a { color: var(--gold-soft); text-decoration: none; font-weight: 500; }
.switch a:hover { color: var(--gold); text-decoration: underline; }

/* App */
.app { display: grid; grid-template-columns: 300px 1fr; height: 100vh; }
.sidebar { background: var(--navy-2); border-right: 1px solid #1e3149; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.org { color: var(--gold-soft); font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.list-header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.badge { background: var(--panel); color: var(--text); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.device-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.device-item { background: var(--panel); border: 1px solid #23374f; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.device-item:hover { border-color: var(--gold); }
.device-item .name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.device-item .meta { color: var(--muted); font-size: 12px; font-family: "IBM Plex Mono", monospace; margin-top: 4px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.offline { background: var(--muted); }
.status-dot.stolen { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.conn { font-size: 12px; font-family: "IBM Plex Mono", monospace; color: var(--muted); }
.conn.on { color: var(--ok); }
.logout { background: transparent; color: var(--muted); border: 1px solid #2a3e57; }
.logout:hover { background: var(--panel); color: var(--text); }
.map-wrap { position: relative; }
#map { position: absolute; inset: 0; }
.leaflet-container { background: #0e1c30; }
