/* 
 * Estilos para Panel de Administración
 * Planos de Muebles de Melamina
 * Creado por MiniMax Agent
 */

/* Variables CSS */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --success-color: #00b894;
    --danger-color: #e17055;
    --warning-color: #fdcb6e;
    --info-color: #74b9ff;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #2d3436;
    overflow-x: hidden;
}

/* Contenedor principal del admin */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #5a4fcf 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-header i {
    color: var(--warning-color);
    margin-right: 0.5rem;
}

/* Menú lateral */
.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu .menu-item {
    margin: 0.25rem 0;
}

.sidebar-menu .menu-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu .menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--warning-color);
}

.sidebar-menu .menu-item.active a {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--warning-color);
}

.sidebar-menu .menu-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

/* Footer del sidebar */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.user-info i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--warning-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.logout-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-btn i {
    margin-right: 0.5rem;
}

/* Contenido principal */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    background-color: #f5f6fa;
    min-height: 100vh;
}

/* Header del admin */
.admin-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e1e8ed;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.header-left i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Contenido del admin */
.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Tarjetas de estadísticas */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stat-content p {
    margin: 0.25rem 0 0;
    color: #636e72;
    font-weight: 500;
}

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

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.card-header i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Lista de productos recientes */
.producto-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.producto-item:last-child {
    border-bottom: none;
}

.producto-imagen {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    object-fit: cover;
    margin-right: 1rem;
    background-color: #f8f9fa;
}

.producto-info {
    flex: 1;
}

.producto-info h6 {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.producto-info p {
    margin: 0;
    color: #636e72;
    font-size: 0.875rem;
}

.producto-precio {
    font-weight: 600;
    color: var(--success-color);
}

/* Acciones rápidas */
.quick-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Estado del sistema */
.system-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-label {
    font-weight: 500;
    color: var(--dark-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #636e72;
}

.status-indicator.online {
    color: var(--success-color);
}

.status-indicator i {
    color: var(--success-color);
}

/* Botones personalizados */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a4fcf 100%);
    border: none;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Formularios */
.form-control {
    border: 1px solid #dfe6e9;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.25);
}

.form-select {
    border: 1px solid #dfe6e9;
    border-radius: var(--border-radius);
    padding: 0.75rem;
}

/* Progreso de subida */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #f1f3f4;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 9999;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-header {
        padding: 0 1rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Toast notifications */
.toast {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.toast-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

/* Loading spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utilidades */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-light { background-color: #f8f9fa !important; }
.border-light { border-color: #dee2e6 !important; }

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        margin-right: 1rem;
    }
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
    }
}