* { box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }
#app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.scroll-top-btn {
  position: fixed;
  bottom: 72px;
  right: 24px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79,70,229,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.15s;
  z-index: 30;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }
.scroll-top-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79,70,229,0.5); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Progress bar */
.progress-bar {
  background: linear-gradient(90deg, #059669, #34d399);
  transition: width 0.6s ease;
}

/* Estado row accents */
tr.esc-row  { border-left: 3px solid #10b981; }
tr.cola-row { border-left: 3px solid #f59e0b; }
tr.pend-row { border-left: 3px solid transparent; }

tbody tr { transition: background 0.1s; }


/* Genre badge */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* Estado button */
.estado-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

/* Action buttons on row */
.row-action {
  opacity: 0;
  transition: opacity 0.12s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 5px;
  border-radius: 4px;
  color: #94a3b8;
}
tr:hover .row-action { opacity: 1; }
.row-action:hover { background: #f1f5f9; color: #475569; }
.row-action.danger:hover { background: #fef2f2; color: #ef4444; }

/* Modal overlay */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px;
  max-width: 560px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.15);
  animation: slideUp 0.15s ease;
}
@keyframes slideUp {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Toast */
.toast {
  background: #1e293b;
  border-radius: 8px;
  padding: 10px 16px;
  color: #f8fafc;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
}

/* Form inputs */
.form-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 7px;
  padding: 7px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: #fff;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 4px;
}

/* Filter select */
.filter-select {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #374151;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
  font-family: inherit;
}
.filter-select:focus { border-color: #a5b4fc; }

/* Search input */
.search-input {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 7px;
  padding: 6px 12px 6px 32px;
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: border-color 0.15s, width 0.2s, box-shadow 0.15s;
  font-family: inherit;
}
.search-input:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(165,180,252,0.15);
  width: 280px;
}

/* Tab buttons */
.tab-btn {
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
  background: transparent;
  color: #94a3b8;
  margin-bottom: -1px;
}
.tab-btn:hover { color: #475569; }
.tab-btn.active { color: #4f46e5; border-bottom-color: #4f46e5; }

/* Primary button */
.btn-primary {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-primary:hover { background: #4338ca; box-shadow: 0 2px 8px rgba(79,70,229,0.3); }

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.btn-ghost:hover { background: #f8fafc; color: #334155; border-color: #cbd5e1; }

/* Prompt textarea */
.prompt-textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #1e293b;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.prompt-textarea:focus { border-color: #a5b4fc; background: #fff; }
