/* Estilos para a páxina de materiais */

body {
    font-family: "DIN_ligth";
    font-size: 14px;
    color: #333;
}

h1 {
    text-align: center;
    margin: 20px;
}

h3.seccion-titulo {
    margin-top: 1em;
}

h3.seccion-titulo-espaciado {
    margin-top: 2em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.datatable-container {
    margin-top: 20px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

#materiales-table,
#registro-uso-table,
#tipos-materiales-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
    background-color: white;
    table-layout: fixed;
}

#materiales-table th,
#registro-uso-table th,
#tipos-materiales-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border: 1px solid #000000;
    padding: 4px 8px;
}

#materiales-table td,
#registro-uso-table td,
#tipos-materiales-table td {
    vertical-align: middle;
    border: 1px solid #000000;
    background-color: white;
    padding: 4px 8px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Centrar botóns na columna de accións */
#materiales-table td:last-child,
#registro-uso-table td:last-child,
#tipos-materiales-table td:last-child {
    text-align: center;
}

/* Permitir que os botóns se vexan completos */
#materiales-table td button,
#registro-uso-table td button,
#tipos-materiales-table td button {
    white-space: normal;
}

/* Estilos responsive para móvil */
@media screen and (max-width: 768px) {
    .datatable-container {
        overflow-x: visible;
        width: 100%;
    }
    
    #materiales-table,
    #registro-uso-table,
    #tipos-materiales-table {
        font-size: 12px;
        width: 100% !important;
    }
    
    #materiales-table th,
    #registro-uso-table th,
    #tipos-materiales-table th,
    #materiales-table td,
    #registro-uso-table td,
    #tipos-materiales-table td {
        font-size: 12px;
        padding: 4px;
    }
    
    .btn-editar, .btn-eliminar, .btn-ver {
        padding: 2px 4px;
        font-size: 12px;
    }
    
    /* Botóns de acción en móbil */
    .botones_accion {
        width: 100%;
    }
    
    .botones_accion .button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center;
    }
}

.btn-editar, .btn-eliminar, .btn-ver {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 5px;
    margin: 0 1px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 13px;
}

.btn-editar {
    color: #007bff;
}

.btn-editar:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.btn-eliminar {
    color: #dc3545;
}

.btn-eliminar:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-ver {
    color: #00a160;
}

.btn-ver:hover {
    background-color: rgba(0, 161, 96, 0.1);
}

/* Botón axustar stock */
.btn-stock {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 5px;
    margin: 0 1px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 13px;
    color: #6f42c1;
}

.btn-stock:hover {
    background-color: rgba(111, 66, 193, 0.1);
}

/* Badge de stock */
.badge-stock {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.stock-ok {
    background-color: #d4edda;
    color: #155724;
}

.stock-baixo {
    background-color: #fff3cd;
    color: #856404;
}

.stock-cero {
    background-color: #f8d7da;
    color: #721c24;
}

/* Icono de consumbible ok */
.text-ok {
    color: #00a160;
}

/* Inputs de edición */
.input-edicion, .input-edicion-nombre, .input-edicion-tipo,
.input-edicion-desc, .input-edicion-cons, .input-edicion-check {
    width: 100%;
    padding: 2px 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.input-stock {
    width: 60px !important;
}

input[type="checkbox"].input-edicion-check,
input[type="checkbox"].input-edicion-cons {
    width: auto;
}
