/* admin.css – reutiliza todo el style.css del portal + overrides */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary:    #202225;
  --bg-secondary:  #2b2f33;
  --bg-card:       #2f3336;
  --bg-input:      #1a1d20;
  --text-primary:  #FFFFFF;
  --text-muted:    #9ca3af;
  --accent-gold:   #9EA3AB;
  --accent-green:  #22c55e;
  --accent-red:    #ef4444;
  --accent-blue:   #3b82f6;
  --border-color:  #3f4347;
  --shadow:        0 4px 24px rgba(0,0,0,.4);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    .2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; font-size: 15px; line-height: 1.6; }
a { color: var(--accent-gold); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: .8; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }

/* Layout */
.wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg-secondary); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transition: transform var(--transition); }
.sidebar__logo { padding: 24px 20px 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; }
.sidebar__logo-text { font-weight: 700; font-size: 14px; line-height: 1.2; }
.sidebar__logo-text span { color: var(--accent-gold); }
.sidebar__nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-muted); font-size: 14px; font-weight: 500; transition: background var(--transition), color var(--transition); cursor: pointer; border-left: 3px solid transparent; }
.nav-item:hover, .nav-item.active { background: rgba(158,163,171,.08); color: var(--text-primary); border-left-color: var(--accent-gold); }
.nav-item.active { color: var(--accent-gold); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__user { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; background: linear-gradient(135deg,var(--accent-gold),#858A92); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #202225; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-info__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info__role { font-size: 11px; color: var(--text-muted); }
.main-content { flex: 1; margin-left: 240px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar__title { font-size: 20px; font-weight: 700; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.page-content { padding: 28px 24px; flex: 1; }
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text-primary); padding: 4px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99; backdrop-filter: blur(4px); }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.card__title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title-icon { color: var(--accent-gold); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; transition: transform var(--transition), border-color var(--transition); }
.stat-card:hover { transform: translateY(-2px); border-color: var(--accent-gold); }
.stat-card__icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-card__icon--gold { background: rgba(158,163,171,.15); }
.stat-card__icon--green { background: rgba(34,197,94,.15); }
.stat-card__icon--blue { background: rgba(59,130,246,.15); }
.stat-card__icon--red { background: rgba(239,68,68,.15); }
.stat-card__value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-card__label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: opacity var(--transition), transform var(--transition); text-decoration: none; white-space: nowrap; }
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg,var(--accent-gold),#858A92); color: #202225; }
.btn--success { background: var(--accent-green); color: #fff; }
.btn--danger  { background: var(--accent-red); color: #fff; }
.btn--ghost   { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn--sm      { padding: 6px 14px; font-size: 12px; }
.btn--icon    { padding: 8px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-control { width: 100%; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); padding: 11px 14px; font-family: inherit; font-size: 14px; transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
.form-control:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(158,163,171,.15); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert--error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert--success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert--info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { border-bottom: 2px solid var(--border-color); }
thead th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border-color); transition: background var(--transition); }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody td { padding: 12px 14px; vertical-align: middle; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge--gold  { background: rgba(158,163,171,.2); color: var(--accent-gold); }
.badge--green { background: rgba(34,197,94,.15); color: #86efac; }
.badge--blue  { background: rgba(59,130,246,.15); color: #93c5fd; }
.badge--red   { background: rgba(239,68,68,.15);  color: #fca5a5; }
.badge--muted { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* Rank badges */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 12px; }
.rank-badge--1 { background: linear-gradient(135deg,#FFD700,#FFA500); color: #202225; }
.rank-badge--2 { background: linear-gradient(135deg,#C0C0C0,#A8A8A8); color: #202225; }
.rank-badge--3 { background: linear-gradient(135deg,#CD7F32,#A0522D); color: #fff; }
.rank-badge--n { background: var(--bg-input); color: var(--text-muted); }
.points-pill  { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: 12px; }
.points-exact { background: rgba(158,163,171,.2); color: var(--accent-gold); }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 14px 18px; font-size: 14px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 360px; animation: slideIn .3s ease; }
.toast--success { border-left: 4px solid var(--accent-green); }
.toast--error   { border-left: 4px solid var(--accent-red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal__content { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: slideIn .2s ease; }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal__title { font-size: 18px; font-weight: 700; }

/* Auth admin page */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg-primary); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 22px; font-weight: 800; }
.auth-logo h1 span { color: var(--accent-gold); }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* Dashboard grid responsive */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
}
