/* ── Desktop, Metrics & Notification ───────────────────────────── */
#desktop {
  width: 100%;
  height: calc(100vh - var(--taskbar));
  position: relative;
  background:
    radial-gradient(ellipse at 20% 50%, #0d1a0d 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, #0d0d1a 0%, transparent 60%),
    var(--bg);
}

/* ── Metrics overlay ── */
#metrics {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
}
.metric {
  background: rgba(13, 13, 15, .95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 170px;
}
.metric-label {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.metric-val {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
}
.metric-bar {
  height: 3px;
  background: var(--surface3);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.metric-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s;
}
.m-cash .metric-val   { color: var(--green); }
.m-energy .metric-val { color: var(--amber); }
.m-suspicion .metric-val { color: var(--red); }
.m-cash .metric-fill      { background: var(--green); }
.m-energy .metric-fill    { background: var(--amber); }
.m-suspicion .metric-fill { background: var(--red); }

/* Estados criticos: warning y critical visuales */
@keyframes pulse-warn {
  0%, 100% { border-color: var(--amber); }
  50% { border-color: var(--border); }
}
@keyframes pulse-critical {
  0%, 100% { border-color: var(--red); box-shadow: 0 0 12px rgba(248, 113, 113, 0.4); }
  50% { border-color: var(--red); box-shadow: 0 0 4px rgba(248, 113, 113, 0.2); }
}
.metric.warning {
  border-color: var(--amber);
  animation: pulse-warn 2s infinite;
}
.metric.critical {
  border-color: var(--red);
  animation: pulse-critical 1.2s infinite;
}
.m-cash.critical .metric-val { color: var(--red); }

/* ── Notification toast ── */
#notif {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 11px;
  z-index: 300;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  max-width: 360px;
  text-align: center;
  white-space: nowrap;
}
#notif.show   { opacity: 1; }
#notif.warn   { border-color: var(--amber); color: var(--amber); }
#notif.danger { border-color: var(--red);   color: var(--red); }
#notif.good   { border-color: var(--green); color: var(--green); }
