body {
    font-family: 'Segoe UI', sans-serif;
    background: #f1f3f5;
    height: 100vh;
    margin: 0;
    align-items: initial !important;
}

/* Header principal de navegación */
.main-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
    text-decoration: none;
    color: white;
}

.logo-img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 20px;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    color: white;
}

.nav-link.logout {
    background: rgba(220, 53, 69, 0.8);
}

.nav-link.logout:hover {
    background: rgba(220, 53, 69, 1);
}

.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive para header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
    }
    
    .main-nav {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }
    
    .user-info {
        align-items: center;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}

.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 350px;
}

h2 {
    text-align: center;
    color: #007bff;
    margin-bottom: 30px;
}

form input {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

form button {
    width: 100%;
    background-color: #007bff;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #0056b3;
}

/* Fix para prevenir align-items: center heredado */
form, form input, form select, form button {
    align-items: initial !important;
}

.producto-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.producto-item input {
    flex: 1;
}

.borrar-producto {
    cursor: pointer;
    font-size: 20px;
    color: #dc3545;
    transition: color 0.2s;
}

.borrar-producto:hover {
    color: #a71d2a;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: #f1f3f5;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}


.user-header-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #dfdfdf;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.user-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 5px;
}

.user-links a:hover {
    text-decoration: underline;
}


.caja-panel {
    max-width: 1150px;
    width: 95%;
    padding: 40px;
    font-size: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

th, td {
    border: 1px solid #dee2e6;
    padding: 12px 10px;
    vertical-align: top;
}

th {
    background-color: #007bff;
    color: white;
    text-align: left;
}

ul {
    margin: 0;
    padding-left: 20px;
}

button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

@media screen and (max-width: 768px) {

    body {
        font-size: 15px;
        padding: 10px;
    }

    .login-box, .caja-panel {
        padding: 20px 10px;
        width: 100%;
    }

    .filtros-labels, .filtros-campos {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filtro-label, .filtro-campo {
        min-width: 100%;
    }

    .botonera {
        flex-direction: column;
        gap: 10px;
    }

    .botonera button,
    .botonera a {
        width: 100%;
        font-size: 16px;
        height: 48px;
    }

    table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 10px;
        white-space: nowrap;
    }

    input, select {
        font-size: 16px;
        height: 44px;
    }

    .user-header-vertical {
        flex-direction: column;
        gap: 5px;
        font-size: 15px;
    }

}

/* Estilos para mensajes de alerta */
.alert-mensaje {
    margin-bottom: 20px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: bold;
    border: 1px solid transparent;
}

.alert.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert.warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert.info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Notificaciones administrativas */
.notificaciones-container {
    margin-bottom: 20px;
}

.notificacion {
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    animation: slideInDown 0.5s ease-out;
    border-left: 4px solid;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notificacion-content {
    padding: 15px 40px 15px 15px;
}

.notificacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notificacion-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notificacion-prioridad {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    color: white;
}

.notificacion-mensaje {
    margin: 10px 0;
    line-height: 1.5;
}

.notificacion-footer {
    margin-top: 10px;
    opacity: 0.8;
    font-style: italic;
}

.notificacion-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(0,0,0,0.5);
    transition: color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notificacion-close:hover {
    color: rgba(0,0,0,0.8);
    background: rgba(255,255,255,0.2);
}

/* Tipos de notificaciones */
.notificacion-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left-color: #2196f3;
    color: #0d47a1;
}

.notificacion-warning {
    background: linear-gradient(135deg, #fff3e0, #ffcc02);
    border-left-color: #ff9800;
    color: #e65100;
}

.notificacion-success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left-color: #4caf50;
    color: #1b5e20;
}

.notificacion-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-left-color: #f44336;
    color: #b71c1c;
}

.notificacion-maintenance {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-left-color: #9c27b0;
    color: #4a148c;
}

/* Prioridades especiales */
.notificacion[data-prioridad="4"] {
    border: 2px solid #dc3545;
    animation: pulse 2s infinite;
}

.notificacion[data-prioridad="3"] {
    border: 2px solid #ff9800;
}

@keyframes pulse {
    0% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3); }
    100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
}

/* Responsive */
@media (max-width: 768px) {
    .notificacion-content {
        padding: 12px 35px 12px 12px;
    }
    
    .notificacion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .notificacion-titulo {
        font-size: 1rem;
    }
    
    .notificacion-close {
        top: 8px;
        right: 10px;
        font-size: 1.3rem;
    }
}

/* Animación para ocultar mensajes */
.alert.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}
