/* ── Spy Console — FastMoss Nova Ecom ── */
:root {
  --bg: #08090c;
  --bg-panel: #0a0c10;
  --bg-row: #0a0e12;
  --line: #16202a;
  --accent: #00e5ff;
  --accent-dim: #0c4a57;
  --text: #e6f1f5;
  --text-muted: #9fb2bd;
  --text-faint: #5b6b76;
  --ok: #1bd96a;
  --danger: #e24b4a;
  --font-display: 'Space Grotesk', 'Bricolage Grotesque', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #f0f4f6;
  --bg-panel: #ffffff;
  --bg-row: #e8eef2;
  --line: #cdd6dc;
  --accent: #0097a7;
  --accent-dim: #b2ebf2;
  --text: #0e1a20;
  --text-muted: #4a5c66;
  --text-faint: #8a9aa4;
  --ok: #15a352;
  --danger: #c62828;
}

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

body {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ── */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
}

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

.topbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.topbar-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 2px;
}

.topbar-badge {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 8px;
  border-radius: 3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-faint);
}

/* ── Sidebar ── */
#sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-top: 40px;
}

.sidebar-header {
  display: none;
}

.sidebar-section-title {
  padding: 14px 14px 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-faint);
}

#lista-productos {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

#lista-productos li {
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border-left: 2px solid transparent;
}

#lista-productos li:hover {
  background: var(--bg-row);
}

#lista-productos li.active {
  background: #0d1419;
  border-left-color: var(--accent);
}

#lista-productos li.active .producto-label {
  color: var(--text);
}

#lista-productos li.active .badge {
  background: var(--accent);
  color: #04222a;
}

.producto-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-muted);
}

.producto-meta {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  display: flex;
  gap: 5px;
  align-items: center;
}

/* ── Main ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 40px;
}

/* ── Empty state ── */
#empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
}

#empty-state .empty-icon { font-size: 40px; opacity: 0.4; }
#empty-state h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
}
#empty-state p { font-size: 11px; }

/* ── Producto header ── */
#producto-header {
  padding: 12px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.producto-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.producto-info h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.controles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Badges ── */
.badge {
  background: var(--line);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.badge.secondary {
  background: transparent;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Controles ── */
select, input[type="text"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
}

.btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  color: #04222a;
  border-color: var(--accent);
  font-weight: 500;
}

.btn.primary:hover {
  background: #00cce6;
}

/* ── Tabla ── */
#tabla-container {
  flex: 1;
  overflow: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  background: var(--bg-panel);
  text-align: left;
  padding: 8px 12px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.4;
}

tr:nth-child(even) td { background: var(--bg-row); }
tr:hover td { background: #0f1920; }

.col-check { width: 32px; text-align: center; }
.col-check input { cursor: pointer; accent-color: var(--accent); }

td a {
  color: var(--accent);
  text-decoration: none;
  max-width: 260px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

td a:hover { text-decoration: underline; }

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.descargado-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.12s;
}

.descargado-btn:hover {
  border-color: var(--text-faint);
}

.descargado-btn.checked {
  border-color: var(--ok);
  color: var(--ok);
  background: transparent;
}

/* ── Footer de tabla ── */
#tabla-footer {
  padding: 6px 20px;
  font-size: 10px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

/* ── Sección manual ── */
#seccion-manual {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}

#seccion-manual h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.hint {
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

textarea {
  width: 100%;
  background: #050505;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  resize: vertical;
  margin-bottom: 6px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
}

#manual-resultado {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11px;
}

#manual-resultado.ok { background: #1bd96a12; color: var(--ok); border: 1px solid #1bd96a30; }
#manual-resultado.err { background: #e24b4a12; color: var(--danger); border: 1px solid #e24b4a30; }

/* ── Theme toggle ── */
#theme-toggle {
  position: fixed;
  top: 7px;
  right: 120px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  width: 28px;
  height: 26px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  color: var(--text-faint);
}

#theme-toggle:hover {
  border-color: var(--accent-dim);
}

/* ── Utilidades ── */
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Selection ── */
::selection { background: var(--accent-dim); color: var(--text); }
