/* FUENTE Y ESTILO BASE */
:root {
    --sidebar-width: 260px;
    --primary-color: #0d6efd;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-gray);
    color: #212529;
}

/* ESTRUCTURA PRINCIPAL CON SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #111827; /* Un azul oscuro moderno */
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
}

.main-content-full {
    padding: 2rem;
}

/* ENCABEZADO Y PIE DEL SIDEBAR */
.sidebar-header {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #374151;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

/* NAVEGACIÓN DEL SIDEBAR */
.sidebar .nav-link {
    color: #d1d5db;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: #374151;
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* AVATARES */
.avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-weight: 500;
}
.avatar-eliceo { background: linear-gradient(45deg, #0d6efd, #0dcaf0); }
.avatar-yelenis { background: linear-gradient(45deg, #d63384, #fd7e14); }

/* TARJETAS DE ESTADÍSTICAS */
.stat-card {
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.stat-card h3 { font-size: 2.25rem; font-weight: 700; }
.stat-card p { font-size: 1rem; opacity: 0.9; }

.bg-stat-pedidos { background: linear-gradient(45deg, #007bff, #0056b3); }
.bg-stat-ingresos { background: linear-gradient(45deg, #28a745, #1e7e34); }
.bg-stat-generic { background: linear-gradient(45deg, #6c757d, #495057); }

/* ESTILOS PARA PANTALLA DE LOGIN */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}
.user-card .avatar {
    width: 80px; height: 80px; font-size: 2.5rem; margin-bottom: 1rem;
}

/* RESPONSIVE: AJUSTES PARA MÓVILES */
@media (max-width: 991.98px) {
    .sidebar {
        /* Para móviles, el sidebar se convierte en un offcanvas */
        width: 100%;
        height: 100%;
        position: fixed;
        transform: translateX(-100%);
        transition: transform .3s ease-in-out;
        z-index: 1045;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    /* Estilos para el offcanvas de Bootstrap */
    .offcanvas-start {
        width: var(--sidebar-width) !important;
    }
}
/*
 * =========================================
 * MEJORAS VISUALES PARA MODO RESPONSIVO
 * =========================================
 */

@media (max-width: 767.98px) {

  /* Hacemos el contenido principal menos espaciado en móviles */
  .main-content {
    padding: 1rem;
  }
  
  /* Reducimos el tamaño de los números en las tarjetas de estadísticas */
  .stat-card h3 {
    font-size: 2rem;
  }
  
  /* Reducimos el texto de la descripción de las tarjetas */
  .stat-card p {
    font-size: 0.9rem;
  }
  
}
/*
 * --- Transformación de Tabla a Tarjetas en Móviles ---
 */
@media (max-width: 991.98px) {

  /* Ocultamos los encabezados de la tabla tradicional */
  .table-responsive thead {
    display: none;
  }

  /* Hacemos que cada fila (tr) se vea como una tarjeta */
  .table-responsive tr {
    display: block;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  
  /* Hacemos que cada celda (td) se apile verticalmente */
  .table-responsive td {
    display: flex; /* Usamos flex para alinear etiqueta y contenido */
    justify-content: space-between; /* Espacio entre etiqueta y contenido */
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f0f0f0; /* Línea separadora sutil */
    text-align: right; /* Alineamos el contenido a la derecha */
  }

  .table-responsive td:last-child {
    border-bottom: none; /* Quitamos la línea de la última celda */
  }

  /* La magia: Añadimos las etiquetas de columna antes de cada celda */
  .table-responsive td::before {
    content: attr(data-label); /* Obtenemos el texto del atributo 'data-label' */
    font-weight: 600;
    text-align: left;
    margin-right: 1rem; /* Espacio entre la etiqueta y el valor */
  }
  
  /* Estilos especiales para la celda de acciones */
  .table-responsive td[data-label="Acciones"] {
    justify-content: center; /* Centramos los botones de acción */
    padding-top: 1rem;
  }
  .table-responsive td[data-label="Acciones"]::before {
     display: none; /* Ocultamos la etiqueta "Acciones:" */
  }
}