/* Protrade — Engine de Calificación de Exhibidores
   Paleta: negro / blanco / grises / azul oscuro, con verde neón como único acento. */

:root {
  --bg: #0B0F14;
  --bg-panel: #101923;
  --bg-panel-alt: #141c26;
  --bg-elevated: #16202B;
  --border: #22303B;
  --text: #FFFFFF;
  --text-muted: #8A97A3;
  --text-faint: #56636D;
  --accent: #03FF86;
  --accent-dim: rgba(3, 255, 134, 0.12);
  --accent-text: #06251A;
  --danger: #FF6B6B;
  --danger-dim: rgba(255, 107, 107, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}

/* ---------- barra superior de progreso (fina, discreta) ---------- */
#top-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 50;
  background: transparent;
}
#top-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  opacity: 0;
  transition: width 0.2s linear, opacity 0.25s ease;
}

/* ---------- header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.brand h1 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.brand p { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.status-dot.idle { background: var(--text-faint); }
.status-dot.busy { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.status-dot.error { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- layout ---------- */
main { max-width: 880px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 20px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.hidden { display: none !important; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone.drop-active { border-color: var(--accent); background: var(--accent-dim); }
.dropzone svg { color: var(--accent); margin-bottom: 12px; }
.dropzone-title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.dropzone-sub { font-size: 12px; color: var(--text-muted); margin: 0 0 14px; }
.dropzone-hint { font-size: 11px; color: var(--text-faint); margin: 14px 0 0; }

/* ---------- botones ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.05s ease;
  text-decoration: none;
  display: inline-block;
}
.btn:active { transform: scale(0.98); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { opacity: 0.88; }
.btn-accent:disabled { background: var(--bg-elevated); color: var(--text-faint); cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn-sm { padding: 7px 12px; font-size: 11px; font-weight: 600; }

/* ---------- fila de archivo seleccionado ---------- */
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.file-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-info svg { color: var(--text-muted); flex-shrink: 0; }
.file-name { font-size: 13px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }
.file-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- progreso ---------- */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-head span:first-child { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.progress-head span:last-child { font-size: 12px; color: var(--accent); font-weight: 700; }
.progress-track { width: 100%; height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.25s ease; }
.progress-detail { font-size: 11px; color: var(--text-muted); margin: 10px 0 0; }

/* ---------- panel de resultado / descarga ---------- */
.result-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.label { font-size: 11px; color: var(--text-muted); margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.value { font-size: 15px; font-weight: 700; margin: 4px 0 0; }

/* ---------- error ---------- */
.error-panel { border-color: var(--danger); background: var(--danger-dim); }
.error-panel .label { color: var(--danger); }
.error-panel p.value { color: var(--text); font-weight: 500; font-size: 13px; }

/* ---------- tabla de resultados ---------- */
.panel-table { padding: 0; overflow: hidden; }
.panel-table-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.panel-table-head p:first-child { font-size: 13px; font-weight: 700; margin: 0; }
.panel-table-head p:last-child { font-size: 11px; color: var(--text-faint); margin: 0; }

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 16px;
  background: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
tbody tr:hover { background: var(--bg-elevated); }

.status-cell { display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dot-bad { background: var(--danger); }
.dot-muted { background: var(--text-faint); }
