/**
 * Estilos del panel de administración
 * Sistema de Supermercados y Tiendas V3.0
 */

/* Layout del panel admin */
.admin-page {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar content";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 70px 1fr;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.admin-header {
    grid-area: header;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    display: block;
    font-size: 12px;
    color: var(--color-text-light);
    text-transform: capitalize;
}

.logout-btn {
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
}

/* Sidebar */
.admin-sidebar {
    grid-area: sidebar;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav {
    margin-bottom: 2rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item a:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-item.active a {
    background-color: var(--color-primary);
    border-left: 4px solid white;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 0 25px;
}

/* Contenido principal */
.admin-content {
    grid-area: content;
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h1 {
    margin-bottom: 0;
}

/* Tarjetas de estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.1);
}

.stat-primary .stat-icon { background-color: rgba(33, 150, 243, 0.1); }
.stat-success .stat-icon { background-color: rgba(76, 175, 80, 0.1); }
.stat-info .stat-icon { background-color: rgba(0, 188, 212, 0.1); }
.stat-warning .stat-icon { background-color: rgba(255, 152, 0, 0.1); }

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: var(--color-primary);
}

.stat-info p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 14px;
}

/* Tarjetas */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-border);
}

.card-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.card-body {
    padding: 25px;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.big-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-primary);
    padding: 20px 0;
}

/* Gráficos */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.chart-card canvas {
    max-height: 300px;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: var(--color-light);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    color: var(--color-dark);
}

.data-table tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.05);
}

.actions-cell {
    display: flex;
    gap: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Filtros */
.filters-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
}

/* Login de admin */
.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.admin-login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.admin-login-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.admin-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    color: #2c3e50;
}

.admin-login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.admin-login-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

/* Modal grande */
.modal-lg {
    max-width: 800px;
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-page {
        grid-template-columns: 200px 1fr;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-page {
        grid-template-areas:
            "header"
            "content";
        grid-template-columns: 1fr;
        grid-template-rows: 70px 1fr;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -250px;
        top: 70px;
        bottom: 0;
        width: 250px;
        z-index: 99;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.active {
        left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .cards-row {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        display: none;
    }
}
