/* ============================================================
   Axolotech Dashboard — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f0e;
  --surface:   #141614;
  --surface2:  #1c1f1c;
  --border:    #2a2e2a;
  --border2:   #3a3f3a;
  --text:      #d6dbd6;
  --text-muted:#6b7068;
  --text-dim:  #3f433f;

  --teal:      #FF63A1;
  --teal-dim:  #7D2F4E;
  --amber:     #C94BEB;
  --amber-dim: #9C8746;
  --red:       #F5C738;
  --red-dim:   #5c1f16;
  --green:     #FF63A1;
  --green-dim: #9E5572;

  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius:    6px;
  --radius-lg: 10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: baseline; gap: 10px; }

.logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.04em;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.4s;
}
.status-dot.connected    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.disconnected { background: var(--red); }
.status-dot.connecting   { background: var(--amber); }

.status-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.last-seen {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Page body ────────────────────────────────────────────── */
.page-body {
  display: flex;
  height: calc(100vh - 52px);
}

/* ── Side banner ──────────────────────────────────────────── */
.side-banner {
  width: 180px;
  min-width: 180px;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.side-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (max-width: 700px) {
  .side-banner { display: none; }
}

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Metric cards ─────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: border-color 0.3s;
}

.card.alert { border-color: var(--red); }
.card.ok    { border-color: var(--border); }

.card-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-value {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  transition: color 0.3s;
}

.card-value.ok    { color: var(--teal); }
.card-value.alert { color: var(--red); }

.card-unit {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-range {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 3px;
}
.card-badge.ok    { background: var(--green-dim); color: var(--green); }
.card-badge.alert { background: var(--red-dim);   color: var(--red); }

.card-presence {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  margin: 8px 0 4px;
  transition: color 0.3s;
}
.card-presence.detected     { color: var(--green); }
.card-presence.not-detected { color: var(--text-muted); }

.card-confidence {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.card--stats { display: flex; flex-direction: column; gap: 10px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stat-name { font-size: 12px; color: var(--text-muted); }

.stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text);
}

/* ── Charts ───────────────────────────────────────────────── */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .charts { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.chart-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.chart-wrap { position: relative; height: 180px; }

/* ── Log ──────────────────────────────────────────────────── */
.log-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.log {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 12px 20px;
  max-height: 200px;
  overflow-y: auto;
}

.log-entry { padding: 1px 0; }
.log-entry .ts          { color: var(--text-dim); margin-right: 10px; }
.log-entry .msg         { color: var(--text-muted); }
.log-entry.error .msg   { color: var(--red); }
.log-entry.info  .msg   { color: var(--teal); }

.btn-clear {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-clear:hover { color: var(--text); border-color: var(--border2); }

/* ── Axolotl icon ─────────────────────────────────────────── */
.axolotl-icon {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 12px auto 0;
   blend-mode: normal;
}
.axolotl-icon.hidden { display: none; }
