/* OPTIMIZED BUILD */
/* ═══════════════════════════════════════════════
   HELIX ARCADE — admin.css (TRINITY ROOT v16)
   Tema: Glassscape · Panel de Control
═══════════════════════════════════════════════ */

:root {
  --color-primary: #1E84C6;
  --color-primary-light: #40B8FF;
  --color-primary-dark: #155A8A;
  --color-accent: #FF6600;
  --color-bg: #07090F;
  --color-surface: #0E1422;
  --color-surface-2: #151C30;
  --color-surface-3: #1A2240;
  --color-text: #E8F0FF;
  --color-text-secondary: #8090B0;
  --color-border: #1E2840;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --helix-gradient: linear-gradient(135deg, #FF6600, #1E84C6);
  --sidebar-width: 220px;
  --font-primary: 'Orbitron', 'Share Tech Mono', monospace;
  --font-body: 'Rajdhani', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ═══ UTILITIES ═══ */
.hidden { display: none !important; }

/* ═══ BOTONES ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px;
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary { background: var(--helix-gradient); color: white; box-shadow: 0 0 16px rgba(30,132,198,0.25); }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(30,132,198,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--color-error); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface-2); color: var(--color-text); }
.btn-sm { padding: 5px 12px; font-size: 0.65rem; }
.btn-login { padding: 14px 28px; font-size: 0.8rem; letter-spacing: 0.12em; }
.btn[disabled], .btn.loading { opacity: 0.5; pointer-events: none; }

/* ═══ TOAST ═══ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 6px; font-family: var(--font-primary); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; color: white; box-shadow: 0 4px 20px rgba(0,0,0,0.5); pointer-events: auto; animation: toastIn 0.3s ease forwards; max-width: 320px; }
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-error); }
.toast.warning { background: var(--color-warning); color: #000; }
.toast.info    { background: var(--color-primary); }
.toast.hiding  { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

/* ═══ LOGIN ═══ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(30,132,198,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(255,102,0,0.08) 0%, transparent 60%),
              var(--color-bg);
  padding: 20px;
}
.login-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 40px rgba(30,132,198,0.15);
}
.admin-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.logo-glyph {
  font-size: 1.6rem;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255,102,0,0.4));
}
.logo-glyph.small { font-size: 1.1rem; }
.logo-brand {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.logo-accent { color: var(--color-accent); text-shadow: 0 0 8px rgba(255,102,0,0.5); }
.admin-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  background: rgba(255,102,0,0.15);
  border: 1px solid rgba(255,102,0,0.4);
  color: var(--color-accent);
  padding: 2px 8px;
  border-radius: 99px;
}
.login-title {
  font-family: var(--font-primary);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.login-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 32px;
}
.login-disclaimer {
  margin-top: 20px;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* ═══ PANEL LAYOUT ═══ */
#admin-panel {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--color-border);
}
.sidebar-brand {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--color-text);
}
.sidebar-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.nav-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-item.active { background: rgba(30,132,198,0.15); color: var(--color-primary-light); border-left: 2px solid var(--color-primary); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-logout {
  margin: 12px;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 8px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.1); color: var(--color-error); border-color: rgba(239,68,68,0.3); }

/* ── MAIN CONTENT ── */
.admin-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-user {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.06em;
}

/* ── SECTIONS ── */
.admin-section { padding: 24px 28px; flex: 1; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--color-primary); }
.stat-val {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 900;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ── SECTION CARD ── */
.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.section-card-title {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 16px;
}
.section-actions { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.section-search-row { margin-bottom: 16px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,40,64,0.5);
  color: var(--color-text);
  vertical-align: middle;
  font-size: 0.82rem;
}
.admin-table tr:hover td { background: rgba(30,132,198,0.04); }
.admin-table .table-loading {
  text-align: center;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 24px;
}
.table-actions { display: flex; gap: 6px; }
.tag-active { display: inline-block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 99px; }
.tag-active.yes { background: rgba(16,185,129,0.15); color: var(--color-success); border: 1px solid rgba(16,185,129,0.3); }
.tag-active.no  { background: rgba(239,68,68,0.1); color: var(--color-error); border: 1px solid rgba(239,68,68,0.2); }
.rarity-common    { color: #aaa; }
.rarity-rare      { color: #40B8FF; }
.rarity-epic      { color: #8B5CF6; }
.rarity-legendary { color: #FFD700; }

/* ── FORMS ── */
.admin-input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 9px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.admin-input:focus { outline: none; border-color: var(--color-primary); }
.admin-textarea { resize: vertical; min-height: 70px; }
select.admin-input { cursor: pointer; }
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }

/* ── ADMIN MODAL ── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.admin-modal-box {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 30px rgba(30,132,198,0.15);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.admin-modal-title {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

/* ── REPORTS ── */
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; flex-direction: column; gap: 4px; }
.bar-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--color-text-secondary); }
.bar-track { height: 8px; background: var(--color-surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--helix-gradient); border-radius: 99px; transition: width 0.8s ease; }

/* ── HELIX POWERED ── */
.helix-powered { text-align: center; padding: 12px; }
.helix-powered a { font-size: 10px; color: #999; opacity: 0.35; text-decoration: none; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; transition: opacity 0.2s; font-family: var(--font-mono); }
.helix-powered a:hover { opacity: 0.7; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar-brand, .sidebar-sub, .nav-item span:not(.nav-icon), .sidebar-logout { display: none; }
  .sidebar-header { justify-content: center; padding: 16px 8px; }
  .nav-item { justify-content: center; padding: 12px 8px; }
  .admin-section { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
}