/**
 * Estilos para el switch material design.
 * Source: https://bootsnipp.com/snippets/xp0QM
*/
.material-switch > input[type="checkbox"] {
    display: none;   
}

.material-switch > label {
    cursor: pointer;
    height: 0px;
    position: relative;  
}

.material-switch > label::before {
    background: rgb(0, 0, 0);
    box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    content: '';
    height: 16px;
    margin-top: -8px;
    position:absolute;
    opacity: 0.3;
    transition: all 0.4s ease-in-out;
    width: 40px;
}
.material-switch > label::after {
    background: rgb(255, 255, 255);
    border-radius: 16px;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
    content: '';
    height: 24px;
    left: -4px;
    margin-top: -8px;
    position: absolute;
    top: -4px;
    transition: all 0.3s ease-in-out;
    width: 24px;
}
.material-switch > input[type="checkbox"]:checked + label::before {
    background: inherit;
    opacity: 0.5;
}
.material-switch > input[type="checkbox"]:checked + label::after {
    background: inherit;
    left: 20px;
}
div {
    box-sizing: border-box;
}

.table-container {
    display: block;
    max-width: 100%;
    font-size: smaller;
}

.flex-table {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    flex-flow: row wrap;
    -webkit-transition: 0.5s;
    transition: 0.5s;
}

.flex-table.row {
    margin: 0px;
}


/* Estilos para el header de la tabla */

.flex-table:first-of-type .flex-row {
    background: white;
    border-bottom: 3px solid black;
    font-weight: bold;
    color: black;
}


/* Estilos para las filas pares*/

.flex-table.row:nth-child(2n) .flex-row {
    background-color: #f4f4f4;
}


/* Estilos para las filas impares*/

.flex-table.row:nth-child(2n+1) .flex-row {
    background-color: #dadada;
}


/* Estilos para las columnas. Se divide entre 4 como estilo base, si se quiere modificar 
la cantidad de columnas con el mismo ancho solo se debe pisar la clase con el ancho 
calc(100% / cantidad_de_colunas */

.flex-row {
    width: calc(100% / 4);
    text-align: center;
    padding: 0.5em 0.5em;
    align-content: center;
    display: grid;
}

.rowspan {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    flex-flow: row wrap;
    -webkit-box-align: start;
    align-items: flex-start;
    -webkit-box-pack: center;
    justify-content: center;
}

.column {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-flow: column wrap;
    width: 100%;
    padding: 0;
}

.column .flex-row {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    flex-flow: row wrap;
    width: 100%;
    padding: 0;
    border: 0;
}

.flex-cell {
    width: calc(100% / 4);
    text-align: center;
    padding: 0.5em 0.5em;
}


/* Estilos para las columnas de contenido principal */

.flex-row.top {
    word-break: break-word;
}

@media all and (max-width: 767px) {
    .flex-row {
        width: calc(100% / 3);
    }
    .flex-row.top {
        width: 100%;
    }
    .column {
        width: 100%;
    }
}

@media all and (max-width: 430px) {
    .flex-table .flex-row {
        border-bottom: 0;
    }
    .flex-table>.flex-row.last {
        display: none;
    }
    .header .flex-row {
        border-bottom: solid 1px;
    }
    .flex-row {
        width: 100%;
    }
    .flex-row.top {
        width: 100%;
        border-bottom: solid 1px #d9d9d9;
    }
    .column {
        width: 100%;
    }
    .column .flex-row {
        border-bottom: solid 1px #d9d9d9;
    }
    .flex-cell {
        width: 100%;
    }
}


/* Se eliminan los estilos de header a la primera fila dentro del contenedor #flexTableRowsContainer */

#flexTableRowsContainer>.flex-table:first-of-type .flex-row {
    background: #dadada;
    border-bottom: none;
    font-weight: initial;
}

#flexTableRowAdderContainer>.flex-row {
    cursor: pointer;
    width: 100%;
    justify-content: right;
}
.flex-table.row {
    margin-bottom: .5rem;
}

.flex-table {
    font-size: small;
}

/* Ancho de las columnas*/
.flex-table > .flex-row:nth-child(1) , .flex-table > form > .flex-row:nth-child(1){/* Nombre */
    width: 44%;
    text-align: center;
}
.flex-table > .flex-row:nth-child(2) , .flex-table > form > .flex-row:nth-child(2) {/* Código */
    width: 44%;
    text-align: center;
}
.flex-table > .flex-row:nth-child(3) , .flex-table > form > .flex-row:nth-child(3) {/* Acciones */
    width: 12%;
    text-align: center;
}

/* Estilos para las filas pares*/
.flex-table.row:nth-child(2n) .flex-row {
    align-content: center;
    align-items: center;
}

/* Estilos para las filas impares*/
.flex-table.row:nth-child(2n+1) .flex-row {
    align-content: center;
    align-items: center;
}

.flex-cell {
    align-self: center;
}



.form-control {
    padding: .5rem;
    font-size: 12px;
    text-align: center;
}

*::placeholder {
    color: #666 !important;
}

@media all and (max-width: 1200px) {

    /* Ancho de las columnas*/
    .flex-table > .flex-row:nth-child(1) , .flex-table > form > .flex-row:nth-child(1){/* Nombre */
        width: 42%;
        text-align: center;
    }
    .flex-table > .flex-row:nth-child(2) , .flex-table > form > .flex-row:nth-child(2){/* Codigo */
        width: 42%;
        text-align: center;
    }

    .flex-table > .flex-row:nth-child(3) , .flex-table > form > .flex-row:nth-child(3) {/* Acciones */
        width: 16%;
        text-align: center;
    }
}

@media all and (max-width: 930px) {

    /* Ancho de las columnas*/
    .flex-table > .flex-row:nth-child(1) , .flex-table > form > .flex-row:nth-child(1){/* Nombre */
        width: 35%;
        text-align: center;
    }
    .flex-table > .flex-row:nth-child(2) , .flex-table > form > .flex-row:nth-child(2){/* Codigo */
        width: 35%;
        text-align: center;
    }

    .flex-table > .flex-row:nth-child(3) , .flex-table > form > .flex-row:nth-child(3) {/* Acciones */
        width: 30%;
        text-align: center;
    }
}

@media all and (max-width: 490px) {

    /* Ancho de las columnas*/
    .flex-table > .flex-row:nth-child(1) , .flex-table > form > .flex-row:nth-child(1){/* Nombre */
        width: 100%;
        text-align: center;
    }
    .flex-table > .flex-row:nth-child(2) , .flex-table > form > .flex-row:nth-child(2){/* Codigo */
        width: 100%;
        text-align: center;
    }

    .flex-table > .flex-row:nth-child(3) , .flex-table > form > .flex-row:nth-child(3) {/* Acciones */
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
