/*** BASE ***/

body{
    display: flex;
    align-items: center;
    justify-content: start;
    flex-direction: column;
    gap: 15px;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 10px;
    margin: 0;
    background-color: var(--bgBody, #fff);
    overflow: auto;
}

*{
    user-select: none;
    font-family: Verdana;
    box-sizing: border-box;
}

/* HEADER */

#header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
    gap: 10px;
    background-color: var(--bgHeader, #000);
    border-radius: 20px;
    box-shadow: 0 4px 10px #00000080;
    padding: 10px;
}

#headerTitle {
    color: var(--colorTitle, #fff);
    font-size: 36px;
    text-transform: uppercase;
    white-space: normal;
}

#headerBtns{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    height: fit-content;
}

.breadcrumb{
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    font-weight: bold;
}

.breadcrumb img{
    height: 1.2em;
    cursor: pointer;;
}

/*** USER ***/

#userContent{
    display: block;
    position: relative;
    --color: var(--colorUser, #000);
}

.iconUser{
    --size: 45px;
    height: var(--size);
    width: var(--size);
    cursor: pointer;    
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#openLogin{
    background-image: url("../img/user.png");
}

#openMenuUser{
    background-image: url("../img/userLog.png");
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--color);
    cursor: pointer;
}

#openMenuUser label{
    cursor: pointer;
}

#menuUser{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: absolute;
    top: calc(100% + var(--h, 0px) + 5px);
    right: 0%;
    padding: 10px;
    border-radius: 20px;
    background-color: var(--bgMenuUser, #000);
    box-shadow: var(--boxShadow, 0);
    z-index: 997;
}

#menuUser label{
    white-space: nowrap;
    /* color: var(--color); */
}

#menuUser .btn{
    width: 100%;
}

#menuUser #logout.btn{
    --bgBtn: red;
}

/*** CONTANIER ***/

#container {
    width: 100%;
    flex: 1 1 auto;
    overflow: auto auto;
    padding: var(--paddingContainer, 10px);
    scrollbar-width: none;
    border-radius: 20px;
    background-color: var(--bgContainer, #fff);
    box-shadow: 0 5px 5px #00000080;
}

.riquadro {
    position: relative;
    padding: 10px;
    background-color: #b5b5b5;
    border-radius: 20px;
    box-shadow: 0 0 20px #00000033;
}

.riquadro.center {
    margin-inline: auto;
}

.riquadro.maxWidth{
    width: 100%;
}

.riquadro.maxHeight{
    height: 100%;
}

/*** BTNS ***/

.btns{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    border: none;
    border-radius: 10px;
    padding: 10px 5px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 6px #00000033;
    transition: transform 0.2s linear;
    color: var(--colorBtn, #000) !important;
    background-color: var(--bgBtn, #fff);
    z-index: 1;
}

.btn.HasIcon img{
    display: block;
    height: 1.2em;
    width: auto;
}

.btn.HasIcon label{
    white-space: nowrap;
}

.btn, .btn *{
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05);
}

.btn.disabled {
    pointer-events: none;
    background: #ccc;
}

/*** INPUTFIELD ***/

.inputField{
    display: block;
    position: relative;
    z-index: 11;
}

.inputField .eleInput{
    width: 100%;
    z-index: 12;
}

.inputField label{
    display: block;
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 13;    
    transition: all 0.3s linear;
    padding: 3px 5px;
    border-radius: 10px;
    font-size: 15px;
    background-color: var(--bgLabelInputField, #000);
    color: var(--colorLabelInputField, #fff) !important;
}

.inputField label.onInput{
    top: 0%;
    font-size: 10.5px;
}

/*** ELEINPUT ***/

.inputContanier{
    display: block;
    position: relative;
}

.numeroInput {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-align: right;
    z-index: 1;
}

.inputPlaceholder{
    display: block;
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    color: #a8203c;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
}

.eleInput {
    display: block;
    position: relative;
    border-radius: 10px;
    padding: 5px;
    margin: 0;
    font-size: 17px;
    outline: none;
    border: 2px solid var(--borderEleInput, #000);
    background-color: var(--bgEleInput, #fff);
    color: var(--colorEleInput, #000);
}

select.eleInput{
    cursor: pointer;
}

.eleInput.password{
    padding-inline-end: 15px !important;
}

.eye{
    display: none; 
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 3%;
    height: calc(100% - 2 * var(--padding, 5px));
    cursor: pointer;
    touch-action: none;
    user-select: none;
    z-index: 13;
}

/*** ***/

checkBox{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

checkBox label{
    cursor: pointer;
}

/**  **/

textarea.autoResize { 
    resize: none;
    scrollbar-width: none;
}

h1, h2, h3, h4, h5, h6, p, ul, ol{
    margin: 0;
}

input[type='checkbox'], input[type='radio']{
    margin: 0;
    cursor: pointer;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.list li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

/*** SWITCH ***/

switch {
    --widthSwitch: var(--width, 50px);
    --heightSwitch: var(--height, 25px);
    --gapSwitch: var(--gap, 2px);

    display: inline-block;
    position: relative;
    width: var(--widthSwitch);
    height: var(--heightSwitch);
    background-color: #ccc;
    cursor: pointer;

    -webkit-transition: .4s;
    transition: .4s;
}

switch input {
    display: none;
    opacity: 0;
    width: 0;
    height: 0;
}

slider {
    display: block;
    position: absolute;
    top: 50%;
    left: calc(0% + var(--gapSwitch));
    width: calc(var(--heightSwitch) - var(--gapSwitch) * 2);
    height: calc(var(--heightSwitch) - var(--gapSwitch) * 2);
    background-color: #fff;
    -webkit-transition: .4s;
    transition: .4s;
    --translateX: 0%;
    --translateY: -50%;
    -webkit-transform: translate(var(--translateX), var(--translateY));
    -ms-transform: translate(var(--translateX), var(--translateY));
    transform: translate(var(--translateX), var(--translateY));
}

switch:has(input:checked) {
    background-color: #2196F3;
}

switch input:checked + slider {
    --translateX: calc(var(--widthSwitch) - var(--heightSwitch));
}

switch.round {
    border-radius: var(--heightSwitch);
}

switch.round slider {
    border-radius: 50%;
}

/*** TABLE ***/

.table{
    display: flex;
    overflow-y: auto;
    scrollbar-width: none;
    border: 5px solid #333;
    border-radius: 20px;
}

.table table{
    position: relative;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    overflow: auto;
}

.table th.colSortable i{
    margin-left: 5px;
}

.table table tr:first-child th{
    background-color: #595959;
    position: sticky;
    top: 0;
    z-index: 90;
    padding-block: 10px;
    white-space: nowrap;
}

.table table tr:first-child th.colSortable{
    cursor: pointer;
}

.table tr:not(:first-child):nth-of-type(even){
    background-color: #dadada;
}

.table tr:not(:first-child):nth-of-type(odd){
    background-color: #979797;
}

.table tr:nth-child(n+2) :is(td, th){
    cursor: pointer;
}

.table :is(td, th){
    padding: 5px;
}

.table tr :is(td, th):not(:last-child){
    border-right: 3px solid #333;
}

/*** ICON ***/

.icon{
    display: block;
    position: relative;
    width: var(--sizeIcon);
    height: var(--sizeIcon);
    padding: var(--iconPadding);
    cursor: pointer;
    --iconPadding: var(--iPadding, 0px);
    --iconColor: var(--iColor, #000);
}

.icon span{
    display: block;
    border-radius: var(--iBorderRadius, 0px);
}

/** **/

.icon:is(.x, .plus, .h, .minus, .o, .q, .t){
    display: flex;
}

.icon:is(.x, .plus, .h, .minus) span{
    background-color: var(--iconColor, #000);
    height: var(--sizeSymbol);
}

/** X - PLUS **/

.icon:is(.x, .plus){
    justify-content: center;
    align-items: center;
}

.icon:is(.x, .plus) span{
    position: absolute;
    top: 50%;
}

/** X **/

.icon.x{
    --sizeIcon: var(--sIcon, 40px);
    --sizeSymbol: var(--sSymbol, 5px);
}

.icon.x span{
    width: calc(1.41421356 * var(--sizeIcon) - var(--iconPadding) * 2 - var(--sizeSymbol));
    transform: translateY(-50%) rotate(calc(var(--angle) * 45deg));
}

.icon.x span:nth-child(1){
    --angle: 1;
}

.icon.x span:nth-child(2){
    --angle: -1;
}

/** PLUS **/

.icon.plus{
    --sizeIcon: var(--sIcon, 40px);
    --sizeSymbol: var(--sSymbol, 10px);
}

.icon.plus span{
    width: calc(var(--sizeIcon) - var(--iconPadding, 0px) * 2);
    transform: translateY(-50%) rotate(calc(var(--angle) * 1deg));
}

.icon.plus span:nth-child(1){
    --angle: 0;
}

.icon.plus span:nth-child(2){
    --angle: 90;
}

/** H - MINUS **/

.icon:is(.h, .minus){
    align-items: center;
    flex-direction: column;
}

.icon:is(.h, .minus) span{
    position: relative;
    width: 100%;
}

/** H **/

.icon.h{
    --sizeIcon: var(--sIcon, 35px);
    --sizeSymbol: var(--sSymbol, 7px);
    justify-content: space-between;
}

/** MINUS **/

.icon.minus{
    --sizeIcon: var(--sIcon, 35px);
    --sizeSymbol: var(--sSymbol, 7px);
    justify-content: center;
}

/** O **/

.icon.o{
    align-items: center;
    justify-content: center;
    --sizeIcon: var(--sIcon, 40px);
    --sizeSymbol: var(--sSymbol, 5px);
}

.icon.o span{
    width: calc(var(--sizeIcon) - var(--iconPadding)*2);
    height: calc(var(--sizeIcon) - var(--iconPadding)*2);
    border: var(--sizeSymbol) solid var(--iconColor);
    border-radius: 50%;
}

/** T **/

.icon.t {
    align-items: center;
    justify-content: center;
    --sizeIcon: var(--sIcon, 40px);
    --sizeSymbol: var(--sSymbol, 10px);
}

.icon.t svg {
    width: calc(var(--sizeIcon) - var(--iconPadding) * 2);
    height: calc(var(--sizeIcon) - var(--iconPadding) * 2);
    display: block;
    overflow: visible;
}

.icon.t polygon {
    fill: none;
    stroke: var(--iconColor);
    stroke-width: var(--sizeSymbol);
    stroke-linejoin: miter;
    stroke-linecap: butt;
}

/** Q **/

.icon.q{
    align-items: center;
    justify-content: center;
    --sizeIcon: var(--sIcon, 40px);
    --sizeSymbol: var(--sSymbol, 5px);
}

.icon.q span{
    width: calc(var(--sizeIcon) - var(--iconPadding) * 2);
    height: calc(var(--sizeIcon) - var(--iconPadding) * 2);
    border: var(--sizeSymbol) solid var(--iconColor);
}

/*** INPUT DATE ***/

.inputDate{
    display: block;
    position: relative;
    margin: 0;
    padding: 0;
}

.inputDate .inputField{
    cursor: pointer;
}

.inputDate .calendar{
    --fontSize: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: absolute;
    top: calc(100% + 1px);
    left: 0%;
    background-color: #fff;
    padding: 5px;
    border: 1px solid #000;
    border-radius: 5px;
    z-index: 999;

    font-size: var(--fontSize);
}

.inputDate select{
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
    outline: none;
    font-size: var(--fontSize);
}

hr {
    display: block;
    width: 100%;
    border: none;
    height: 3px;
    background-color: #000;
    border-radius: 10px;
    margin: 0;
}

.header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.changeMonth{
    display: block;
    position: relative;
    width: 0;
    height: 0;
    border-left: 25px solid #007bff;
    border-top: 12.5px solid transparent;
    border-bottom: 12.5px solid transparent;
    cursor: pointer;
}

.changeMonth.prev{
    transform: rotate(180deg);
}

.changeMonth.disabled{
    border-left-color: #cccccc;
    cursor: default;
}

.weekdays{
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
}

.days{
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
}

.day{
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    color: #000;
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
}

.day.festive{
    font-weight: bold;
}

.day:hover:not(.selected){
    background-color: #009fffd4 !important;
}

.today{
    background-color: #04d1cb;
}

.day.selected{
    background-color: #007bff;
    color: #fff !important;
}

.day.disabled{
    pointer-events: none;
    background-color: #f5f5f5 !important;
    color: #ccc !important;
}

.time{
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.time, .time select{
    font-size: 15px;
}

.actions{
    display: flex;
    position: relative;
    justify-content: center;
    gap: 10px;
}

.action{
    display: block;
    position: relative;
    text-transform: uppercase;
    padding: 5px;
    background: #007bff;
    color: #fff;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: scale 0.3s linear;
}

.action.disabled{
    background: #ccc;
    pointer-events: none;
}

.action:not(.disabled):hover{
    scale: 1.1;
}

/*** SELECT ***/

.select{
    display: block;
    position: relative;
    height: fit-content;
    width: var(--selectWidth);
    --color: var(--colorSelect, #000);
}

.select .current{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    width: 100%;
    gap: 5px;
    background-color: #f0f0f0;
    padding: 5px 5px;
    border: 3px solid var(--color);
    border-radius: 15px;
    cursor: pointer;
}

.select .current span{
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.select .arrow {
    --arrowWidth: 5px;
    --arrowHeight: 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}

.arrow::before, .arrow::after {
    content: "";
    display: block;
    width: 0;
    border-inline: var(--arrowWidth) solid transparent;
}

.arrow::before {
    border-bottom: var(--arrowHeight) solid var(--color);
}

.arrow::after {
    border-top: var(--arrowHeight) solid var(--color);
}

.select .options{
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: absolute;
    top: calc(100% + 5px);
    width: 100%;
    max-height: 300px;
    padding: 5px;
    background-color: #fff;
    border: 3px solid var(--color);
    --borderOptions: 15px;
    border-radius: var(--borderOptions);
    z-index: 1000;
    overflow: scroll;
}

.select .options::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.select .optgroup{
    display: block;
    position: relative;
    width: 100%;
    padding: 5px 10px;
    background-color: #ebebeb;
    border-radius: var(--borderOptions);
}

.select .optgroup .label{
    font-weight: bold;
    margin-bottom: 5px;
}

.select .optgroup .option{
    padding-left: 20px;
}

.select .option{
    display: block;
    position: relative;
    width: 100%;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: var(--borderOptions);
    transition: background 0.3s;
    background-color: #ebebeb;
}

.select .option:not(.disabled):is(:hover, .selected){
    background-color: #8d8d8da6;
}

.select .option.labelSelect{
    font-weight: bold;
    text-transform: uppercase;
}

.select .option.labelSelect.disabled{
    opacity: 0.5;
}

.select .option:is(.disabled, .selected){
    cursor: not-allowed;
}

/*** POPUP ***/

.popup {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background-color: #00000080;
}

.popup .window {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    min-width: 25%;
    max-width: 75%;
    position: relative;
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px #00000080;
}

.headerPopup{
    display: block;
    position: relative;
}

.popup .chiudiPopup{
    position: absolute;
    right: 5px;
    top: 5px;
    --sIcon : 17px;
    --sSymbol: 4px;
    --colorSymbol: var(--colorPopUp);
}

.popup .title {
    margin: 0;
    text-transform: uppercase;
    text-align: center;
    color: var(--colorPopUp, #000);
}

.popup .corpo {
    display: block;
    position: relative;
}

.popup p {
    margin: 0;
}

/*** loadingPage ***/

#loadingPage {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000aa;
    z-index: 9999;
}

#loadingContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border-radius: 10px;
    background: #333333e7;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 7px solid #848484;
    border-top: 7px solid #202020;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin{
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(360deg);
    }
}