/* --- CONFIGURACIÓN Y VARIABLES DE COLORES --- */
:root {
    --bg-main: #0d0e11;
    --bg-card: #15171c;
    --bg-topbar: #1a1c22;
    --accent: #ffaa00;
    --accent-hover: #e09600;
    --text-main: #ffffff;
    --text2: #8a8f98;
    --danger: #ff4a4a;
    --online: #2ec4b6; /* Verde esmeralda para el online */
    --border: #22252c;
    --topbar-height: 65px;
    --sidebar-width: 280px;
}

/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s;
}
a:hover {
    color: var(--accent-hover);
}

/* --- CONTENEDOR GLOBAL --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- TOPBAR --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height);
    background-color: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-brand span { color: var(--accent); }

/* BOTÓN HAMBURGUESA */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
}

/* SERVER PILL (TOPBAR) */
.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.04);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text2); }
.status-pill.online .status-dot { background-color: var(--online); box-shadow: 0 0 8px var(--online); }
.status-pill.offline .status-dot { background-color: var(--danger); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* --- REPRODUCTOR --- */
.music-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0,0,0,0.2);
    padding: 0.3rem 0.7rem;
    border-radius: 30px;
    border: 1px solid var(--border);
}
.music-btn {
    background: var(--accent);
    border: none;
    color: #000;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.music-name { font-size: 0.75rem; color: var(--text2); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volume-slider { width: 60px; accent-color: var(--accent); cursor: pointer; }

/* USER TOPBAR */
.topbar-user { display: flex; align-items: center; gap: 0.5rem; color: var(--text-main); }
.topbar-username { font-size: 0.85rem; font-weight: 600; }
.mini-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* --- SIDEBAR --- */
#sidebar {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
#sidebar.active { left: 0; }
.sidebar-top { padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.nav-brand-side { font-size: 1.2rem; font-weight: 800; text-transform: uppercase; }
.nav-brand-side span { color: var(--accent); }
.sidebar-close { background: none; border: none; color: var(--text2); font-size: 1.2rem; cursor: pointer; }
.sidebar-user-info { padding: 1.2rem 1.5rem; background: rgba(0, 0, 0, 0.15); border-bottom: 1px solid var(--border); }
.user-flex { display: flex; align-items: center; gap: 0.8rem; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.no-session { color: var(--text2); font-size: 0.85rem; }
.sidebar-links { padding: 1rem 0; overflow-y: auto; flex: 1; }
.sidebar-section { font-size: 0.7rem; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; padding: 0.7rem 1.5rem 0.3rem 1.5rem; }
.sidebar-links a { display: flex; align-items: center; padding: 0.7rem 1.5rem; color: var(--text-main); font-size: 0.9rem; gap: 0.7rem; border-left: 3px solid transparent; }
.sidebar-links a:hover, .sidebar-links a.active { background-color: rgba(255, 170, 0, 0.05); color: var(--accent); border-left-color: var(--accent); }
.sidebar-server { padding: 1.2rem 1.5rem; border-top: 1px solid var(--border); background: rgba(0,0,0,0.1); }
.server-title { font-size: 0.65rem; color: var(--text2); text-transform: uppercase; margin-bottom: 0.3rem; }
.sidebar-server code { color: var(--accent); font-size: 0.8rem; font-family: monospace; }

#sidebar-overlay {
    position: fixed;
    top: 0;   left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1500;
    display: none;
}
#sidebar-overlay.active { display: block; }

/* --- WRAPPER DE PÁGINA --- */
.page-content {
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

/* --- SECCIÓN HERO (BIENVENIDA) --- */
.hero {
    background: linear-gradient(135deg, #161920 0%, #0d0e11 100%);
    border-bottom: 1px solid var(--border);
    padding: 4rem 0;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.8rem; letter-spacing: -0.5px; }
.hero h1 .hl { color: var(--accent); }
.hero p { color: var(--text2); max-width: 600px; margin: 0 auto 2rem auto; font-size: 1.05rem; line-height: 1.6; }

/* --- BOTONES GENERALES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
}
.btn-primary { background-color: var(--accent); color: #000 !important; }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--border); color: var(--text-main); background: rgba(255,255,255,0.02); }
.btn-outline:hover { background: rgba(255,255,255,0.07); border-color: var(--text2); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* --- CORRECCIÓN INTEGRAL DE FORMULARIOS E INPUTS BLANCOS --- */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background-color: #1a1c22 !important; /* Mismo tono oscuro de la topbar */
    color: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.9rem !important;
    outline: none !important;
    transition: all 0.2s ease-in-out !important;
    box-sizing: border-box !important;
}

/* Estado de enfoque / Selección */
input:focus, select:focus, textarea:focus {
    border-color: var(--accent) !important;
    background-color: #20232b !important;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.15) !important;
}

/* Modificación de texto de ayuda flotante dentro de las cajas */
input::placeholder, textarea::placeholder {
    color: #5a606d !important;
    opacity: 1 !important;
}

/* Adaptación premium para menús desplegables (<select>) */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffaa00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.1em !important;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

/* --- TARJETA DE ESTADO (STATUS CARD) --- */
.status-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
}
.status-online-badge { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.5px; }

/* BARRA DE JUGADORES */
.status-bar-wrap { margin-bottom: 1.5rem; }
.status-bar-track { width: 100%; height: 8px; background-color: #20232b; border-radius: 10px; overflow: hidden; }
.status-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #ffca61 100%); border-radius: 10px; transition: width 0.5s ease; }

/* REJILLA DE ESTADÍSTICAS */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.status-item {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.02);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}
.status-item .val { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.2rem; }
.status-item .lbl { font-size: 0.75rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }

/* --- ESTRUCTURA DE 2 COLUMNAS (GRID-2) --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48%, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.card-header h3 { font-size: 1.1rem; font-weight: 700; }

/* MEDALLAS (BADGES) */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-online { background-color: rgba(46, 196, 182, 0.15); color: var(--online); }

/* --- TABLAS DE JUGADORES --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th {
    text-align: left;
    color: var(--text2);
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}
td {
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }

.player-avatar {
    display: inline-flex;
    width: 24px;
    height: 24px;
    background: #2a2d35;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
}

/* --- BLOQUE DE NOTICIAS --- */
.noticia-lista-item {
    display: flex;
    gap: 1.2rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
    transition: transform 0.2s;
}
.noticia-lista-item:last-child { border-bottom: none; }
.noticia-lista-item:hover { transform: translateX(4px); }

.noticia-lista-img {
    width: 110px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.noticia-lista-placeholder {
    width: 110px;
    height: 75px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid var(--border);
}
.noticia-lista-body { flex: 1; }
.noticia-lista-body h3 { font-size: 1.05rem; font-weight: 600; color: #fff; margin-bottom: 0.2rem; }
.noticia-lista-body p { color: var(--text2); font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.4rem; }

.noticia-meta { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text2); }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .noticia-lista-item { flex-direction: column; gap: 0.8rem; }
    .noticia-lista-img, .noticia-lista-placeholder { width: 100%; height: 150px; }
}

@media (max-width: 576px) {
    .music-name, .volume-slider, .topbar-username { display: none; }
    .hero h1 { font-size: 2rem; }
    .status-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}

/* ==========================================================================
   ANEXO: SOPORTE DE FOOTER, OVERLAY Y NOTIFICACIONES
   ========================================================================== */

#sidebar-overlay.active {
    display: block !important;
    opacity: 1 !important;
}

.site-footer {
    background-color: var(--bg-topbar);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.music-btn.playing {
    background-color: var(--online) !important;
    box-shadow: 0 0 8px var(--online);
}

#music-notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 1.2rem;
    border-radius: 8px;
    z-index: 9999;
    width: 290px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#music-notif span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    display: block;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center !important;
    }
    .footer-inner div {
        text-align: center !important;
    }
    #music-notif {
        left: 50%;
        transform: translateX(-50%);
        bottom: 16px;
        width: calc(100% - 32px);
    }
}

/* ==========================================================================
   MÓDULO DE PROPIEDADES (PROPIEDADES.PHP)
   ========================================================================== */

.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}
.page-header h1 span {
    color: var(--accent);
}
.page-subtitle {
    color: var(--text2);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-card .sv {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}
.stat-card .sl {
    font-size: 0.75rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-actions {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.owner-link {
    font-weight: 500;
    color: var(--text-main);
}
.owner-link:hover {
    color: var(--accent);
}
.no-owner {
    color: var(--text2);
    font-size: 0.85rem;
    background: rgba(255,255,255,0.02);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.level-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.badge-occupied {
    background-color: rgba(255, 74, 74, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 74, 74, 0.2);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.8rem;
    }
}

/* ==========================================================================
   MÓDULO DE TIENDA VIP Y SISTEMA DE MODALES
   ========================================================================== */

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.alert-success {
    background-color: rgba(46, 196, 182, 0.1);
    border: 1px solid rgba(46, 196, 182, 0.2);
    color: var(--online);
}
.alert-success a {
    color: #fff;
    text-decoration: underline;
}

.tienda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tienda-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}
.tienda-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,170,0,0.3);
}

.tienda-img-container {
    width: 100%;
    height: 160px;
    background: #1c1e24;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.tienda-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tienda-img-ph {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #1c1e24 0%, #15171c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-bottom: 1px solid var(--border);
}

.tienda-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.badge-tipo {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text2);
    border: 1px solid var(--border);
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0.6rem 0 0.4rem 0;
}

.product-desc {
    color: var(--text2);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex: 1;
}
.product-desc.no-desc {
    font-style: italic;
    opacity: 0.5;
}

.tienda-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.price-tag {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
}

.btn-full-card {
    flex: 1;
    padding: 0.55rem;
    font-size: 0.85rem;
    text-align: center;
}

.font-notice {
    background: rgba(0,0,0,0.15);
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 2rem;
}
.font-notice p {
    font-size: 0.85rem;
    color: var(--text2);
}

/* ==========================================================================
   ESTILOS VENTANA MODAL AVANZADA
   ========================================================================== */
.modal-blur-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: none;
}
.modal-blur-overlay.active {
    display: block;
}

.custom-modal {
    position: fixed;
    top: 45%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
    z-index: 9500;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}
.custom-modal.active {
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.modal-box {
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}
.modal-close-btn {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

.selected-product-box {
    background: #1c1e24;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.box-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text2);
    letter-spacing: 0.5px;
}
.box-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.15rem;
}
.box-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.16rem;
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text2);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-help-text {
    text-align: center;
    color: var(--text2);
    font-size: 0.75rem;
    margin-top: 0.7rem;
}

@media (max-width: 576px) {
    .custom-modal {
        width: calc(100% - 24px);
    }
    .tienda-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .btn-full-card {
        width: 100%;
    }
}

/* ==========================================================================
   MÓDULO DE FACCIONES CON EMBLEMAS DINÁMICOS
   ========================================================================== */

.facciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.faction-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.faction-card:hover {
    transform: translateY(-2px);
}

.faction-img-box {
    position: relative;
    width: 100%;
    height: 140px;
    background: #161920;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faction-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.faction-img-placeholder {
    font-size: 2.5rem;
    opacity: 0.3;
}

.edit-img-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.edit-img-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.faction-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faction-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.faction-leader {
    color: var(--text2);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.faction-leader a {
    color: var(--accent);
}

.faction-badge {
    background: rgba(255, 170, 0, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 170, 0, 0.15);
    padding: 0.25rem 0.6rem;
    font-weight: 600;
}

.faction-progress-bg {
    background: #20232b;
    border-radius: 4px;
    height: 6px;
    width: 100%;
    overflow: hidden;
}

.faction-progress-bar {
    background: var(--accent);
    height: 100%;
    border-radius: 4px;
    box-shadow: 0 0 6px var(--accent);
}

.faction-ranks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.rank-tag {
    font-size: 0.72rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   PANEL ADMINISTRATIVO (ADMIN/INDEX.PHP)
   ========================================================================== */
.badge-admin-rank {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.admin-content-section {
    animation: fadeInAdmin 0.25s ease-in-out;
}

@keyframes fadeInAdmin {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   BURBUJA FLOTANTE DE DISCORD (FOOTER)
   ========================================================================== */
.discord-floating-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #5865F2; /* Color Blurple Oficial de Discord */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.discord-floating-bubble svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.discord-floating-bubble:hover {
    transform: scale(1.1);
    background-color: #4752c4;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
}

.discord-floating-bubble:hover svg {
    transform: rotate(8deg);
}

@media (max-width: 768px) {
    .discord-floating-bubble {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    .discord-floating-bubble svg {
        width: 22px;
        height: 22px;
    }
}
/* ==========================================================================
   CORRECCIÓN GLOBAL DE CAPAS Y RESPONSIVIDAD (MENÚ HAMBURGUESA)
   ========================================================================== */

/* Asegurar posicionamiento rígido de la barra superior */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height, 65px);
    background-color: var(--bg-topbar, #1a1c22);
    border-bottom: 1px solid var(--border, #22252c);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 99990; /* Capa por encima de las secciones normales */
}

/* El fondo oscuro translúcido */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99995; /* Justo un nivel inferior al Sidebar */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Activación del overlay */
#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* El contenedor del Sidebar flotante */
#sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Completamente oculto a la izquierda */
    width: var(--sidebar-width, 280px);
    height: 100vh;
    background-color: var(--bg-card, #15171c);
    border-right: 1px solid var(--border, #22252c);
    z-index: 99999; /* LA CAPA SUPREMA: Flota encima de tablas, grids y layouts de admin */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Activación forzada por JavaScript */
#sidebar.active {
    left: 0 !important;
}

/* Forzar visualización correcta del botón hamburguesa */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 99991;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main, #ffffff);
    border-radius: 2px;
    transition: all 0.2s ease-in-out;
}

/* Compensar el alto de la topbar fija para que no tape el contenido de las páginas */
body {
    padding-top: var(--topbar-height, 65px);
}

/* ==========================================================================
   BURGER ANIMADA REFORZADA CON PRIORIDAD (ColVenRP)
   ========================================================================== */

/* Forzar que la Topbar quede fija y con su z-index correcto */
.topbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height, 65px);
    background-color: var(--bg-topbar, #1a1c22);
    border-bottom: 1px solid var(--border, #22252c);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 99990; 
}

body {
    padding-top: var(--topbar-height, 65px);
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99994; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#sidebar {
    position: fixed;
    top: 0;
    left: -280px; 
    width: var(--sidebar-width, 280px);
    height: 100vh;
    background-color: var(--bg-card, #15171c);
    border-right: 1px solid var(--border, #22252c);
    z-index: 99999; 
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

#sidebar.active {
    left: 0 !important;
}

/* --- BOTÓN DE HAMBURGUESA REFORZADO --- */
button.hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    z-index: 99995;
    outline: none;
}

button.hamburger .hamburger-box {
    position: relative;
    width: 24px;
    height: 16px;
}

/* Forzar la animación con !important para romper cualquier herencia previa */
button.hamburger .hamburger-box span {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-main, #ffffff) !important;
    border-radius: 4px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 1 !important;
}

/* Posiciones estáticas simétricas */
button.hamburger .hamburger-box .bar-top { 
    top: 0; 
}
button.hamburger .hamburger-box .bar-mid { 
    top: 50%; 
    transform: translateY(-50%); 
}
button.hamburger .hamburger-box .bar-bot { 
    bottom: 0; 
}

/* --- ANIMACIONES ACTIVAS REFORZADAS EN LA "X" --- */

/* Línea Superior gira a 45° */
button.hamburger.is-active .hamburger-box .bar-top {
    transform: translateY(7px) rotate(45deg) !important;
    background-color: var(--danger, #ff4a4a) !important;
}

/* Línea del Medio se encoge y desaparece */
button.hamburger.is-active .hamburger-box .bar-mid {
    opacity: 0 !important;
    transform: scale(0) !important;
}

/* Línea Inferior gira a -45° */
button.hamburger.is-active .hamburger-box .bar-bot {
    transform: translateY(-7px) rotate(-45deg) !important;
    background-color: var(--danger, #ff4a4a) !important;
}

@media (max-width: 992px) {
    .admin-layout {
        margin-top: 10px;
    }
}