/* =========================================
   1. VARIABLES Y REINICIO GLOBAL
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { max-width: 100vw; overflow-x: hidden; width: 100%; }

:root {
    --primary-neon: #00ff88;
    --accent-red: #ff4655;
    --dark-bg: #0d1117;
    --text-gray: #8b949e;
    --gold: #ffb800;
    --history-blue: #3b82f6;
    --audit-purple: #a855f7;
    --cyan: #06b6d4;
    --developer-blue: #00a8ff;
}

body { 
    font-family: 'Roboto', sans-serif; 
    background-color: var(--dark-bg); 
    background-size: cover; background-position: center; background-attachment: fixed;
    color: white; 
    transition: background-image 0.5s ease-in-out;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; transition: 0.3s; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-up { animation: fadeUp 0.6s ease-out forwards; }

#notification { position: fixed; top: 20px; right: 20px; padding: 15px 25px; border-radius: 8px; background: #161b22; border-left: 5px solid var(--primary-neon); box-shadow: 0 5px 15px rgba(0,0,0,0.5); display: none; z-index: 9999; }

/* =========================================
   2. VISTA PÚBLICA (LOGIN Y TABLA)
   ========================================= */
.cosmic-gamer-theme { position: relative; min-height: 100vh; width: 100%; background-color: #030508; color: #f8f8f2; font-family: 'Inter', sans-serif; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; }
.space-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
.complex-color { filter: blur(60px); animation: floatNebula 20s infinite alternate ease-in-out; }
.nebula-cloud-1 { position: absolute; top: -20%; left: -10%; width: 60vw; height: 60vh; background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(6, 182, 212, 0.05) 40%, transparent 70%); }
.nebula-cloud-2 { position: absolute; bottom: -10%; right: -10%; width: 50vw; height: 50vh; background: radial-gradient(circle, rgba(0, 255, 136, 0.08) 0%, rgba(168, 85, 247, 0.05) 40%, transparent 70%); animation-duration: 25s; animation-delay: -5s; }
.star-field { position: absolute; width: 100%; height: 100%; opacity: 0.4; background-image: radial-gradient(white 1px, transparent 0), radial-gradient(rgba(255,255,255,0.5) 1px, transparent 0); background-size: 80px 80px, 140px 140px; background-position: 0 0, 40px 40px; }
@keyframes floatNebula { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(40px, 30px) scale(1.1); } }
.cosmic-viewport { position: relative; z-index: 10; width: 100%; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.cosmic-header { text-align: center; width: 100%; }
.cosmic-title { font-family: 'Orbitron', sans-serif; font-size: 2.2rem; font-weight: 900; color: #fff; margin: 0 0 5px 0; letter-spacing: 2px;}
.cosmic-title span { color: var(--cyan); text-shadow: 0 0 15px rgba(6, 182, 212, 0.4); }
.deep-breath { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: #f8f8f2; margin: 0 0 15px 0; letter-spacing: 1px; }
.breathing-description { color: #8a9fc4; font-size: 0.95rem; max-width: 600px; margin: 0 auto 20px auto; line-height: 1.5; }
.cosmic-status-panel { display: flex; justify-content: center; gap: 20px; }
.status-indicator { font-family: monospace; font-size: 0.75rem; color: #6272a4; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.02); padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; }
.pulse-dot.green { background: var(--primary-neon); box-shadow: 0 0 8px var(--primary-neon); }
.pulse-dot.blue { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* Formulario Login */
.cosmic-login-card { position: relative; width: 100%; max-width: 440px; background: rgba(11, 15, 23, 0.85); border: 1px solid rgba(6, 182, 212, 0.25); border-radius: 16px; padding: 40px 35px 30px 35px; box-shadow: 0 20px 50px rgba(0,0,0,0.7); box-sizing: border-box; margin: 0 auto; }
.cosmic-emblem-wrapper { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 60px; height: 60px; background: #0c1017; border: 2px solid var(--cyan); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(6, 182, 212, 0.4); }
.cosmic-emblem { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.6rem; color: #fff; text-shadow: 0 0 8px var(--cyan); transform: translateY(-1px); }
.cosmic-card-header { text-align: center; margin-bottom: 25px; margin-top: 5px; }
.cosmic-card-header h3 { font-family: monospace; color: var(--cyan); font-size: 0.95rem; margin: 0 0 4px 0; }
.cosmic-card-header p { font-family: 'Orbitron', sans-serif; color: #fff; font-size: 1.1rem; margin: 0; font-weight: bold; }
.cosmic-form { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.cosmic-input-wrapper { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.cosmic-input-wrapper label { font-family: monospace; font-size: 0.75rem; color: #6272a4; }
.cosmic-input-wrapper input[type="text"], .cosmic-pw-container input[type="password"] { width: 100%; padding: 14px 16px; background: #05070a; border: 1px solid #212936; border-radius: 8px; color: #fff; font-size: 0.95rem; outline: none; transition: 0.3s; }
.cosmic-input-wrapper input:focus, .cosmic-pw-container input:focus { border-color: var(--cyan); box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.1); }
.cosmic-pw-container { position: relative; width: 100%; }
.cosmic-pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #6272a4; cursor: pointer; font-size: 1.1rem; }
.btn-liquid-launch { width: 100%; padding: 16px; border: none; border-radius: 8px; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1rem; color: #000; cursor: pointer; background: linear-gradient(90deg, #00d2ff, #3a7bd5); transition: 0.5s; }
.btn-liquid-launch:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 210, 255, 0.5); }
.cosmic-card-footer { text-align: center; margin-top: 20px; }
.cosmic-card-footer a { font-family: monospace; color: #6272a4; font-size: 0.75rem; cursor: pointer; }

/* REPARACIÓN: Tabla Pública Descomprimida */
.cosmic-table-section { width: 100%; max-width: 1000px; margin: 0 auto; }
.cosmic-table-card { background: rgba(11, 15, 23, 0.85); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 25px; backdrop-filter: blur(15px); box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.cosmic-table-header h3 { margin: 0 0 20px 0; font-family: 'Orbitron', sans-serif; font-size: 1.1rem; color: var(--cyan); }
.gamer-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; text-align: left; }
.gamer-table th { padding: 12px 15px; color: var(--text-gray); font-family: 'Orbitron', sans-serif; font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid var(--cyan); }
.gamer-table td { padding: 15px; font-size: 0.85rem; background: rgba(0,0,0,0.4); border-top: 1px solid rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.02); }
.gamer-table tr td:first-child { border-left: 1px solid rgba(255,255,255,0.02); border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.gamer-table tr td:last-child { border-right: 1px solid rgba(255,255,255,0.02); border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.loader { border: 4px solid rgba(255, 255, 255, 0.1); border-top: 4px solid var(--primary-neon); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   3. VISTA PRIVADA (DASHBOARD TÁCTICO)
   ========================================= */
.dashboard-root { display: flex; width: 100vw; height: 100vh; overflow: hidden; background: transparent; position: relative; z-index: 5; }

/* -- SIDEBAR -- */
.side-nav { width: 260px; height: 100vh; display: flex; flex-direction: column; background: rgba(13, 18, 25, 0.85); backdrop-filter: blur(20px); border-right: 1px solid rgba(255, 255, 255, 0.05); z-index: 20; }
.side-logo { display: flex; align-items: center; gap: 15px; padding: 25px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.v-emblem-small { width: 40px; height: 40px; background: #0c1017; border: 2px solid var(--primary-neon); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Orbitron'; font-weight: 900; font-size: 1.2rem; color: #fff; text-shadow: 0 0 8px var(--primary-neon); flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; overflow: hidden; }
.logo-text h1 { margin: 0; font-family: 'Orbitron'; font-size: 0.95rem; color: #fff; line-height: 1.3; display: flex; flex-wrap: wrap; gap: 4px; }
.logo-text h1 span { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.logo-text > span { font-size: 0.65rem; color: var(--text-gray); letter-spacing: 1px; margin-top: 2px; }

.side-menu { flex-grow: 1; padding: 20px 0; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.side-link { background: transparent; border: none; color: #8b949e; text-align: left; padding: 15px 25px; font-family: 'Orbitron', sans-serif; font-size: 0.85rem; text-transform: uppercase; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 15px; border-left: 3px solid transparent; width: 100%; }
.side-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.side-link:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.side-link.active { color: #fff; background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), transparent); border-left-color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.side-link.active i { color: var(--cyan); }

/* -- MENÚ DE PERFIL FLOTANTE PERFECTO -- */
.side-footer { position: relative; padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.user-badge-container { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); padding: 10px; border-radius: 8px; cursor: pointer; transition: 0.3s; width: 100%; box-sizing: border-box; }
.user-badge-container:hover { border-color: var(--cyan); box-shadow: 0 0 10px rgba(6,182,212,0.2); }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--cyan); object-fit: cover; flex-shrink: 0; }
.user-info-text { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.user-info-text .name { font-size: 0.85rem; font-weight: bold; color: #fff; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-info-text .role { font-size: 0.65rem; color: var(--gold); font-family: 'Orbitron', sans-serif; }
.dropdown-arrow { font-size: 0.7rem; color: var(--text-gray); }

.profile-menu-content { position: absolute; bottom: calc(100% + 5px); left: 20px; right: 20px; background: #090c10; border: 1px solid var(--cyan); border-radius: 8px; padding: 5px; display: none; flex-direction: column; gap: 5px; box-shadow: 0 -5px 20px rgba(0,0,0,0.8); z-index: 1000; box-sizing: border-box; }
.profile-menu-content.show { display: flex !important; }
.profile-menu-content button { width: 100%; text-align: left; padding: 12px 15px; background: transparent; border: none; color: #fff; font-size: 0.85rem; border-radius: 4px; cursor: pointer; transition: 0.2s; display: flex; gap: 10px; align-items: center; }
.profile-menu-content button:hover { background: rgba(6,182,212,0.2); color: var(--cyan); }

/* -- ÁREA PRINCIPAL -- */
.dashboard-main { flex-grow: 1; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: rgba(13, 18, 25, 0.75); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(255, 255, 255, 0.05); position: sticky; top: 0; z-index: 15; margin-bottom: 25px; }
.top-title { margin: 0; font-family: 'Orbitron'; font-size: 1.2rem; color: #fff; letter-spacing: 1px; }
.top-title span { color: #8b949e; font-weight: normal; }

/* Buscador Top */
.cosmic-search-wrapper { position: relative; width: 100%; min-width: 250px; }
.cosmic-search-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--cyan); }
.cosmic-search-wrapper input { width: 100%; padding: 10px 15px 10px 40px; background: rgba(0,0,0,0.5); border: 1px solid rgba(6, 182, 212, 0.3); border-radius: 20px; color: #fff; font-size: 0.85rem; outline: none; transition: 0.3s; }
.cosmic-search-wrapper input:focus { border-color: var(--cyan); background: rgba(0,0,0,0.8); box-shadow: 0 0 15px rgba(6,182,212,0.2); }
.cosmic-search-results { position: absolute; top: calc(100% + 10px); left: 0; width: 100%; max-height: 300px; overflow-y: auto; background: #090c10; border: 1px solid var(--cyan); border-radius: 8px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,0.8); }

/* -- GRID DE PANELES -- */
.content-grid { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 25px; padding: 0 30px 30px 30px; max-width: 1800px; width: 100%; align-items: start; }
.tables-col { display: flex; flex-direction: column; gap: 25px; min-width: 0; }

.glass-panel { background: rgba(13, 18, 25, 0.85); backdrop-filter: blur(20px); border-radius: 12px; padding: 25px; box-shadow: 0 15px 35px rgba(0,0,0,0.6); }
.red-glow-border { border: 1px solid rgba(255, 70, 85, 0.3); }
.cyan-glow-border { border: 1px solid rgba(6, 182, 212, 0.3); padding: 20px; }
.green-glow-border { border: 1px solid rgba(0, 255, 136, 0.3); padding: 20px; }
.card-header-gamer { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px; }
.card-header-gamer h3 { font-family: 'Orbitron', sans-serif; font-size: 1rem; color: #fff; margin: 0; text-transform: uppercase; letter-spacing: 1px; }

/* REPARACIÓN: Formulario Descomprimido (1 sola columna) */
.form-internal-grid { display: flex; flex-direction: column; gap: 0; } /* <- Aquí la magia para desaplastar */
.form-group { display: flex; flex-direction: column; margin-bottom: 15px; width: 100%; }
.form-group label { font-size: 0.75rem; color: var(--text-gray); text-transform: uppercase; margin-bottom: 6px; font-family: monospace; }
.input-group-flex { display: flex; gap: 10px; align-items: center; width: 100%; }

/* Fix de Calendario/Reloj oscuro */
.neon-input-cyan { background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(6, 182, 212, 0.3); border-radius: 6px; color: #fff; padding: 12px 15px; font-family: 'Inter', sans-serif; font-size: 0.85rem; width: 100%; transition: 0.3s; outline: none; box-sizing: border-box; color-scheme: dark; }
.neon-input-cyan:focus { border-color: var(--cyan); box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.1), 0 0 15px rgba(6, 182, 212, 0.3); background: rgba(0, 0, 0, 0.8); }
.neon-input-cyan option { background-color: #0d1117; color: #fff; }

/* Tablas Modernas */
.table-wrapper-internal { width: 100%; overflow-x: auto; overflow-y: auto; max-height: 450px; border-radius: 8px; }
.cosmic-data-table-staff { width: 100%; border-collapse: collapse; min-width: 600px; text-align: left; }
.cosmic-data-table-staff th { padding: 14px 12px; color: var(--text-gray); font-family: 'Orbitron', sans-serif; font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid rgba(6, 182, 212, 0.3); position: sticky; top: 0; background: rgba(13, 18, 25, 0.98); z-index: 10; white-space: nowrap; }
.cosmic-data-table-staff td { padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #e5e7eb; font-size: 0.85rem; vertical-align: middle; }
.cosmic-data-table-staff tr:hover td { background: rgba(255,255,255,0.03); }

/* =========================================
   4. REPARACIÓN: BOTONES GAMER PRO
   ========================================= */

/* Botón Hero de Aplicar Sanción */
button.btn-hero-red { background: linear-gradient(90deg, #ff1f31, #b30000); border: 1px solid #ff4655; color: #fff; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1rem; text-transform: uppercase; letter-spacing: 2px; border-radius: 8px; padding: 16px 20px; width: 100%; cursor: pointer; transition: 0.4s; box-shadow: 0 5px 20px rgba(255, 70, 85, 0.4); margin-top: 10px; }
button.btn-hero-red:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255, 70, 85, 0.8); }

/* Botones de Acción (Modales y Generales) - EFECTO NEÓN HOLOGRÁFICO */
.btn-action { 
    padding: 12px 20px; border-radius: 6px; font-family: 'Orbitron', sans-serif; font-weight: 900; 
    cursor: pointer; text-transform: uppercase; transition: all 0.3s ease; border: none; font-size: 0.8rem; 
    display: inline-flex; justify-content: center; align-items: center; gap: 8px; 
    position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.5); letter-spacing: 1px;
}
/* Efecto de Brillo al pasar el cursor */
.btn-action::after { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transform: skewX(-20deg); transition: 0.5s; }
.btn-action:hover::after { left: 150%; }

.btn-action.cyan { background: linear-gradient(180deg, rgba(6,182,212,0.4), rgba(6,182,212,0.1)); border: 1px solid var(--cyan); color: #fff; } 
.btn-action.cyan:hover { background: var(--cyan); color: #000; box-shadow: 0 0 20px var(--cyan); transform: translateY(-2px); }

.btn-action.red { background: linear-gradient(180deg, rgba(255,70,85,0.4), rgba(255,70,85,0.1)); border: 1px solid var(--accent-red); color: #fff; } 
.btn-action.red:hover { background: var(--accent-red); color: #fff; box-shadow: 0 0 20px var(--accent-red); transform: translateY(-2px); }

.btn-action.gold { background: linear-gradient(180deg, rgba(255,184,0,0.4), rgba(255,184,0,0.1)); border: 1px solid var(--gold); color: #fff; } 
.btn-action.gold:hover { background: var(--gold); color: #000; box-shadow: 0 0 20px var(--gold); transform: translateY(-2px); }

.btn-action.blue { background: linear-gradient(180deg, rgba(0,168,255,0.4), rgba(0,168,255,0.1)); border: 1px solid var(--developer-blue); color: #fff; } 
.btn-action.blue:hover { background: var(--developer-blue); color: #000; box-shadow: 0 0 20px var(--developer-blue); transform: translateY(-2px); }

.btn-action.white { background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent); border: 1px solid #fff; color: #fff; } 
.btn-action.white:hover { background: #fff; color: #000; box-shadow: 0 0 20px #fff; transform: translateY(-2px); }

.btn-outline-white { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 12px; border-radius: 6px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-family: 'Orbitron', sans-serif; font-weight: bold; letter-spacing: 1px; } 
.btn-outline-white:hover { background: rgba(255,255,255,0.2); box-shadow: 0 0 15px rgba(255,255,255,0.3); transform: translateY(-2px); }

/* Botones Pequeños dentro de Tablas */
.cosmic-data-table-staff button {
    background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent) !important;
    border-radius: 4px !important; padding: 6px 12px !important;
    font-size: 0.7rem !important; font-family: 'Orbitron', sans-serif !important;
    font-weight: 800 !important; text-transform: uppercase !important;
    cursor: pointer !important; transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important; letter-spacing: 0.5px !important; margin: 2px !important;
}
.btn-details { border: 1px solid var(--cyan) !important; color: var(--cyan) !important; }
.btn-details:hover { background: var(--cyan) !important; color: #000 !important; box-shadow: 0 0 15px var(--cyan) !important; transform: translateY(-1px); }

.btn-history-del { border: 1px solid var(--accent-red) !important; color: var(--accent-red) !important; }
.btn-history-del:hover { background: var(--accent-red) !important; color: #fff !important; box-shadow: 0 0 15px var(--accent-red) !important; transform: translateY(-1px); }

.btn-edit-date { border: 1px solid var(--gold) !important; color: var(--gold) !important; }
.btn-edit-date:hover { background: var(--gold) !important; color: #000 !important; box-shadow: 0 0 15px var(--gold) !important; transform: translateY(-1px); }

.btn-expediente { border: 1px solid var(--primary-neon) !important; color: var(--primary-neon) !important; }
.btn-expediente:hover { background: var(--primary-neon) !important; color: #000 !important; box-shadow: 0 0 15px var(--primary-neon) !important; transform: translateY(-1px); }

.btn-unban { border: 1px solid var(--developer-blue) !important; color: var(--developer-blue) !important; }
.btn-unban:hover { background: var(--developer-blue) !important; color: #000 !important; box-shadow: 0 0 15px var(--developer-blue) !important; transform: translateY(-1px); }

.btn-bajar { border: 1px solid var(--gold) !important; color: var(--gold) !important; }
.btn-bajar:hover { background: var(--gold) !important; color: #000 !important; box-shadow: 0 0 15px var(--gold) !important; transform: translateY(-1px); }

.btn-revocar { border: 1px solid var(--audit-purple) !important; color: var(--audit-purple) !important; }
.btn-revocar:hover { background: var(--audit-purple) !important; color: #fff !important; box-shadow: 0 0 15px var(--audit-purple) !important; transform: translateY(-1px); }

/* =========================================
   5. MODALES (REPARACIÓN DE CAPAS Y LA "X")
   ========================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(8px); padding: 20px; }

/* REPARACIÓN: "X" VOLADORA (position: relative) */
.glass-modal { position: relative; background: rgba(13, 18, 25, 0.95); border: 1px solid; border-radius: 12px; padding: 25px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.9); animation: fadeUp 0.3s ease-out; }

/* REPARACIÓN: CAPAS Z-INDEX PARA QUE NO SE ESCONDAN */
#detailsModal { z-index: 3100 !important; }
#deleteExpModal { z-index: 3200 !important; }
#credUserModal, #credPassModal { z-index: 3100 !important; }
#observacionesModal { z-index: 3100 !important; }

.glass-modal.border-cyan { border-color: var(--cyan); box-shadow: 0 20px 50px rgba(0,0,0,0.9), 0 0 20px rgba(6,182,212,0.1); }
.glass-modal.border-gold { border-color: var(--gold); box-shadow: 0 20px 50px rgba(0,0,0,0.9), 0 0 20px rgba(255,184,0,0.1); }
.glass-modal.border-red { border-color: var(--accent-red); box-shadow: 0 20px 50px rgba(0,0,0,0.9), 0 0 20px rgba(255,70,85,0.1); }
.glass-modal.border-blue { border-color: var(--history-blue); }
.glass-modal.border-purple { border-color: var(--audit-purple); }
.glass-modal.border-white { border-color: rgba(255,255,255,0.3); }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 20px; }
.modal-header h2 { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; margin: 0; color: inherit; }
.close-modal { background: none; border: none; color: var(--accent-red); font-size: 1.5rem; cursor: pointer; transition: 0.3s; }
.close-modal:hover { transform: scale(1.2); text-shadow: 0 0 10px var(--accent-red); }

.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.det-box { background: rgba(0,0,0,0.4); padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.det-label { color: var(--text-gray); font-size: 0.7rem; text-transform: uppercase; display: block; margin-bottom: 4px; }
.det-value { font-size: 0.85rem; color: #fff; }
.sub-panel { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); margin-bottom: 15px; }

/* Toggles de Permisos */
.perm-box { padding: 15px; border-radius: 8px; border: 1px solid; }
.perm-box.red { background: rgba(255,70,85,0.05); border-color: rgba(255,70,85,0.3); }
.perm-box.green { background: rgba(0,255,136,0.05); border-color: rgba(0,255,136,0.3); }

.perm-toggle { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 0.8rem; color: #fff; font-weight: bold; }
.switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.5); transition: .4s; border-radius: 34px; border: 1px solid rgba(255,255,255,0.2); }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: #8b949e; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-neon); border-color: var(--primary-neon); box-shadow: 0 0 10px rgba(0, 255, 136, 0.4); }
input:checked + .slider:before { transform: translateX(20px); background-color: #000; }
.perm-box.red input:checked + .slider { background-color: var(--accent-red); border-color: var(--accent-red); box-shadow: 0 0 10px rgba(255, 70, 85, 0.4); }

/* =========================================
   6. RESPONSIVO (MÓVILES)
   ========================================= */
@media (max-width: 1100px) {
    .content-grid { grid-template-columns: 1fr; }
    .side-nav { width: 80px; }
    .logo-text, .side-link span, .user-info-text { display: none; }
    .side-link { justify-content: center; padding: 15px 0; }
}
@media (max-width: 768px) {
    .dashboard-root { flex-direction: column; overflow-y: auto; }
    .side-nav { width: 100%; height: auto; flex-direction: row; position: sticky; top: 0; z-index: 100; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); border-right: none; }
    .side-menu { flex-direction: row; overflow-x: auto; padding: 0; }
    .side-footer { display: none; }
    .dashboard-main { height: auto; width: 100%; overflow: visible; }
    .top-bar { display: none; }
    .content-grid { padding: 15px; gap: 15px; }
    .det-grid { grid-template-columns: 1fr; }
    .profile-menu-content { bottom: auto; top: 100%; left: 0; width: 100%; }
}

/* =========================================
   PARCHE DE PULIDO VISUAL (PC Y MÓVIL)
   ========================================= */

/* 1. Reducir el ancho gigante del modal de Permisos en PC */
#permissionsModal .modal-content {
    max-width: 750px !important;
    margin: 0 auto !important;
}

/* 2. Ajuste perfecto de Tablas (Botones intactos y expansión visual) */
.cosmic-data-table-staff td {
    word-break: normal; /* Quitamos la regla agresiva que partía las palabras */
}

/* Blindaje para que los botones y las pastillas de estado NUNCA se partan por la mitad */
.cosmic-data-table-staff td button,
.cosmic-data-table-staff td span[style*="border: 1px solid"] {
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Expandimos los modales grandes en PC para que la tabla respire y no pida scroll horizontal */
#historyModal .modal-content,
#bannedModal .modal-content,
#expedienteModal .modal-content {
    width: 95vw !important;
    max-width: 1300px !important; 
}

@media (max-width: 768px) {
    .cosmic-data-table-staff td {
        white-space: nowrap !important; /* En celular mantenemos el scroll táctil lateral */
    }
}

@media (max-width: 768px) {
    /* 3. Fix: Bug visual de la línea en el menú superior (Sanciones) */
    .side-link {
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
    }
    .side-link.active {
        border-bottom-color: var(--cyan) !important;
        background: linear-gradient(0deg, rgba(6, 182, 212, 0.15), transparent) !important;
    }

    /* 4. Fix: El buscador se sale del recuadro en Base de Datos */
    .card-header-gamer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    .card-header-gamer .input-group-flex {
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    .card-header-gamer .input-group-flex input,
    .card-header-gamer .input-group-flex select {
        flex: 1 !important;
        width: 100% !important;
    }

    /* 5. Fix: Tablas muy pegadas al hacer scroll con el dedo */
    .tables-col {
        gap: 40px !important; /* Más espacio vacío entre tablas para poner el dedo al escrolear */
    }
    .glass-panel {
        margin-bottom: 15px !important; /* Espacio extra de respiro al final de cada tarjeta */
    }
}

/* =========================================
   PARCHE FINAL: ERGONOMÍA MÓVIL Y LÍNEAS HR
   ========================================= */

/* 1. Arreglar las líneas separadoras en Cambiar Credenciales (PC y Móvil) */
.modal-hr {
    border: 0 !important;
    height: 2px !important;
    margin: 25px 0 20px 0 !important; /* Separación notoria arriba y abajo */
    border-radius: 2px !important;
}
#credUserModal .modal-hr { background: rgba(6, 182, 212, 0.6) !important; box-shadow: 0 0 8px rgba(6, 182, 212, 0.3) !important; }
#credPassModal .modal-hr { background: rgba(255, 184, 0, 0.6) !important; box-shadow: 0 0 8px rgba(255, 184, 0, 0.3) !important; }

/* 2. Ajustes específicos para celular (Espacio para el dedo y Perfil) */
@media (max-width: 768px) {
    
    /* Más margen debajo del header y entre las tablas para hacer scroll seguro */
    .content-grid {
        padding-top: 35px !important; 
        gap: 60px !important; 
    }
    .tables-col {
        gap: 60px !important;
    }
    
    /* Mostrar la foto de perfil en la barra superior */
    .side-nav {
        align-items: center !important;
    }
    .side-footer {
        display: flex !important;
        padding: 0 0 0 15px !important;
        border-top: none !important;
        border-left: 1px solid rgba(255,255,255,0.1) !important;
        margin-left: auto !important; /* Empuja la foto a la derecha del todo */
    }
    .user-badge-container {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    .user-avatar {
        width: 35px !important;
        height: 35px !important;
        border-width: 2px !important;
    }
    
    /* Hacer que el menú de perfil baje correctamente en celular */
    .profile-menu-content {
        position: fixed !important;
        top: 70px !important;
        bottom: auto !important;
        right: 10px !important;
        left: auto !important;
        width: 200px !important;
        z-index: 5000 !important;
    }
}

/* =========================================
   SISTEMA DE VISTAS ESCALABLES (PESTAÑAS)
   ========================================= */
.app-view {
    display: none;
    width: 100%;
    animation: fadeUp 0.3s ease-out;
}
.app-view.active {
    display: block;
}

/* =========================================
   GAMIFICACIÓN: RANGOS, NIVELES E INSIGNIAS
   ========================================= */
.rango-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(0,0,0,0.6); border: 1px solid; border-radius: 4px;
    padding: 2px 6px; font-size: 0.65rem; font-weight: bold; text-transform: uppercase;
}
.rango-asociado { color: #a8a8a8; border-color: #a8a8a8; }
.rango-contrabandista { color: #00a8ff; border-color: #00a8ff; }
.rango-jefe { color: #a855f7; border-color: #a855f7; }
.rango-magnate { color: #ff5e00; border-color: #ff5e00; box-shadow: 0 0 8px rgba(255,94,0,0.3); }
.rango-zar { color: #ffb800; border-color: #ffb800; box-shadow: 0 0 10px rgba(255,184,0,0.5); }

.rango-progress-bg {
    width: 100%; height: 6px; background: rgba(0,0,0,0.6);
    border-radius: 3px; overflow: hidden; margin-top: 5px; border: 1px solid rgba(255,255,255,0.1);
}
.rango-progress-fill {
    height: 100%; background: linear-gradient(90deg, #ffb800, #ff5e00);
    transition: width 0.5s ease-out;
}
.insignias-container {
    display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px;
}
.insignia-item {
    font-size: 0.75rem; cursor: help; filter: drop-shadow(0 0 3px rgba(255,255,255,0.4));
}
.fama-card {
    background: linear-gradient(145deg, rgba(255,184,0,0.1), rgba(0,0,0,0.8));
    border: 1px solid var(--gold); border-radius: 8px; padding: 15px; text-align: center;
    box-shadow: inset 0 0 20px rgba(255,184,0,0.05); transition: 0.3s;
}
.fama-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(255,184,0,0.3); }

/* =========================================
   PARCHE: SCROLL HORIZONTAL EN TABLAS MÓVIL
   ========================================= */

/* 1. Scroll para la tabla pública (Antes del Login) */
.table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important; /* Deslizamiento suave táctil */
}

/* Evitar que el texto de la tabla pública se aplaste */
.gamer-table th, .gamer-table td {
    white-space: nowrap !important; 
}

/* 2. Asegurar el scroll en el Directorio y demás tablas internas */
.table-wrapper-internal {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
}

.cosmic-data-table-staff th {
    white-space: nowrap !important;
}

/* Responsivo para la grilla de formularios del Directorio Crew */
@media (max-width: 768px) {
    .dir-forms-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* =========================================
   SISTEMA DE ACTIVIDAD Y PODIO
   ========================================= */
.gold-glow-border { border: 1px solid rgba(255, 184, 0, 0.3); }

/* Podio Top 3 */
.podio-box { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.5); padding: 15px; border-radius: 8px; border: 1px solid #30363d; min-width: 120px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.podio-box.oro { border-color: #ffb800; transform: scale(1.1); z-index: 3; box-shadow: 0 0 20px rgba(255,184,0,0.2); }
.podio-box.plata { border-color: #c0c0c0; z-index: 2; }
.podio-box.bronce { border-color: #cd7f32; z-index: 1; }
.podio-corona { font-size: 2rem; margin-bottom: 5px; }

/* Fueguitos y Zona Roja */
.streak-fire { color: #ff5e00; text-shadow: 0 0 5px #ff5e00; font-weight: bold; }
.streak-fire.dead { color: #555; text-shadow: none; }
.zona-riesgo { background: rgba(255, 70, 85, 0.1) !important; }
.zona-riesgo td { color: #ff8a93 !important; }

/* Toggles de Asistencia (GTA/DISCORD) */
.asistencia-toggle { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: #fff; cursor: pointer; }
.asistencia-toggle input { cursor: pointer; width: 16px; height: 16px; accent-color: var(--primary-neon); }

/* =========================================
   CONTENEDOR DE ANCHO COMPLETO (DIRECTORIO Y ACTIVIDAD)
   ========================================= */
.content-full {
    padding: 0 30px 30px 30px;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .content-full {
        padding: 15px;
    }
}

/* Cuadrícula responsiva para las tablas de especialización en Clasificación */
.actividad-sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 900px) {
    .actividad-sub-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* =========================================
   DASHBOARD ESTADÍSTICO V2.0
   ========================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 20px;
}
.kpi-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.kpi-card:hover {
    transform: translateY(-5px);
    border-color: var(--audit-purple);
}
.kpi-title {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.kpi-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
    margin-bottom: 5px;
}
.kpi-desc {
    font-size: 0.65rem;
    color: #555;
}
.chart-grid-perfect {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Exactamente 2 columnas obligatorias */
    gap: 20px;
    margin-bottom: 30px;
}
.chart-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Clases para forzar el tamaño y eliminar huecos */
.half-width {
    grid-column: span 1;
}
.full-width {
    grid-column: 1 / -1; /* Obliga a ocupar de lado a lado la pantalla completa */
}
.chart-container h4 {
    color: var(--audit-purple);
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
}

@media (max-width: 1000px) {
    /* En pantallas medianas o celulares, TODO se vuelve de una columna */
    .chart-grid-perfect {
        grid-template-columns: 1fr;
    }
    .half-width {
        grid-column: 1 / -1;
    }
}

/* =========================================
   PARCHE DEFINITIVO V6: MÓVILES AL 100%
   ========================================= */
@media (max-width: 768px) {
    /* --- 1. PODIOS CARRUSEL (¡NO TOCAR!) --- */
    #podioContainer {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        gap: 15px !important;
        padding: 10px 5px 20px 5px !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .podio-box {
        flex: 0 0 auto !important; 
        min-width: 140px !important; 
        transform: none !important;
    }
    .podio-box.oro {
        transform: translateY(-5px) !important;
    }

    /* --- 2. BARRAS HORIZONTALES TABLAS (¡NO TOCAR!) --- */
    .actividad-sub-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    .sub-panel {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    .table-wrapper-internal {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        max-height: 55vh !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .cosmic-data-table-staff {
        min-width: 650px !important; 
        width: 100% !important;
        display: table !important; 
    }

    /* --- 3. REPARACIÓN BOTONES DIRECTORIO CREW (BLINDADO) --- */
    /* 1. El buscador ocupa toda la primera línea */
    #searchDirectorioInput {
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 5px !important;
    }

    /* 2. El contenedor oculto que agrupa los botones "Reloj, Asistencia y Baneados" es empujado abajo y apilado */
    #searchDirectorioInput + div {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* 3. Obliga a los 3 botones a estirarse al 100% de la pantalla para que no se encimen */
    #searchDirectorioInput + div button,
    #searchDirectorioInput + div #devTimerContainer {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }

    /* (Conservado) Formularios de Añadir Jugador */
    .dir-forms-grid {
        display: flex !important;
        flex-direction: column !important; 
        gap: 20px !important;
    }
    .dir-forms-grid div[style*="display: flex"] {
        flex-direction: column !important; 
        gap: 10px !important;
    }
    .dir-forms-grid input,
    .dir-forms-grid button,
    .dir-forms-grid select {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}