/* Light industrial palette tuned for Pyrovision */
:root {
  --mm-bg: #f8fafc;
  --mm-surface: #ffffff;
  --mm-border: #e2e8f0;
  --mm-muted: #64748b;
  --mm-accent: #0891b2;
  --mm-accent-strong: #0e7490;
}

html, body {
  background: var(--mm-bg);
  color: #0f172a;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.brand-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #a5f3fc;
  border-radius: 8px;
}

.text-muted-2 { color: var(--mm-muted); }

/* ── Sidebar layout ───────────────────────────────────────────────────────── */
body.has-sidebar { padding-left: 240px; }
.mm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #ffffff;
  border-right: 1px solid var(--mm-border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.mm-brand {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mm-border);
  height: 60px;
  display: flex;
  align-items: center;
}
.mm-nav {
  padding: 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mm-nav-section {
  margin: 14px 8px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mm-muted);
  font-weight: 600;
}
.mm-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.mm-nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.mm-nav-link.active {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
  font-weight: 500;
}
.mm-nav-link i { width: 16px; text-align: center; }
.mm-user {
  border-top: 1px solid var(--mm-border);
  padding: 12px 16px;
}
.mm-main {
  padding: 24px 28px;
  max-width: 1400px;
}
@media (max-width: 767.98px) {
  body.has-sidebar { padding-left: 0; }
  .mm-sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: 0 0 24px rgba(0,0,0,.1);
  }
  .mm-sidebar.open { transform: translateX(0); }
  .mm-main { padding: 16px; }
  .mm-mobile-toggle { display: inline-flex !important; }
}
.mm-mobile-toggle { display: none; }

.card { border-color: var(--mm-border); }
.card-header {
  background: white;
  border-bottom: 1px solid var(--mm-border);
  font-weight: 600;
  font-size: 0.875rem;
}

/* State pill (matches the React StatePill) */
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.state-pill .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.state-pill.lg { font-size: 0.95rem; padding: 0.35rem 1rem; }
.state-pill.sm { font-size: 0.7rem; padding: 0.15rem 0.5rem; }

/* Motor reading tile */
.reading-tile {
  background: #f8fafc;
  border: 1px solid var(--mm-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
}
.reading-tile .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mm-muted);
}
.reading-tile .val {
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.reading-tile .unit { font-size: 0.7rem; color: var(--mm-muted); margin-left: 2px; font-weight: 400; }

/* Today bar */
.today-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--mm-border);
}
.today-bar > span { display: block; height: 100%; }

/* Motor card hover */
.motor-card { transition: border-color .15s, box-shadow .15s; cursor: pointer; }
.motor-card:hover { border-color: #67e8f9; box-shadow: 0 2px 12px rgba(8, 145, 178, .08); }

/* Online/offline indicator */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.online-dot.is-online { background: #10b981; animation: pulse 2s infinite; }
.online-dot.is-offline { background: #cbd5e1; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tabular numbers everywhere they make sense */
.num { font-variant-numeric: tabular-nums; }

/* Segment timeline (Gantt-style) */
.segment-track {
  position: relative;
  height: 40px;
  background: #f1f5f9;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  overflow: hidden;
}
.segment-track > span {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.9;
  transition: opacity .15s;
}
.segment-track > span:hover { opacity: 1; }

/* Discovered devices banner */
.discovered-card {
  background: #ecfeff;
  border-color: #a5f3fc;
}

/* Form refinements */
.form-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mm-muted); font-weight: 500; }
.form-text { font-size: 0.75rem; }
