/* Bluespot fleet console
   Palette: bg #0E1116, surface #161B22, raised #1C222B, border #2A313C,
   text #E6E8EB, muted #8B93A1, active(android green) #3DDC84,
   pending(amber) #F5A623, danger #E5484D. Type: IBM Plex Sans (UI) +
   IBM Plex Mono (data). */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --raised: #1c222b;
  --border: #2a313c;
  --text: #e6e8eb;
  --muted: #8b93a1;
  --active: #3ddc84;
  --pending: #f5a623;
  --danger: #e5484d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Ambient dot-grid: a quiet nod to a rack of devices, mostly dormant. */
.dot-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #232a35 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 35%, black 0%, transparent 70%);
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

a {
  color: var(--active);
}

:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* ---- buttons & inputs ---- */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 80ms ease;
}

.btn:hover {
  border-color: #3a4453;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--active);
  border-color: var(--active);
  color: #0b3d22;
}

.btn-primary:hover {
  background: #4fe595;
  border-color: #4fe595;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  font: inherit;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
}

.field input:focus {
  border-color: var(--active);
}

/* ---- login ---- */

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 28px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.wordmark .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--active);
  box-shadow: 0 0 8px 1px rgba(61, 220, 132, 0.6);
}

.wordmark span {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.login-card h1 {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 28px;
}

.login-error {
  font-size: 13px;
  color: var(--danger);
  margin: -6px 0 16px;
}

/* ---- topbar ---- */

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

/* ---- page ---- */

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px;
}

.page-error {
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.4);
  color: #ffb4b6;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 24px;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---- fleet grid signature ---- */

.fleet-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.fleet-summary-text {
  display: flex;
  gap: 28px;
}

.stat .value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 500;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fleet-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 340px;
  justify-content: flex-end;
}

.fleet-grid .cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--raised);
  border: 1px solid var(--border);
}

.fleet-grid .cell[data-online='true'] {
  background: var(--active);
  border-color: var(--active);
  animation: pulse 2.4s ease-in-out infinite;
}

.fleet-grid .cell[data-status='PENDING'] {
  background: var(--pending);
  border-color: var(--pending);
}

.fleet-grid .cell[data-status='WIPED'] {
  background: var(--danger);
  border-color: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5);
  }
  50% {
    box-shadow: 0 0 6px 2px rgba(61, 220, 132, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleet-grid .cell[data-online='true'] {
    animation: none;
  }
}

/* ---- table ---- */

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.fleet-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}

.fleet-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.fleet-table tbody tr:hover {
  background: var(--surface);
}

.fleet-table td.serial,
.fleet-table td.checkin,
.fleet-table td.os {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--muted);
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.status-dot[data-online='true'] {
  background: var(--active);
  box-shadow: 0 0 6px 1px rgba(61, 220, 132, 0.6);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
}

.badge[data-status='ACTIVE'] {
  color: var(--active);
}

.badge[data-status='PENDING'],
.badge[data-status='ENROLLED'] {
  color: var(--pending);
}

.badge[data-status='WIPED'] {
  color: var(--danger);
}

.badge[data-status='INACTIVE'] {
  color: var(--muted);
}

@media (max-width: 640px) {
  .topbar,
  .page {
    padding: 20px;
  }

  .fleet-summary {
    flex-direction: column;
  }

  .fleet-grid {
    justify-content: flex-start;
    max-width: none;
  }

  .fleet-table-wrap {
    overflow-x: auto;
  }
}
