/* ══ TOKENS ════════════════════════════════════════════════════════════════ */
:root {
  --bg:      #08081a;
  --panel:   #0e0e24;
  --card:    #12122e;
  --card2:   #16163a;
  --border:  #1e1e4a;
  --acc:     #00d4ff;
  --acc2:    #00ff88;
  --acc3:    #7b6ff0;
  --acc4:    #ff6b6b;
  --txt:     #dde0f0;
  --sub:     #6b6b9a;
  --log-bg:  #06060f;
  --radius:  12px;
  --radius-s: 8px;
  --shadow:  0 4px 32px rgba(0,0,0,.5);
  --font:    'Inter', sans-serif;
  --mono:    'JetBrains Mono', monospace;
  --trans:   .18s ease;
}

/* ══ RESET ═════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
button { font-family: var(--font); cursor: pointer; }
input  { font-family: var(--font); }

/* ══ HEADER ════════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,26,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(255,100,100,.4));
}
.logo-title {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: .72rem;
  color: var(--sub);
  font-weight: 500;
  letter-spacing: .03em;
}
.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--acc2);
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--acc2);
  box-shadow: 0 0 8px var(--acc2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ══ MAIN ══════════════════════════════════════════════════════════════════ */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ══ CARDS ═════════════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: border-color var(--trans);
}
.card:hover { border-color: rgba(0,212,255,.2); }
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
}

/* ══ DROP ZONE ═════════════════════════════════════════════════════════════ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--acc);
  background: rgba(0,212,255,.04);
}
.drop-icon { font-size: 3rem; margin-bottom: 12px; }
.drop-text { font-size: 1.05rem; font-weight: 600; color: var(--txt); }
.drop-sub  { font-size: .85rem; color: var(--sub); margin-top: 4px; }

/* ══ FILE LIST ═════════════════════════════════════════════════════════════ */
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: .88rem;
  gap: 10px;
}
.file-item-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt);
}
.file-item-size { color: var(--sub); font-size: .8rem; white-space: nowrap; }
.file-remove {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--trans), background var(--trans);
}
.file-remove:hover { color: var(--acc4); background: rgba(255,107,107,.1); }

/* ══ ACTION BAR ════════════════════════════════════════════════════════════ */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ══ BUTTONS ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-s);
  padding: 11px 20px;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: all var(--trans);
  white-space: nowrap;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--acc2), #00cc70);
  color: #04100a;
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,255,136,.3);
}
.btn-secondary {
  background: var(--card2);
  color: var(--txt);
  border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover {
  border-color: var(--acc);
  color: var(--acc);
}
.btn-accent {
  background: linear-gradient(135deg, var(--acc), #009bb8);
  color: #021218;
}
.btn-accent:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,255,.3);
}
.btn-download {
  background: linear-gradient(135deg, var(--acc3), #5a50c8);
  color: white;
  font-size: 1rem;
  padding: 14px 28px;
  width: 100%;
  justify-content: center;
}
.btn-download:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(123,111,240,.4);
}

/* ══ PROGRESS ══════════════════════════════════════════════════════════════ */
.pbar-wrap {
  height: 10px;
  background: var(--log-bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acc2), var(--acc));
  border-radius: 999px;
  transition: width .3s ease;
  box-shadow: 0 0 12px rgba(0,255,136,.4);
}
.pbar-label {
  font-size: .82rem;
  color: var(--sub);
  margin-bottom: 12px;
}
.log-box {
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px;
  font-family: var(--mono);
  font-size: .78rem;
  color: #7fffca;
  height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.7;
}
.log-box::-webkit-scrollbar { width: 6px; }
.log-box::-webkit-scrollbar-track { background: var(--log-bg); }
.log-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.log-warn  { color: #ffcc00; }
.log-error { color: var(--acc4); }
.log-ok    { color: var(--acc2); }
.log-dim   { color: var(--sub); }

/* ══ RESULTS ═══════════════════════════════════════════════════════════════ */
.result-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
}
.prd-section {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.prd-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--acc2), var(--acc));
}
.prd-section--combinado::before { background: linear-gradient(90deg, var(--acc3), var(--acc)); }
.prd-section--otro::before { background: linear-gradient(90deg, var(--sub), var(--sub)); }

.prd-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 8px;
}
.prd-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--acc2);
}
.prd-totals {
  font-size: 0.85rem;
  color: var(--sub);
}
.prd-saca {
  margin-left: 8px;
  color: #ffcc00;
  font-weight: 600;
}

.prd-packs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.pack-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.pack-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--acc);
  line-height: 1;
  margin-bottom: 4px;
}
.pack-label {
  font-size: 0.75rem;
  color: var(--txt);
  font-weight: 600;
}
.pack-pdfs {
  font-size: 0.7rem;
  color: var(--sub);
  margin-top: 2px;
}

.combo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.combo-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}
.combo-key { color: var(--txt); }
.combo-val { font-weight: 600; color: var(--acc); }

/* ══ STATS ROW ═════════════════════════════════════════════════════════════ */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.stat-item {
  flex: 1;
  min-width: 160px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--acc);
}
.stat-unit {
  font-size: .78rem;
  color: var(--sub);
  margin-top: 2px;
}

/* ══ VALIDATIONS ═══════════════════════════════════════════════════════════ */
.val-block { display: flex; flex-direction: column; gap: 10px; }
.val-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px;
}
.val-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.val-content { flex: 1; }
.val-title { font-weight: 700; font-size: .9rem; margin-bottom: 3px; }
.val-detail { font-size: .8rem; color: var(--sub); }
.val-ok   .val-title { color: var(--acc2); }
.val-warn .val-title { color: #ffcc00; }
.val-err  .val-title { color: var(--acc4); }

/* ══ DOWNLOAD ══════════════════════════════════════════════════════════════ */
.download-wrap { text-align: center; }
.download-info { font-size: .82rem; color: var(--sub); margin-top: 10px; }

/* ══ DIVIDER ═══════════════════════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ══ MODAL ═════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
  animation: slideUp .22s ease;
}
@keyframes slideUp {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}
.modal-header {
  background: linear-gradient(135deg, #0a1830, #091524);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 24px;
  position: relative;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--acc);
}
.modal-date { font-size: .78rem; color: var(--sub); margin-top: 3px; }
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--sub);
  font-size: .9rem;
  padding: 4px 10px;
  transition: all var(--trans);
}
.modal-close:hover { color: var(--acc4); border-color: var(--acc4); }
.modal-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--card); }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Modal sections */
.msec { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; }
.msec-head {
  background: rgba(0,212,255,.06);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.msec-body { padding: 4px 0; }
.mrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(30,30,74,.5);
  font-size: .88rem;
  gap: 12px;
}
.mrow:last-child { border-bottom: none; }
.mrow-label { color: var(--sub); flex: 1; }
.mrow-value { font-weight: 700; color: var(--acc2); text-align: right; white-space: nowrap; }
.mrow-value.highlight { color: var(--acc); font-size: 1.05rem; }
.mrow.total {
  background: rgba(0,255,136,.05);
  border-top: 1px solid rgba(0,255,136,.1);
  margin-top: 2px;
}
.mrow.total .mrow-label { color: var(--txt); font-weight: 700; }

/* Verificacion */
.verif-box {
  background: rgba(0,255,136,.05);
  border: 1px solid rgba(0,255,136,.2);
  border-radius: var(--radius-s);
  padding: 14px 18px;
  font-size: .88rem;
  color: var(--acc2);
  font-weight: 600;
}

/* ══ UTILITIES ═════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.text-acc  { color: var(--acc);  }
.text-acc2 { color: var(--acc2); }
.text-sub  { color: var(--sub);  }

/* ══ RESPONSIVE ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .action-bar { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .stats-row { flex-direction: column; }
  .result-grid { grid-template-columns: 1fr; }
}
