/* Eliminar padding del main-content para esta página */
.main-content:has(.home-page) {
    padding: 0 !important;
}

/* Home Page Styles */
.home-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 95px);
    width: 100%;
    gap: 2.5rem;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Welcome Header - Contiene mensaje y logo en la misma fila */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 0.25rem;
    flex: 0 0 auto;
    gap: 1.5rem;
    position: relative;
}

/* Welcome Message */
.welcome-message {
    text-align: left;
    flex: 0 0 auto;
}

.welcome-message h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}

    .welcome-message h1 .greeting {
        color: #ffffff;
    }

.light-mode .welcome-message h1 .greeting,
:root.light-mode .welcome-message h1 .greeting {
    color: #000000;
}

.welcome-message h1 .username {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard Container */
.dashboard-container {
    padding: 0 2rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Section Titles */
.section-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #F07400, #00b4ff) 1;
}

/* Section Title with Icon */
.section-title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-icon-container {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .section-icon-container svg {
        stroke: white;
        width: 24px;
        height: 24px;
    }

.section-title-with-icon .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex: 1;
}

/* Quick Access Section */
.quick-access-section {
    width: 100%;
    overflow: visible;
}

.quick-access-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.access-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

/* Modo claro - fondo gris para el widget */
:root.light-mode .access-card {
    background: #d9d9d9;
}

.light-mode .access-card {
    background: #d9d9d9;
}

.access-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(240, 116, 0, 0.2);
}

.card-header {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    padding: 0.45rem 0.85rem;
}

    .card-header h3 {
        color: white;
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .card-header svg {
        stroke: white !important;
    }

.stat-count {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 700;
    color: white !important;
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.card-link {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem !important;
    background: var(--input-bg);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    text-indent: 0 !important;
    position: relative;
    left: 0 !important;
    transform: none;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}

/* Modo claro - fondo blanco para los items */
:root.light-mode .card-link {
    background: #ffffff;
    border-color: #e0e0e0;
}

.light-mode .card-link {
    background: #ffffff;
    border-color: #e0e0e0;
}

.card-link:hover {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.1), rgba(0, 180, 255, 0.1));
    border-color: #F07400;
    color: var(--text-primary);
    transform: none !important;
    left: 0 !important;
}

/* Modo claro - efecto hover más visible */
:root.light-mode .card-link:hover {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.15), rgba(0, 180, 255, 0.15));
    border-color: #F07400;
}

.light-mode .card-link:hover {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.15), rgba(0, 180, 255, 0.15));
    border-color: #F07400;
}

.card-link svg {
    flex-shrink: 0;
    stroke: #F07400;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.card-link span {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

/* Statistics Section */
.statistics-section {
    width: 100%;
}

.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Modo claro - fondo gris para el widget */
:root.light-mode .stat-card {
    background: #d9d9d9;
}

.light-mode .stat-card {
    background: #d9d9d9;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 180, 255, 0.2);
}

.stat-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .stat-icon svg {
        stroke: white;
        width: 24px;
        height: 24px;
    }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .stat-info h3 {
        color: var(--text-primary);
        font-size: 0.95rem;
        font-weight: 600;
        margin: 0 0 0.4rem 0;
    }

.user-count {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    max-height: 300px;
}

/* El scrollbar usa el estilo global definido en app.css */

.user-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--input-bg);
    border-radius: 5px;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
}

.user-status {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-badge .user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.user-separator {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-location {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.user-timestamp {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .quick-access-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .welcome-header {
        padding: 0.75rem 1.5rem 0.4rem;
        gap: 1rem;
    }

    .welcome-message h1 {
        font-size: 1.3rem;
    }

    .dashboard-container {
        padding: 0.75rem 1.5rem 1.25rem;
        gap: 1rem;
    }

    .section-icon-container {
        width: 36px;
        height: 36px;
    }

        .section-icon-container svg {
            width: 20px;
            height: 20px;
        }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .quick-access-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 0.875rem;
    }

    .stat-icon {
        margin: 0 auto;
    }

    /* Ajustar user-list para responsive */
    .user-list {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .welcome-header {
        padding: 0.6rem 1rem 0.3rem;
        gap: 0.75rem;
    }

    .welcome-message h1 {
        font-size: 1.2rem;
    }

    .dashboard-container {
        padding: 0.6rem 1rem 1rem;
    }

    .section-icon-container {
        width: 32px;
        height: 32px;
    }

        .section-icon-container svg {
            width: 18px;
            height: 18px;
        }

    .section-title {
        font-size: 1rem;
    }

    .card-header h3 {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    .card-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .user-count {
        font-size: 1.3rem;
    }

    .user-badge {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ========================================================================== */
/* ESTILOS PARA CARD DE TABULACIÓN                                          */
/* ========================================================================== */

/* Icono especial para tabulación con gradiente diferente */
.stat-icon-tabulacion {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
}

/* Lista de usuarios en tabulación */
.tabulacion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: 300px;
}

/* Tarjeta de cada usuario en tabulación */
.tabulacion-user-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* Modo claro - fondo blanco para las tarjetas */
:root.light-mode .tabulacion-user-card {
    background: #ffffff;
    border-color: #e0e0e0;
}

.light-mode .tabulacion-user-card {
    background: #ffffff;
    border-color: #e0e0e0;
}

.tabulacion-user-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

/* Header con avatar e info */
.tabulacion-user-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Avatar circular con iniciales */
.tabulacion-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .tabulacion-user-avatar span {
        color: white;
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
    }

/* Info del usuario */
.tabulacion-user-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tabulacion-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.tabulacion-separator {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tabulacion-user-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tabulacion-timestamp {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Contenedor de progreso */
.tabulacion-progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Barra de progreso */
.tabulacion-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* Modo claro - fondo de la barra más oscuro */
:root.light-mode .tabulacion-progress-bar {
    background: #e0e0e0;
}

.light-mode .tabulacion-progress-bar {
    background: #e0e0e0;
}

/* Relleno de la barra (animado) */
.tabulacion-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

    /* Efecto de brillo animado en la barra */
    .tabulacion-progress-fill::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: shimmer 2s infinite;
    }

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Texto del porcentaje */
.tabulacion-progress-text {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 45px;
    text-align: right;
}

/* Mensaje cuando no hay usuarios */
.tabulacion-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

    .tabulacion-empty p {
        margin: 0;
        font-size: 0.9rem;
    }

/* Responsive para tabulación */
@media (max-width: 768px) {
    .tabulacion-list {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .tabulacion-user-card {
        padding: 0.6rem 0.7rem;
        gap: 0.5rem;
    }

    .tabulacion-user-avatar {
        width: 35px;
        height: 35px;
    }

        .tabulacion-user-avatar span {
            font-size: 0.75rem;
        }

    .tabulacion-user-name {
        font-size: 0.85rem;
    }

    .tabulacion-user-meta {
        font-size: 0.7rem;
    }

    .tabulacion-progress-bar {
        height: 6px;
    }

    .tabulacion-progress-text {
        font-size: 0.8rem;
        min-width: 40px;
    }
}