﻿/* =========================
   VARIABLES
========================= */

:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --bg: rgb(23,23,32);
    --card-bg: rgba(255,255,255,0.05);
    --radius: 14px;
    --shadow: 0 10px 40px rgba(0,0,0,0.7);
    --border: 1px solid rgba(255,255,255,0.08);
}

/* =========================
   RESET
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* =========================
   LAYOUT
========================= */

.layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    color: white;
}

/* =========================
   HEADER (OPCIONAL)
========================= */

.topbar {
    position: sticky;
    top: 0;
    height: var(--header-height);
    width: 100%;
    background: rgba(23,23,32,0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: var(--border);
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* =========================
   CONTENT
========================= */

.content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: clamp(16px, 3vw, 30px);
}

/* =========================
   HEADER INTERNO
========================= */

.page-header {
    margin-bottom: 20px;
}

.title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 600;
    margin-top: 30px;
    text-align: center;
    
}

.welcome {
    margin-top: 20px;
    font-size: 20px; /* 🔥 más grande */
    font-weight: 500; /* 🔥 más legible */
    opacity: 0.85; /* 🔥 más visible */
    text-align: center;
}

/* =========================
   GRID
========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top:50px;
}

/* =========================
   CARDS
========================= */

.card {
    background: var(--card-bg);
    padding: clamp(16px, 2vw, 24px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    border: var(--border);
    width: 100%;
    min-width: 0;
    transition: .25s;
}

    .card:hover {
        transform: translateY(-4px);
    }

/* =========================
   CARD HEADER
========================= */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================
   INPUT
========================= */

.date-mini {
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
}

/* =========================
   TEXTO
========================= */

.big {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

p {
    word-break: break-word;
}

/* =========================
   CHART
========================= */

.chart-container {
    width: 100%;
    height: 200px;
}

/* =========================
   METRICAS
========================= */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.metric {
    padding: 14px;
    border-radius: var(--radius);
}

/* =========================
   USUARIOS (NUEVO)
========================= */

.usuarios-card {
    min-height: 100%;
}

.usuarios-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.usuario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}

.usuario-info {
    display: flex;
    flex-direction: column;
}

.estado {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

    .estado.activo {
        background: rgba(0,255,150,0.2);
        color: #00ffa0;
    }

    .estado.inactivo {
        background: rgba(255,0,0,0.2);
        color: #ff5c5c;
    }

.empty {
    opacity: 0.6;
}

/* =========================
   USUARIOS
========================= */

.usuario-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    transition: 0.3s;
}

    .usuario-item:hover {
        background: rgba(255,255,255,0.05);
    }

/* 🔥 AVATAR CIRCULAR */
.usuario-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #808080;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* INFO */
.usuario-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

    .usuario-info span {
        font-size: 12px;
        opacity: 0.7;
    }

/* =========================
   🔥 ESTADO FINAL (SUAVE)
========================= */

.estado {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

    /* 🟢 ACTIVO */
    .estado.activo {
        background: rgba(0, 255, 150, 0.15);
        color: #00ffa0;
        border: 1px solid rgba(0,255,150,0.4);
    }

    /* 🔴 DESCONECTADO */
    .estado.inactivo {
        background: rgba(255, 0, 0, 0.15);
        color: #ff4d4d;
        border: 1px solid rgba(255,0,0,0.4);
    }

    /* 🔥 PUNTO TIPO WHATSAPP */
    .estado.activo::before {
        content: "● ";
        color: #00ffa0;
    }

    .estado.inactivo::before {
        content: "● ";
        color: #ff4d4d;
    }

/* =========================
   TABLET
========================= */

@media (max-width: 1024px) {

    .sidebar {
        width: 220px;
    }
}

/* =========================
   MOVIL PRO
========================= */

@media (max-width: 768px) {

    .layout {
        flex-direction: row;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform .3s ease;
        z-index: 9999;
        background: var(--bg);
    }

        .sidebar.collapsed {
            transform: translateX(0);
        }

    .content {
        padding-top: var(--header-height);
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-header {
        margin-top: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .metrics {
        grid-template-columns: 1fr 1fr;
    }

    .card {
        margin-bottom: 12px;
    }
}

/* =========================
   CELULAR PEQUEÑO
========================= */

@media (max-width: 480px) {

    .metrics {
        grid-template-columns: 1fr;
    }

    .title {
        font-size: 18px;
    }
}
