/* Reset and Base Styles */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #fcfbf8; /* Tono beige muy suave y cálido */
    color: #333333;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Sobreescribir las clases oscuras de Bootstrap usadas en el HTML */
.text-white {
    color: #333333 !important;
}

.opacity-75 {
    color: #666666 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #B71234 !important; /* Rojo corporativo similar a Salesians */
}

/* Eliminar el fondo oscuro animado */
.background-animation {
    display: none;
}

/* Tarjetas (Antes Glassmorphism, ahora limpias y blancas) */
.glass-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Formularios e Inputs */
.form-label {
    font-weight: bold;
    color: #555555;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    color: #333333;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: #B71234;
    color: #333333;
    box-shadow: 0 0 0 3px rgba(183, 18, 52, 0.15);
}

.form-control::placeholder {
    color: #999999;
}

.form-select option {
    background-color: #ffffff;
    color: #333333;
}

/* Botones Principales */
.btn-primary {
    background-color: #B71234 !important;
    border: 1px solid #B71234 !important;
    border-radius: 4px;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #8a0d26 !important;
    border-color: #8a0d26 !important;
    transform: translateY(-1px);
}

.btn-glow::after {
    display: none; /* Eliminar efecto neón */
}

/* Botones Secundarios (Enlaces clases) */
.btn-outline-light {
    color: #555555 !important;
    border-color: #cccccc !important;
    background-color: #f9f9f9 !important;
    border-radius: 4px !important;
}

.btn-outline-light:hover {
    color: #B71234 !important;
    border-color: #B71234 !important;
    background-color: #fff5f5 !important;
}

/* Textos destacados */
.text-primary-emphasis {
    color: #B71234 !important;
}

/* Tarjetas de Materiales (Vistas JS) */
.material-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease forwards;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.material-item:hover {
    background: #fafafa;
    border-color: #B71234;
}

/* Badges y Etiquetas */
.badge-clase, .bg-primary {
    background-color: #B71234 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 3px !important;
}

.badge-categoria, .bg-info, .bg-secondary {
    background-color: #f0f0f0 !important;
    color: #555555 !important;
    border: 1px solid #cccccc !important;
    border-radius: 3px !important;
}

.bg-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
}

.item-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #B71234; /* Títulos de los ítems en rojo corporativo */
    margin-top: 0.5rem;
}

.item-details p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #555555;
}

.item-details strong {
    color: #333333;
    font-weight: bold;
}

/* Listado backend (Forzar para quitar el bg-dark inline de JS) */
.list-group-item {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
}

.list-group-item .text-light {
    color: #666666 !important;
}

.list-group-item .text-dark {
    color: #333333 !important;
}

.list-group-item strong {
    color: #B71234 !important;
}

/* Botones de acción del listado (editar/borrar) */
.btn-outline-info {
    color: #555555 !important;
    border-color: #cccccc !important;
}
.btn-outline-info:hover {
    background-color: #f0f0f0 !important;
}

.btn-outline-danger {
    color: #B71234 !important;
    border-color: #B71234 !important;
}
.btn-outline-danger:hover {
    background-color: #B71234 !important;
    color: #ffffff !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bloque fungible (fondo amarillento leve) */
.border-warning {
    border-color: #e0e0e0 !important;
}
.text-warning {
    color: #B71234 !important;
}

/* PDF Export Mode overrides (Mantenido por si acaso, aunque usa tabla ahora) */
.pdf-mode {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    color: #000000 !important;
}

/* Vista Alumnos: Lista lineal por categorías */
.lista-categorias {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

.cat-section {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    background: rgba(183, 18, 52, 0.05);
    border-left: 4px solid #B71234;
}

.cat-nombre {
    font-size: 0.78rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #B71234 !important;
}

.cat-count {
    font-size: 0.73rem;
    color: #B71234;
    font-weight: 600;
    background: rgba(183, 18, 52, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

.cat-body {
    background: #ffffff;
}

/* Fila de cada ítem */
.mat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #ebebeb;
    transition: background 0.15s;
}

.mat-row:last-child {
    border-bottom: none;
}

.mat-row:hover {
    background: rgba(183, 18, 52, 0.025);
}

/* Badge de cantidad (taller) */
.mat-cant-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(183, 18, 52, 0.09);
    color: #B71234;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 44px;
    height: 30px;
    border-radius: 5px;
    flex-shrink: 0;
    border: 1px solid rgba(183, 18, 52, 0.2);
}

/* Bloque de contenido principal */
.mat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mat-titulo-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Badge de clase (vista "todas") */
.mat-clase-badge {
    display: inline-block;
    background: #B71234;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.mat-titulo {
    font-weight: 700;
    font-weight: normal;
    color: #111111;
    font-size: 0.97rem;
    font-size: 0.85em;

}

/* Chips dos tonos: etiqueta roja · valor oscuro */
.mat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.mat-chip {
    display: inline-flex;
    align-items: stretch;
    border-radius: 5px;
    border: 1px solid #ddd;
    overflow: hidden;
    font-size: 0.78rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    max-width: 100%;
}

.mat-chip-label {
    background: rgba(183, 18, 52, 0.1);
    color: #B71234;
    font-weight: 700;
    padding: 5px 9px;
    border-right: 1px solid rgba(183, 18, 52, 0.18);
    white-space: nowrap;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
     display: flex;        
    align-items: center;   
}

.mat-chip-value {
    background: #ffffff;
    color: #1a1a1a;
    font-weight: 500;
    padding: 5px 11px;
    white-space: normal;     
    word-break: break-word;  
    overflow-wrap: anywhere; 
}


.mat-chip-details {
    background: #f8f8f8;
    border-color: #e8e8e8;
    box-shadow: none;
    
}

.mat-chip-details .mat-chip-value {
    background: #f8f8f8;
    color: #555;
    font-style: italic;
}

/* Botón "Ver tienda" */
.mat-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #B71234;
    text-decoration: none;
    border: 1px solid rgba(183, 18, 52, 0.4);
    border-radius: 5px;
    padding: 5px 13px;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mat-link:hover {
    background: #B71234;
    color: #ffffff;
    border-color: #B71234;
}

/* Material fungible: rejilla compacta */
.fungible-lista {
    list-style: none;
    margin: 0;
    padding: 8px 18px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 24px;
}

.fungible-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid #f4f4f4;
    font-size: 0.88rem;
    color: #222;
}

.fungible-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.fungible-nombre {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.fungible-cant {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(183, 18, 52, 0.09);
    color: #B71234;
    font-size: 0.76rem;
    font-weight: 700;
    min-width: 36px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(183, 18, 52, 0.2);
}

@media (max-width: 575px) {
    .mat-row {
        flex-wrap: wrap;
    }
    .mat-link {
        margin-top: 4px;
    }
    .fungible-lista {
        grid-template-columns: 1fr;
    }
    .fungible-item:last-child {
        border-bottom: none;
    }
}