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

body {
  background: #0d0d0d;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

header {
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #111;
  height: 45px;
}
header h1 { font-size: 1rem; font-weight: 600; color: #fff; }
header .spacer { flex: 1; }
header span { font-size: 0.78rem; color: #666; white-space: nowrap; }
header .play-btn {
  background: #1a2d44;
  border: 1px solid #3a6ea8;
  color: #7bb8f0;
  border-radius: 5px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s;
}
header .play-btn:hover { background: #1c3e54; }
header .speed-select {
  background: #161616;
  border: 1px solid #2a2a2a;
  color: #aaa;
  border-radius: 5px;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.main {
  display: flex;
  height: calc(100vh - 45px);
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e1e;
  background: #111;
  overflow: hidden;
}

.card {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.card h3 {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  margin-bottom: 0.55rem;
}

/* Selector de producto */
.mode-btns { display: flex; flex-direction: column; gap: 0.3rem; }
.mode-btns button {
  background: #161616;
  border: 1px solid #2a2a2a;
  color: #aaa;
  border-radius: 5px;
  padding: 0.38rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.mode-btns button:disabled   { opacity: 0.3; cursor: not-allowed; }
.mode-btns button.active     { background: #1c2e44; border-color: #3a6ea8; color: #7bb8f0; }
.mode-btns button:not(:disabled):not(.active):hover {
  background: #1e1e1e; border-color: #444; color: #ddd;
}

/* Timeline */
.timeline-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.8rem 1rem 0.5rem;
}
.timeline-wrap h3 {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.timeline {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timeline::-webkit-scrollbar { width: 4px; }
.timeline::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }

.tl-item {
  background: #161616;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  transition: background 0.1s;
}
.tl-item:hover  { background: #1c1c1c; border-color: #2a2a2a; }
.tl-item.active { background: #1a2d44; border-color: #3a6ea8; color: #7bb8f0; }

.tl-badge {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.badge-day   { background: #1e2e10; color: #7ab648; }
.badge-night { background: #12203a; color: #4d8fcf; }

.no-data-tl {
  font-size: 0.78rem;
  color: #3a3a3a;
  text-align: center;
  padding: 2rem 0;
}

/* ── Visor ────────────────────────────────────────────────── */
.viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d0d0d;
}

.viewer-bar {
  padding: 0.55rem 1.2rem;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: #666;
  background: #111;
  flex-shrink: 0;
  min-height: 38px;
}
.viewer-bar strong { color: #bbb; }
.viewer-bar .spacer { flex: 1; }
.viewer-bar .sep { color: #2a2a2a; }

.availability { display: flex; gap: 0.5rem; }
.avail-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  opacity: 0.3;
  transition: opacity 0.15s;
}
.avail-pill.ok { opacity: 1; }
.avail-pill.day-p   { background: #1a2a0e; border-color: #3a5a1a; color: #8bc34a; }
.avail-pill.night-p { background: #0e1a2a; border-color: #1a3a5a; color: #5b9bd5; }

.img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
}
.img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.no-data-viewer {
  color: #2e2e2e;
  font-size: 0.9rem;
  text-align: center;
}
.no-data-viewer p {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #252525;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4caf50;
  margin-right: 4px;
  flex-shrink: 0;
}
.status-dot.stale   { background: #ff9800; }
.status-dot.offline { background: #f44336; }
.status-dot.connecting { background: #607d8b; }
