/* Jet Market — Dark + Cyan Electric */

:root {
  --bg: #070a0f;
  --bg-card: #0d1219;
  --bg-card-hover: #141b26;
  --bg-elevated: #111822;
  --border: #1a2332;
  --border-light: #243044;
  --text: #eef2f7;
  --text-muted: #8494a7;
  --text-dim: #5c6b7e;
  --cyan: #00e5ff;
  --cyan-dim: #00b8d4;
  --cyan-glow: rgba(0, 229, 255, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --yellow: #eab308;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(7, 10, 15, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.logo span {
  background: linear-gradient(135deg, #67e8f9, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-pill {
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--cyan);
  color: #000;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: rgba(0, 229, 255, 0.08);
}

.nav a.active {
  color: #000;
  background: var(--cyan);
  font-weight: 600;
}

/* ========== HERO ========== */
.hero {
  padding: 32px 28px 24px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  letter-spacing: 0.03em;
}

.badge.cyan {
  background: rgba(0, 229, 255, 0.18);
  color: var(--cyan);
}

.badge.live {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: center;
  min-width: 100px;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cyan);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ========== CONNECTION ========== */
.connection-status {
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 0 28px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.partial { background: var(--orange); }
.status-dot.offline { background: var(--red); }

.connection-status.online  { color: #4ade80; }
.connection-status.partial { color: #fbbf24; }
.connection-status.offline { color: #f87171; }

/* ========== MAIN ========== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

.section { margin-bottom: 36px; }

.section-h {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-h .count {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
}

.hidden { display: none !important; }

.empty-state {
  color: var(--text-muted);
  padding: 48px 20px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* ========== FILTERS ========== */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  min-width: 160px;
  transition: border-color 0.15s;
}

.filters input:focus,
.filters select:focus {
  border-color: var(--cyan);
}

/* ========== CARDS ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.15s;
  cursor: pointer;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 229, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan);
}

.card-value.up   { color: var(--green); }
.card-value.down { color: var(--red); }

.card-meta {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.tag.titular    { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.tag.reserva    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.tag.emergencia { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* ========== KPI ROW ========== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.kpi-value.cyan { color: var(--cyan); }

/* ========== TABLES ========== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

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

th {
  text-align: left;
  padding: 11px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(0, 229, 255, 0.03); }

.player-link {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.player-link:hover { color: var(--cyan); }

.variation.up   { color: var(--green); font-weight: 600; }
.variation.down { color: var(--red); font-weight: 600; }

/* ========== STATUS BADGE ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

/* ========== RUMOR CARD ========== */
.rumor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

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

.rumor-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.rumor-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.rumor-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

/* ========== PROFILE ========== */
.profile-header {
  display: flex;
  gap: 28px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.profile-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.value-panel {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 229, 255, 0.02));
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.value-panel .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.value-panel .big-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 6px;
}

.value-panel .variation-line {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 28px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
  }

  .nav { width: 100%; }

  .hero { padding: 22px 14px; }

  .hero-content { flex-direction: column; }

  .hero-stats { width: 100%; }

  main { padding: 18px 14px 40px; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .profile-header { flex-direction: column; align-items: center; text-align: center; }

  .profile-meta { justify-content: center; }
}

/* ========== AGENT PHOTO ========== */
.agent-photo {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.agent-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--cyan);
  background: var(--bg-card);
}

.card-with-photo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.card-with-photo .card-body { flex: 1; min-width: 0; }

/* ========== ADMIN PANEL ========== */
#adminPanel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
  backdrop-filter: blur(6px);
}
#adminPanel.open { display: flex; }

#adminBox {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  padding: 24px;
  margin: auto;
  box-shadow: var(--shadow);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-header h2 { font-size: 1.25rem; font-weight: 800; }
.admin-header-actions { display: flex; gap: 8px; }
.admin-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 16px; }
.admin-section-title { font-size: 1rem; font-weight: 700; margin: 8px 0 12px; }

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
}
.admin-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text); background: rgba(0,229,255,0.06); }
.admin-tab.active { color: #000; background: var(--cyan); font-weight: 600; }

.login-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.login-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.login-error { color: #f87171; font-size: 0.85rem; }

.admin-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-toolbar input, .admin-toolbar select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-form-grid .full { grid-column: 1 / -1; }
.admin-form-grid label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
}
.admin-form-grid textarea { resize: vertical; }

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th {
  text-align: left;
  padding: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  width: 110px;
}
.admin-input-sm { width: 60px; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn-primary, .btn-gray, .btn-danger, .btn-ai, .btn-sm {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 9px 16px;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-primary { background: var(--cyan); color: #000; }
.btn-primary:hover { background: var(--cyan-dim); }
.btn-gray { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-gray:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(239,68,68,0.2); color: #f87171; }
.btn-danger:hover { background: rgba(239,68,68,0.35); }
.btn-ai {
  background: linear-gradient(135deg, #00e5ff, #8b5cf6);
  color: #000;
  font-weight: 700;
}
.btn-ai:hover { opacity: 0.9; }
.btn-ai:disabled { opacity: 0.5; cursor: wait; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

#adminBtn {
  background: rgba(0,229,255,0.12);
  border: 1px solid rgba(0,229,255,0.3);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
}
#adminBtn.logged { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); color: #4ade80; }

/* ========== AI REVIEW MODAL ========== */
#aiReviewOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
#aiReviewOverlay.open { display: flex; }

#aiReviewModal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}
#aiReviewModal h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--cyan);
}
.review-field { margin-bottom: 12px; }
.review-field.full { }
.review-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.review-field input,
.review-field select,
.review-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
}
.review-batch-item h4 { font-size: 0.95rem; margin-bottom: 10px; }
.review-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ========== CHART ========== */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  position: relative;
  height: 240px;
}
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* ========== MOBILE UX ========== */
@media (max-width: 768px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  #adminBox { padding: 16px; }
  .admin-table { font-size: 0.75rem; }
  .admin-input { width: 90px; }

  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-width: 0; padding: 12px; }
  .stat-value { font-size: 1.15rem; }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 1.1rem; }

  .section[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .cards-grid { grid-template-columns: 1fr; }

  .table-wrap { font-size: 0.8rem; }
  th, td { padding: 8px 10px; }

  .profile-photo { width: 100px; height: 100px; }
  .value-panel .big-value { font-size: 1.5rem; }

  .nav a { padding: 6px 10px; font-size: 0.8rem; }

  .filters { flex-direction: column; }
  .filters input, .filters select { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.35rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
}
