/* /css/admin_styles.css (Versión Mejorada) */

/* --- ESTRUCTURA GENERAL --- */
.container {
    max-width: 1000px; /* Un ancho un poco mayor para las tablas */
    margin: 20px auto;
    padding: 20px;
}

.container-form { /* Un contenedor más angosto para formularios */
    max-width: 600px;
}

h1, h2, h3 {
    color: #333;
    text-align: center;
}
hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* --- FORMULARIOS --- */
form { 
    display: flex; 
    flex-direction: column;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
label { 
    margin-top: 15px; 
    margin-bottom: 5px;
    font-weight: bold; 
    color: #333; 
    text-align: left;
}
input[type="text"],
input[type="number"],
textarea,
input[type="file"] { 
    width: 100%;
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-size: 1em;
    box-sizing: border-box; /* Importante para que el padding no afecte el ancho */
}
input[type="file"] {
    padding: 8px;
}
.imagen-actual { 
    max-width: 150px; 
    height: auto; 
    display: block; 
    border: 1px solid #ddd; 
    padding: 5px; 
    border-radius: 4px;
    margin: 5px 0 15px 0;
}


/* --- TABLAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* Para que el borde redondeado funcione */
}
th, td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}
th {
    background-color: #f8f9fa;
}
td.acciones {
    white-space: nowrap; /* Evita que los botones se partan en dos líneas */
    width: 1%;
}


/* --- BOTONES Y ENLACES --- */
.btn {
    padding: 10px 15px;
    margin-right: 5px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    color: white;
    text-align: center;
}
.btn-primary { background-color: #007bff; }
.btn-success { background-color: #28a745; }
.btn-warning { background-color: #ffc107; color: #212529; }
.btn-danger { background-color: #dc3545; }
.btn-info { background-color: #17a2b8; }
.btn-secondary { background-color: #6c757d; }

.form-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- ESTADOS Y BADGES --- */
.estado-habilitado { color: #28a745; font-weight: bold; }
.estado-inhabilitado { color: #dc3545; font-weight: bold; }


/* --- LAYOUTS ESPECÍFICOS --- */
.grid-container {
    display: grid;
    grid-template-columns: 1fr; /* Una columna en móviles */
    gap: 30px;
}
/* En pantallas más grandes, dos columnas */
@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* --- Estilos de Estado de Venta --- */
.estado-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    color: white;
    text-align: center;
    min-width: 85px;
    
}
.estado-badge.entregado {
    background-color: #007bff; /* Azul */
}
.estado-badge.pagada {
    background-color: #b86b5b; /* Verde */
}

.estado-badge.pendiente {
    background-color: #ffc107; /* Amarillo */
    color: #333;
}

.estado-badge.cancelada {
    background-color: #dc3545; /* Rojo */
}
.seccion {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.estado-badge.en_preparacion {
    background-color: #6f42c1; /* Púrpura */
}
.calculadora p { margin: 10px 0; }
.calculadora strong { font-size: 1.2em; }

/* --- INICIO DE MEJORA: TABLA RESPONSIVA PARA ENTREGAS --- */

/* Ocultamos los encabezados de la tabla en móvil */
@media screen and (max-width: 768px) {
    .tabla-entregas thead {
        display: none;
    }

    .tabla-entregas, .tabla-entregas tbody, .tabla-entregas tr, .tabla-entregas td {
        display: block;
        width: 100%;
    }

    .tabla-entregas tr {
        background-color: #fff;
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        box-sizing: border-box;
    }

    .tabla-entregas td {
        padding: 10px 5px;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
    }
    
    .tabla-entregas td:last-child {
        border-bottom: none;
    }

    /* Usamos el pseudo-elemento ::before para añadir las etiquetas */
    .tabla-entregas td::before {
        content: attr(data-label); /* El texto vendrá del atributo data-label */
        font-weight: bold;
        margin-right: 15px;
    }

    .tabla-entregas .acciones {
        justify-content: center;
        padding-top: 15px;
    }
}
/* --- FIN DE MEJORA --- */

/* --- INICIO DE ESTILOS PARA NOTIFICACIONES --- */

.notification-wrapper {
    position: relative;
    margin-right: 20px; /* Espacio entre la campana y el nombre de usuario */
}

.notification-bell {
    font-size: 1.3em; /* Un poco más grande para que destaque */
    color: #ecf0f1;   /* Mismo color que el texto del navbar */
    text-decoration: none;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #e74c3c; /* Rojo para las notificaciones */
    color: white;
    font-size: 11px;
    font-weight: bold;
    display: none; /* Oculto por defecto, se muestra con JS */
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary-color); /* Borde del color del navbar */
}

.dropdown-menu-notif {
    display: none; /* Oculto por defecto */
    position: absolute;
    right: 0;
    top: 150%; /* Lo posicionamos un poco más abajo del navbar */
    background-color: white;
    min-width: 340px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001; /* Aseguramos que esté por encima de otros elementos */
    border-radius: 8px;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* Clase que se añade con JS para mostrar/ocultar */
.notification-wrapper.show .dropdown-menu-notif {
    display: block; 
}

.dropdown-menu-notif .dropdown-header {
    padding: 10px 15px;
    font-weight: bold;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    color: #333;
}

.dropdown-menu-notif .dropdown-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #e9ecef;
    white-space: normal; /* Permite que el texto salte de línea */
}

.dropdown-menu-notif .dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-menu-notif .dropdown-item:hover {
    background-color: #f1f1f1;
}

.dropdown-menu-notif .dropdown-item .text-muted {
    font-size: 0.8em;
    color: #6c757d !important;
}

.dropdown-item i {
    margin-right: 8px;
    color: var(--accent-color);
}
/* --- FIN DE ESTILOS PARA NOTIFICACIONES --- */