:root {
  --bg: #0a0a0f;
  --bg2: #13131a;
  --bg3: #1e1e2a;
  --border: #2a2a3a;
  --accent: #7c3aed;
  --accent2: #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* NAV */
nav {
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo span { font-size: 1.5rem; -webkit-text-fill-color: initial; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a, .nav-links button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  background: none;
  color: var(--text2);
  cursor: pointer;
}

.nav-links a:hover, .nav-links button:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-links .btn-nav-primary {
  background: var(--accent);
  color: white;
}

.nav-links .btn-nav-primary:hover {
  background: var(--accent2);
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, #1a0a2e 50%, var(--bg) 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent2), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text2);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 32px;
  position: relative;
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* SECTION */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* CARD */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--bg3), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body { padding: 20px; }

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-artist {
  color: var(--accent2);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.card-meta span {
  color: var(--text2);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 16px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent2); box-shadow: 0 4px 16px var(--accent-glow); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--accent);
}

.btn-outline:hover { background: var(--accent-glow); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea { resize: vertical; min-height: 100px; }

select option { background: var(--bg2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* PANELS */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* BADGE */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pendiente { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-en_revision { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-aprobada { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-rechazada { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab.active {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 4px;
}

/* TABLE */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text3);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title { font-size: 1.2rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1.4rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.modal-close:hover { background: var(--bg3); color: var(--text); }

/* UPLOAD */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-area input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-text { color: var(--text2); font-size: 0.9rem; }
.upload-hint { color: var(--text3); font-size: 0.8rem; margin-top: 4px; }
.upload-filename { color: var(--accent2); font-size: 0.85rem; margin-top: 8px; font-weight: 600; }

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 360px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text3);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; }

/* SECTOR CARD */
.sector-card {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.sector-card:hover, .sector-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--accent-glow);
}

.sector-card.agotado {
  opacity: 0.5;
  cursor: not-allowed;
}

.sector-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.sector-disponibles { color: var(--text3); font-size: 0.8rem; }
.sector-precio { font-size: 1.3rem; font-weight: 800; color: var(--accent2); margin-top: 8px; }

/* SPINNER */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ORDEN CARD */
.orden-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.orden-card:hover { border-color: var(--accent); }

.orden-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.orden-title { font-weight: 700; font-size: 1rem; }
.orden-meta { color: var(--text2); font-size: 0.85rem; margin-bottom: 12px; }

.orden-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* COMPROBANTE */
.comprobante-preview {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.comprobante-preview a { color: var(--accent2); }
.comprobante-preview a:hover { text-decoration: underline; }

/* ALERT */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }
.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* MISC */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.color-success { color: var(--success); }
.color-danger { color: var(--danger); }
.color-text2 { color: var(--text2); }
.fw-700 { font-weight: 700; }

/* PAGE */
.page-header {
  background: linear-gradient(135deg, var(--bg) 0%, #1a0a2e 100%);
  padding: 48px 24px 32px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.page-header p { color: var(--text2); }

/* ENTRADAS */
.entrada-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.entrada-codigo {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent2);
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .nav-links .hide-mobile { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 20px; }
}
