/* ============================================================
   RESET + VARIABLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

:root {
    --bg: #eef1f7;
    --card-bg: #ffffff;

    --primary: #2563eb;
    --primary-hover: #1e4fc7;

    --green: #16a34a;
    --green-dark: #0f7a35;

    --red: #dc2626;

    --text: #0f172a;
    --muted: #64748b;

    --radius: 14px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);

    --header-h: 62px;
}

body {
    background: var(--bg);
    color: var(--text);
}


/* ============================================================
   TOP NAV (HEADER)
   ============================================================ */

.top-nav {
    background: #0f172a;
    color: white;
    height: var(--header-h);
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.top-nav-left .logo {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.logo span {
    color: var(--primary);
}

.top-nav-center {
    display: flex;
    gap: 26px;
}

.top-nav-center a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: .25s;
}

.top-nav-center a:hover {
    color: white;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   BOTONES PEQUEÑOS (HEADER)
   ============================================================ */

.btn-small {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn-blue-small {
    background: var(--primary);
    color: white;
}
.btn-blue-small:hover {
    background: var(--primary-hover);
}

.btn-green-small {
    background: var(--green);
    color: white;
}
.btn-green-small:hover {
    background: var(--green-dark);
}

.btn-red-small {
    background: var(--red);
    color: white;
}
.btn-gray-small {
    background: #475569;
    color: white;
}

/* ============================================================
   AVATAR + MENÚ DESPLEGABLE HEADER
   ============================================================ */

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #475569;
}

.user-menu-chevron {
    font-size: 13px;
    opacity: 0.7;
}

.user-menu-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 180px;
    background: white;
    color: var(--text);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
}

.user-menu.open .user-menu-dropdown {
    display: flex;
}

.user-menu-dropdown button {
    padding: 10px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.user-menu-dropdown button:hover {
    background: #f1f5f9;
}

.user-menu-dropdown .danger {
    background: #fee2e2;
}
.user-menu-dropdown .danger:hover {
    background: #fecaca;
}

/* ============================================================
   LAYOUT PRINCIPAL: SIDEBAR + CONTENT
   ============================================================ */

.layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 26px;
    padding: 26px;
}

/* ============================================================
   CONTENT AREA (INDEX)
   ============================================================ */

.content {
    width: 100%;
}

/* Grids para tarjetas */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Tarjetas principales */
.card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card.highlight {
    border-left: 6px solid var(--primary);
    background: #eaf0ff;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card p {
    font-size: 14px;
}

.card ol, .card ul {
    padding-left: 20px;
    margin-top: 6px;
}

.card-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

/* Botón de acción dentro de cards */
.btn-view {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn-view:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: #e2e8f0;
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-ghost:hover {
    background: #cbd5e1;
}

/* ============================================================
   LISTAS SIMPLES DEL INICIO
   ============================================================ */

.simple-list {
    list-style: none;
    padding-left: 0;
}

.simple-list li {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

/* ============================================================
   GRID ROOMS (REUTILIZADO)
   ============================================================ */

.grid-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.room-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: .25s;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.room-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
}

.room-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.room-topic {
    font-size: 13px;
    color: var(--muted);
}

/* ============================================================
   CHAT PAGE (YA TENÍAS – REPARADO)
   ============================================================ */

.chat-page {
    background: #e3e7f5;
    min-height: 100vh;
    padding: 20px;
}

/* ... todo lo de chat que ya tenías intacto ... */
/* (IMPORTANTE: NO LO ELIMINÉ, SOLO ESTÁ RESUMIDO AQUI POR ESPACIO) */

/* ============================================================
   ADMIN PANEL (YA EXISTENTE — LIMPIO)
   ============================================================ */

.admin-page {
    background: #e5e7f5;
    min-height: 100vh;
    padding: 20px;
}

/* ============================================================
   PERFIL DE USUARIO (CORREGIDO)
   ============================================================ */

/* ... se mantiene todo lo tuyo ... */

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SIDEBAR MODERNO
   ============================================================ */

.sidebar-modern .box {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.sidebar-modern h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.sidebar-modern ul.list {
    list-style: none;
}

.sidebar-modern ul.list li {
    padding: 8px 6px;
    border-radius: 8px;
    transition: .2s;
    font-size: 14px;
    cursor: pointer;
}

.sidebar-modern ul.list li:hover {
    background: #e2e8f0;
}

/* Avatar sidebar */
.sidebar-avatar {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid #a5b4fc;
}

.account-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.small-text {
    font-size: 13px;
    color: var(--muted);
}

.full-width {
    width: 100%;
}

/* ------------------------------
   LAYOUT (sidebar + content)
--------------------------------*/
.page-container {
    display: flex;
    padding: 20px;
}

.sidebar {
    width: 260px;
    margin-right: 25px;
}

.content-area {
    flex: 1;
}


/* ------------------------------
   GENERIC BOX
--------------------------------*/
.box {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}


/* ------------------------------
   SIDEBAR ITEMS
--------------------------------*/
.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    margin-bottom: 6px;
    transition: 0.2s;
}

.sidebar-list li:hover {
    background: #e2e8f0;
}

.sidebar-list .active {
    background: var(--primary);
    color: white;
}


/* ------------------------------
   GRID DE SALAS
--------------------------------*/
.grid-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.room-card {
    text-align: center;
    padding: 25px;
}

.room-card h3 {
    font-size: 20px;
    margin-top: 10px;
    color: var(--text);
}

.room-topic {
    font-size: 14px;
    color: var(--muted);
}

.room-icon img {
    width: 48px;
    height: 48px;
}


/* ------------------------------
   BADGES (Online, Oficial, +18)
--------------------------------*/
.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    margin-right: 6px;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gold {
    background: #fef9c3;
    color: #b45309;
}

.badge-red {
    background: #fee2e2;
    color: #b91c1c;
}

.room-meta {
    margin: 10px 0 15px;
}


/* ------------------------------
   BUTTONS
--------------------------------*/
.btn-blue {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.btn-blue:hover {
    background: var(--primary-hover);
}

.btn-green {
    background: var(--green);
    color: white;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-green:hover {
    background: var(--green-dark);
}

.w-100 { width: 100%; }


/* ------------------------------
   FORMS
--------------------------------*/
.modern-form input,
.modern-form select,
.modern-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid #cbd5e1;
    margin-bottom: 15px;
    font-size: 15px;
}

.modern-form textarea {
    height: 80px;
}

h2.title-section {
    font-size: 26px;
    margin-bottom: 10px;
    color: var(--text);
}
/* Contenedor del usuario en header */
#headerUserArea {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

/* Ajusta ancho de los botones para que no se salgan */
.btn-blue, .btn-green {
    padding: 6px 14px;
    font-size: 14px;
    white-space: nowrap; /* evita brincos */
}

/* Para pantallas pequeñas */
@media (max-width: 1180px) {
    #headerUserArea {
        transform: scale(0.85);
    }
}

@media (max-width: 1000px) {
    #headerUserArea {
        transform: scale(0.75);
    }
}
.room-icon {
    width: 42px;     /* antes 28px */
    height: 42px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.room-card {
    background: white;
    width: 230px;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: 0.25s ease;
    text-align: center;
}

.room-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.room-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.room-card .enter-btn {
    display: block;
    margin-top: 10px;
    padding: 8px 14px;
    background: #187bff;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: 0.25s ease;
}
.room-card .enter-btn:hover {
    background: #0d5edc;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 6px 16px;
    border-radius: 6px;
    color: white!important;
    font-size: 14px;
    border: none;
}

.blue { background: #187bff; }
.green { background: #28a745; }
.red { background: #dc3545; }

.nav-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.nav-right button,
.nav-right a {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================================
   CHAT.HTML – Layout MSN Moderno
   ============================================================ */

.chat-page {
    background: #e3e7f5;
    min-height: 100vh;
    padding: 20px;
}

.chat-window {
    max-width: 1150px;
    margin: 0 auto;
    background: #f4f6ff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    display: grid;
    grid-template-columns: 3fr 1fr;
    overflow: hidden;
    border: 1px solid #c7d2ff;
}

/* Barra tipo MSN */
.chat-titlebar {
    grid-column: 1 / 3;
    background: linear-gradient(to right, #356ad9, #2243b8);
    color: white;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}

.chat-titlebar-left span {
    margin-left: 6px;
}

.chat-titlebar-buttons span {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.2);
    margin-left: 4px;
}

/* Panel de mensajes */
.chat-main-panel {
    background: white;
    border-right: 1px solid #dde3ff;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
}

/* Mensajes estilo burbuja */
.chat-message {
    max-width: 70%;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: #e5edff;
    color: #111827;
}

.chat-message.me {
    margin-left: auto;
    background: #bbd7ff;
}

.chat-message .sender {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.chat-message .time {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 6px;
}

/* Mensaje de sistema */
.chat-message.system {
    text-align: center;
    background: transparent;
    color: #4b6cd8;
    font-style: italic;
}

/* Input abajo */
.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #dde3ff;
    background: #f3f4ff;
}

.chat-input-bar input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5ff;
    font-size: 14px;
}

.chat-input-bar button {
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.chat-input-bar button:hover {
    background: #1d4ed8;
}

/* Panel derecho: usuarios conectados */
.chat-sidebar {
    background: #f5f5ff;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-title {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 6px;
    background: #e0e5ff;
    border-radius: 6px;
    margin-bottom: 8px;
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

/* Usuario con avatar tipo MSN */
.user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 8px;
    cursor: default;
}

.user-item:hover {
    background: #e4ebff;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.15);
    background: #c7d2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-status {
    font-size: 11px;
    color: #16a34a;
}

/* Barra inferior de estado (opcional) */
.chat-status-bar {
    grid-column: 1 / 3;
    background: #e1e4ff;
    font-size: 12px;
    padding: 4px 8px;
    color: #374151;
}

/* ============================================================
   CHAT CON AVATARES ESTILO MSN (chat-room-avatar.html)
   ============================================================ */

.chat-avatars-bar {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: #f1f5ff;
    border-bottom: 1px solid #dde3ff;
}

.chat-avatars-bar .avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    cursor: pointer;
}

.chat-avatars-bar .avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    background: #c7d2ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatars-bar .avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatars-bar .avatar-option.active .avatar-circle {
    border-color: #2563eb;
}

/* ============================================================
   ADMIN.HTML – Panel moderno
   ============================================================ */

.admin-page {
    background: #e5e7f5;
    min-height: 100vh;
    padding: 20px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}

/* Sidebar admin */
.admin-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.admin-sidebar h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.admin-nav {
    list-style: none;
    padding: 0;
}

.admin-nav li {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.admin-nav li:hover {
    background: #e5edff;
}

/* Contenido principal */
.admin-main {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.admin-main h1 {
    font-size: 22px;
    margin-bottom: 14px;
}

/* tablas admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.admin-table thead {
    background: #f9fafb;
    font-weight: 600;
}

.admin-badge {
    padding: 3px 7px;
    font-size: 11px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
}

/* Botones admin pequeños */
.admin-actions .btn-small {
    margin-right: 4px;
}

/* ============================================================
   PROFILE.HTML – Perfil de usuario
   ============================================================ */

.profile-page {
    background: #e5e7f5;
    min-height: 100vh;
    padding: 26px 20px;
}

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
}

/* Panel de perfil izquierdo */
.profile-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto 10px;
    border: 3px solid #a5b4fc;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

/* contenido derecho */
.profile-main {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.profile-main h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.profile-stat {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
}

.profile-stat span {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

/* Historial de salas */
.profile-rooms {
    margin-top: 10px;
}

.profile-rooms ul {
    list-style: none;
    padding-left: 0;
}

.profile-rooms li {
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}
/* ========================== */
/*   PERFIL – ESTILO MODERNO  */
/* ========================== */

/* ============================================================
   🎨 PERFIL — ESTILO FINAL CORREGIDO (Shateros 2.0)
   ============================================================ */

.profile-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.profile-container {
    width: 900px;
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}

/* Encabezado */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

/* Avatar — 100% redondo y centrado */
.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #2979ff;
    background: #d4d4d4;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Información */
.profile-info h2 {
    font-size: 28px;
    margin: 0;
    font-weight: 700;
}

.username-tag {
    font-size: 16px;
    color: #6b7280;
}

/* Botón cambiar avatar */
.profile-avatar-actions {
    margin-left: auto;
}

.btn-edit-avatar {
    background: #2979ff;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn-edit-avatar:hover {
    background: #1f5fcc;
}

/* Body del perfil */
.profile-body {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Tarjetas */
.profile-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}

.profile-card h3 {
    margin-bottom: 14px;
    font-size: 20px;
}

/* Inputs */
.profile-card input,
.profile-card textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f8fafc;
    font-size: 15px;
    margin-bottom: 12px;
}

/* Botón guardar */
.btn-save-profile {
    width: 100%;
    padding: 12px;
    border: none;
    background: #22c55e;
    color: white;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: .2s;
}

.btn-save-profile:hover {
    background: #15803d;
}

/* Stats */
.stats-box {
    display: flex;
    gap: 20px;
}

.stat-item {
    flex: 1;
    background: #f1f5f9;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
}

.stat-item .num {
    font-size: 30px;
    font-weight: 700;
    color: #2563eb;
}

/* ============================================================
   SIDEBAR INDEX — IGUAL A ROOMS
   ============================================================ */

.sidebar-categories-index {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-menu-cats,
.sidebar-menu-quick {
    background: white;
    padding: 18px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.sidebar-menu-cats h3,
.sidebar-menu-quick h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.side-cat-list {
    list-style: none;
    padding: 0;
}

.side-cat-list li {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: .25s;
}

.side-cat-list li a {
    color: var(--text);
    text-decoration: none;
    display: block;
}

.side-cat-list li:hover {
    background: #e2e8f0;
}

.side-cat-list li.active {
    background: var(--primary);
    color: white;
}

.side-cat-list li.active a {
    color: white;
}
.sidebar-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-menu h3 {
    margin-bottom: 12px;
}
/* ============================================================
   SIDEBAR AVANZADO
   ============================================================ */

.sidebar-advanced {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Usuario */
.sidebar-avatar {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    border: 3px solid #80a3ff;
    object-fit: cover;
}

.msn-status {
    font-size: 14px;
    color: #475569;
}

.msn-status-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.status-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.status-btn.online { background: #34d399; }
.status-btn.away { background: #facc15; }
.status-btn.busy { background: #f87171; }

/* Crear sala */
.btn-create-room {
    background: var(--primary);
    color: white;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
}
.btn-create-room:hover {
    background: var(--primary-hover);
}

/* Listas */
.side-list {
    list-style: none;
    padding: 0;
}
.side-list li {
    padding: 8px 4px;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.side-list li a {
    text-decoration: none;
    color: var(--text);
}

/* Anuncios */
#sidebar-news {
    font-size: 14px;
    color: #475569;
}
/* ============================================================
   HERO / TITULOS / STATS INDEX V2
   ============================================================ */

.hero-banner {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 20px;
}

.hero-main h1 {
    font-size: 24px;
    margin-bottom: 6px;
}
.hero-main h1 span {
    color: var(--primary);
}
.hero-text {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}
.hero-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.hero-note {
    font-size: 12px;
    color: var(--muted);
}

.hero-side h3 {
    margin-bottom: 10px;
}
.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hero-stat {
    background: #e5edff;
    border-radius: 10px;
    padding: 10px 12px;
}
.hero-stat-number {
    font-size: 20px;
    font-weight: 700;
}

/* Títulos de sección */
.section-title {
    font-size: 18px;
    margin: 12px 0 10px;
    color: #0f172a;
}

/* Stats rápidas */
.stats-card {
    display: flex;
    flex-direction: column;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.stat-number {
    font-size: 20px;
    font-weight: 700;
}

/* Actividad reciente */
.activity-feed p {
    font-size: 14px;
    margin-bottom: 4px;
}
/* ============================================================
   MODO OSCURO
   ============================================================ */

:root[data-theme='dark'] {
    --bg: #020617;
    --card-bg: #020617;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --shadow: 0 8px 24px rgba(0,0,0,0.7);
}

:root[data-theme='dark'] body {
    background: var(--bg);
    color: var(--text);
}

:root[data-theme='dark'] .top-nav {
    background: #020617;
}

:root[data-theme='dark'] .card,
:root[data-theme='dark'] .box,
:root[data-theme='dark'] .hero-banner {
    background: #020617;
    border: 1px solid #111827;
}

:root[data-theme='dark'] .section-title {
    color: #e5e7eb;
}

:root[data-theme='dark'] .simple-list li,
:root[data-theme='dark'] .side-list li {
    border-bottom-color: #1e293b;
}

:root[data-theme='dark'] .hero-stat {
    background: #0b1120;
}

:root[data-theme='dark'] .sidebar-avatar {
    border-color: #38bdf8;
}
/* Animaciones y hover bonitos */
.card,
.box,
.room-card {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
}

.card:hover,
.box:hover,
.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
}

/* Sidebar más limpio */
.sidebar-advanced .sidebar-section h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.sidebar-advanced .sidebar-section {
    padding-top: 14px;
    padding-bottom: 14px;
}
/* =======================================================
   PERFIL
   ======================================================= */

.profile-box {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    padding: 25px;
    align-items: center;
}

.profile-avatar {
    width: 180px;
    height: 180px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.profile-left {
    text-align: center;
}

.profile-right h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

#activity-list p {
    margin: 6px 0;
}
/* =======================================================
   ROOMS GRID V2
   ======================================================= */

.layout-rooms {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    padding: 20px;
}

.rooms-sidebar {
    padding: 15px;
}

.category-list li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.category-list li:hover {
    background: #e2e8f0;
}

.category-list li.active {
    background: var(--primary);
    color: white;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.room-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform .15s;
}

.room-card:hover {
    transform: translateY(-4px);
}

.room-icon {
    width: 60px;
    margin-bottom: 10px;
}

.room-category {
    font-size: 14px;
    color: var(--muted);
}

.room-online {
    margin: 8px 0;
    font-size: 13px;
    color: var(--primary);
}

/* Dark mode */
:root[data-theme='dark'] .rooms-sidebar {
    background: #0f172a;
}

:root[data-theme='dark'] .category-list li:hover {
    background: #1e293b;
}

:root[data-theme='dark'] .category-list li.active {
    background: #38bdf8;
}

:root[data-theme='dark'] .room-card {
    background: #0f172a;
    border: 1px solid #1e293b;
}
/* =======================================================
   ADMIN PANEL V2
======================================================= */

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    padding: 20px;
}

.admin-sidebar {
    padding: 15px;
}

.admin-menu li {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background .15s;
}
.admin-menu li:hover {
    background: #e2e8f0;
}
.admin-menu li.active {
    background: var(--primary);
    color: white;
}

.admin-content {
    padding: 10px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
}

.admin-stat {
    text-align: center;
    padding: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th,
.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.admin-table tr:hover {
    background: #f1f5f9;
}

/* Dark mode */
:root[data-theme='dark'] .admin-sidebar {
    background: #0f172a;
}
:root[data-theme='dark'] .admin-menu li:hover {
    background: #1e293b;
}
:root[data-theme='dark'] .admin-menu li.active {
    background: #38bdf8;
}
:root[data-theme='dark'] .admin-table tr:hover {
    background: #1e293b;
}

/* =========================================================
   SHATEROS 2.0 — CHAT A1-G (MIDDLE)
   ========================================================= */

.chat-layout {
    width: 100%;
    max-width: 1350px;
    height: calc(100vh - 80px);
    margin: auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    padding: 20px;
}

/* SIDEBAR */
.chat-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#users-list {
    margin-top: 10px;
    flex: 1;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}
.user-item:hover {
    background: rgba(0,0,0,0.05);
}
:root[data-theme="dark"] .user-item:hover {
    background: rgba(255,255,255,0.05);
}

.user-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

/* CHAT WINDOW */
.chat-window {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-area {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
}

/* MENSAJES */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.message img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.msg-bubble {
    background: #e2e8f0;
    padding: 12px 16px;
    max-width: 62%;
    border-radius: 14px;
    font-size: 15px;
    color: #1e293b;
}
.msg-me {
    flex-direction: row-reverse;
}
.msg-me .msg-bubble {
    background: var(--primary);
    color: white !important;
}

:root[data-theme="dark"] .msg-bubble {
    background: #1e293b;
    color: #e2e8f0;
}
:root[data-theme="dark"] .msg-me .msg-bubble {
    background: #38bdf8;
    color: #0f172a !important;
}

/* INPUT */
.chat-input-area {
    padding: 18px;
    border-top: 1px solid #cbd5e1;
    background: var(--card-bg);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    background: var(--input-bg);
    color: var(--text);
}

.send-btn {
    padding: 12px 16px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
}

/* MENÚ FLOTANTE */
.user-menu {
    position: absolute;
    display: none;
    min-width: 200px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 12px;
    border-radius: 12px;
    z-index: 999;
}

.user-menu-header {
    font-weight: 600;
    margin-bottom: 6px;
}

.user-menu button {
    width: 100%;
    padding: 8px;
    text-align: left;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
}

.user-menu button:hover {
    background: rgba(0,0,0,0.05);
}

:root[data-theme="dark"] .user-menu button:hover {
    background: rgba(255,255,255,0.05);
}
/* ==========================================================
   CHAT – Layout grande A1-G (solo para la pantalla de chat)
   ========================================================== */

.chat-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 32px 32px;
}

/* Contenedor general (sidebar + chat) */
.chat-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sidebar izquierda */
.chat-sidebar {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    padding: 16px 18px;
    min-height: 520px;
}

/* Panel de chat (derecha) */
.chat-panel {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

/* Contenedor de mensajes */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px 6px;
}

/* Área de input fija abajo */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* Mensaje propio / ajeno (solo estilos base) */
.chat-message {
    max-width: 82%;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.me {
    margin-left: auto;
    background: #2563eb;
    color: #ffffff;
}

.chat-message.other {
    margin-right: auto;
    background: #f1f5f9;
    color: #0f172a;
}

/* Tema claro por defecto para el fondo del área central */
.chat-panel-bg {
    background: #f3f4fb;
}

/* Responsive */
@media (max-width: 900px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
    .chat-sidebar {
        order: 2;
    }
    .chat-panel {
        order: 1;
    }
}
