:root {
    --white: #ffffff;
    --bg-light: #f8fafc;
    --bg-admin: #f1f5f9;
    --orange-primary: #f97316;
    --orange-hover: #ea580c;
    --orange-soft: #fff7ed;
    --green-primary: #10b981;
    --green-soft: #ecfdf5;
    --text-dark: #334155; 
    --text-gray: #64748b;
    --border-soft: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

body { 
    background-color: var(--bg-light); 
    background-image: 
        radial-gradient(at 0% 0%, hsla(28, 100%, 74%, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(160, 100%, 74%, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(28, 100%, 74%, 0.12) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(160, 100%, 74%, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-dark); 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding-top: 120px; 
    padding-bottom: 50px; 
}

.text-center { text-align: center; } .text-right { text-align: right; }
.text-green { color: var(--green-primary); }
.text-dark { color: var(--text-dark); } .text-gray { color: var(--text-gray); }
.text-sm { font-size: 0.85rem; } .font-bold { font-weight: 700; }
.mt-5 { margin-top: 5px; } .mt-10 { margin-top: 10px; } .mt-15 { margin-top: 15px; } .mt-20 { margin-top: 20px; } .mb-15 { margin-bottom: 15px; } .mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; } .w-100 { width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.fade-in { animation: fadeIn 0.6s ease-out; }

.text-orange { 
    background: linear-gradient(135deg, #f97316, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.monitor-bar { position: fixed; top: 0; left: 0; width: 100%; padding: 10px; z-index: 1000; font-size: 0.85rem; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; background: #fef08a; color: #854d0e; transition: all 0.4s; }
.monitor-bar.online { background: var(--green-soft); color: #065f46; }
.monitor-bar.offline { background: #fee2e2; color: #991b1b; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ca8a04; }
.monitor-bar.online .dot { background: var(--green-primary); } .monitor-bar.offline .dot { background: #ef4444; }
.pulse { animation: pulseAnim 1.5s infinite; }

.top-nav { 
    position: fixed; top: 35px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 600px;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 40px; padding: 12px 20px; display: flex; justify-content: center; gap: 15px; z-index: 900; box-shadow: 0 10px 30px rgba(0,0,0,0.04); 
}
.nav-badge { padding: 8px 18px; border-radius: 30px; display: flex; gap: 8px; align-items: center; font-size: 0.9rem; }
.orange-badge { background: var(--white); border: 2px solid #fed7aa; box-shadow: 0 4px 10px rgba(249, 115, 22, 0.05); } 
.orange-badge .badge-title { color: var(--orange-hover); font-weight: 800; }
.green-badge { background: var(--white); border: 2px solid #a7f3d0; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.05); } 
.green-badge .badge-title { color: #047857; font-weight: 800; }

.main-container { width: 100%; max-width: 500px; padding: 0 20px; z-index: 10; position: relative; }
.main-title { font-size: 3.2rem; font-weight: 900; letter-spacing: -1.5px; margin-bottom: 8px; color: var(--text-dark); }
.main-subtitle { font-size: 1.1rem; color: var(--text-gray); margin-bottom: 35px; }

.interactive-card { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 28px; padding: 40px; box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.9); }

.input-wrapper { margin-bottom: 25px; text-align: left; }
.input-wrapper label { display: block; margin-bottom: 10px; font-weight: 700; color: var(--text-dark); font-size: 0.95rem; }
.input-wrapper input { width: 100%; padding: 16px 20px; border-radius: 16px; font-size: 1.05rem; border: 2px solid var(--border-soft); background: #ffffff; color: var(--text-dark); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }
.input-wrapper input:focus { outline: none; border-color: var(--orange-primary); box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15), inset 0 2px 10px rgba(0,0,0,0.02); transform: translateY(-2px); }
.input-wrapper input.valid { border-color: var(--green-primary); }
.input-wrapper input.invalid { border-color: #ef4444; background: #fff0f0; }
.input-hint { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--text-gray); }

.btn { display: inline-block; text-align: center; padding: 18px 24px; border-radius: 16px; font-size: 1.05rem; font-weight: 800; cursor: pointer; border: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-main { background: linear-gradient(135deg, var(--orange-primary), #fb923c); color: var(--white); box-shadow: 0 8px 25px rgba(249, 115, 22, 0.3); text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-main:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 30px rgba(249, 115, 22, 0.4); }
.btn-outline { background: var(--white); border: 2px solid var(--border-soft); color: var(--text-dark); box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.btn-outline:hover { background: var(--bg-light); border-color: var(--text-gray); transform: translateY(-2px); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #f87171); color: var(--white); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3); }
.btn-danger:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 30px rgba(239, 68, 68, 0.4); }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; border-radius: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; background: #cbd5e1; }

.alert-msg { margin-top: 20px; padding: 16px; border-radius: 14px; text-align: center; font-weight: 600; font-size: 0.95rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

.admin-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-gray); text-decoration: none; font-weight: 700; padding: 12px 28px; border-radius: 30px; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); border: 1px solid var(--border-soft); box-shadow: 0 5px 15px rgba(0,0,0,0.03); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.admin-link:hover { color: var(--orange-primary); border-color: #fdba74; background: var(--white); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(249, 115, 22, 0.15); }

/* --- DISEÑO ADMIN PREMIUM --- */
.admin-body { background-color: var(--bg-admin); padding: 0; display: block; background-image: none; }
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--white); border-right: 1px solid var(--border-soft); padding: 30px 20px; box-shadow: 5px 0 30px rgba(0,0,0,0.02); z-index: 10; }
.sidebar-brand h2 { font-size: 2rem; font-weight: 900; }
.menu-link { display: block; padding: 14px 18px; border-radius: 14px; color: var(--text-gray); text-decoration: none; font-weight: 700; transition: all 0.3s; background: var(--bg-light); border: 1px solid transparent; }
.menu-link:hover { color: var(--orange-primary); background: var(--orange-soft); border-color: #fdba74; transform: translateX(5px); }

.admin-main { padding: 40px; max-width: 1200px; margin: 0 auto; width: 100%; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; }
.stat-badge { background: var(--white); border: 1px solid var(--border-soft); padding: 20px 40px; border-radius: 20px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.03); }
.stat-value { display: block; font-size: 3rem; font-weight: 900; line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--text-gray); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 5px; display: block; }

.search-input { padding: 14px 24px; border-radius: 30px; border: 2px solid var(--border-soft); background: var(--bg-admin); width: 350px; font-size: 1rem; transition: all 0.3s; }
.search-input:focus { outline: none; border-color: var(--orange-primary); background: var(--white); box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1); }

.table-responsive { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border-soft); }
.data-table { width: 100%; border-collapse: collapse; background: var(--white); }
.data-table th { background: var(--bg-light); color: var(--text-gray); font-weight: 700; padding: 18px; text-align: left; text-transform: uppercase; font-size: 0.85rem; border-bottom: 2px solid var(--border-soft); letter-spacing: 0.5px; }
.data-table td { padding: 18px; border-bottom: 1px solid var(--border-soft); color: var(--text-dark); vertical-align: middle; font-size: 0.95rem; }
.data-table tr:hover { background: var(--orange-soft); }
.login-card { max-width: 450px; margin: 80px auto; }

/* NUEVOS BOTONES DE ACCIÓN (TACHITO) */
.action-buttons { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.btn-icon-danger { background: transparent; border: 1px solid #fca5a5; color: #ef4444; padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: all 0.3s; font-size: 1.1rem; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.btn-icon-danger:hover { background: #fef2f2; border-color: #ef4444; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: var(--white); padding: 45px; border-radius: 28px; max-width: 500px; width: 90%; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3); animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-icon { font-size: 4.5rem; line-height: 1; margin-bottom: 15px; }
.highlight-text { font-size: 1.3rem; background: var(--orange-soft); padding: 4px 12px; border-radius: 8px; border: 1px solid #fdba74; }
.info-box { background: var(--bg-admin); border: 2px dashed var(--border-soft); padding: 18px; border-radius: 16px; display: flex; gap: 15px; align-items: flex-start; text-align: left; }
.info-icon { font-size: 1.8rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 15px; }

.chart-container { display: flex; gap: 15px; height: 200px; align-items: flex-end; padding-bottom: 30px; border-bottom: 2px dashed var(--border-soft); overflow-x: auto; }
.chart-bar { background: linear-gradient(to top, var(--orange-primary), #fb923c); width: 50px; border-radius: 10px 10px 0 0; position: relative; transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3); }
.chart-label { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); font-size: 0.85rem; font-weight: 700; color: var(--text-gray); }
.chart-value { position: absolute; top: -30px; width: 100%; text-align: center; font-size: 1rem; font-weight: 900; color: var(--orange-primary); }

.premium-border { border: 3px solid var(--orange-primary); box-shadow: 0 20px 40px rgba(249, 115, 22, 0.15); }
.winner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.winner-box { padding: 35px; border-radius: 24px; text-align: center; border: 3px solid transparent; background: var(--white); }
.gold-box { border-color: #fdba74; box-shadow: 0 15px 30px rgba(249, 115, 22, 0.1); }
.silver-box { border-color: #a7f3d0; box-shadow: 0 15px 30px rgba(16, 185, 129, 0.1); }
.box-label { font-size: 1.1rem; font-weight: 800; color: var(--text-gray); text-transform: uppercase; letter-spacing: 1px; }
.win-name { font-size: 2.5rem; font-weight: 900; margin-top: 15px; color: var(--text-dark); }
.gold-box .win-name { background: linear-gradient(135deg, #f97316, #ea580c); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } 
.silver-box .win-name { background: linear-gradient(135deg, #10b981, #059669); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

@keyframes pulseAnim { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(202, 138, 4, 0.7); } 50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(202, 138, 4, 0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

#confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }
.confetti { position: absolute; width: 12px; height: 12px; animation: fall linear forwards; border-radius: 2px; }
@keyframes fall { to { transform: translateY(100vh) rotate(1080deg); } }

@media (max-width: 900px) {
    body { padding-top: 140px; }
    .top-nav { flex-direction: column; width: 95%; padding: 10px; gap: 8px; border-radius: 20px; }
    .main-title { font-size: 2.5rem; }
    .interactive-card { padding: 25px; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { padding: 20px; text-align: center; }
    .sidebar-menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-top: 15px; }
    .sidebar-menu .btn { margin-top: 0; width: auto; flex: 1; }
    .admin-main { padding: 15px; }
    .dashboard-header { flex-direction: column; gap: 20px; text-align: center; }
    .search-input { width: 100%; }
    .winner-grid { grid-template-columns: 1fr; }
    .modal-actions { grid-template-columns: 1fr; }
    .action-buttons { flex-direction: column; }
}