/* ---------------- TABELLE ---------------- */

table
{
    background-color: white;
    border-collapse: collapse;
}

table tr>*
{
    border: 1px solid lightgray;
    padding: .25rem .5rem;
}

table thead th.TableName
{
    padding: 1rem;
    text-align: left;
    font-size: 120%;
}

table tfoot th.TableSummary:first-child
{
    padding: .5rem;
    text-align: left;
    font-size: 110%;
}

table th.TableName button:not(.CloseButton),
table th.TableName *[command]
{
    float: right;
    margin-left: 1rem;
}

table th.TableName input[command],
table th.TableName select[command]
{
    font-size: 80%;
}


/* -------- VERTICALI -------- */

table.Vertical
{
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-left: 1.5rem;
    width: calc(100% - 3rem);
    box-shadow: var(--shadow3);
}

table.Vertical td.Label
{
    text-align: right;
    font-weight: bold;
}

table.Vertical td.Label
{
    width: 30%;
}

table.Vertical td.Value input,
table.Vertical td.Value select,
table.Vertical td.Value textarea
{
    width: 100%;
}

table.Vertical td.Value input[type=checkbox],
label
{
    width: auto;
    cursor: pointer;
}

table.Vertical td.Value textarea
{
    resize: vertical;
}

table.Vertical tr>*[euro]::after{content: ' €';}
table.Vertical tr>*[perc]::after{content: ' %';}

/* -------- RECORDLIST -------- */

table.RecordList
{
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-left: 1.5rem;
    width: calc(100% - 3rem);
    box-shadow: var(--shadow3);
}

table.RecordList tr>*.Id,
table.RecordList tr>*[small]
{
    width: 1rem;
    white-space: nowrap;
}

table.RecordList tr>*[input4],
table.RecordList tr>*[input6],
table.RecordList tr>*[input8],
table.RecordList tr>*[input10],
table.RecordList tr>*[input12],
table.RecordList tr>*[input16],
table.RecordList tr>*[input20]
{width: 1rem;}

table.RecordList tr>*[input4] input {width: 4rem;}
table.RecordList tr>*[input6] input {width: 6rem;}
table.RecordList tr>*[input8] input {width: 8rem;}
table.RecordList tr>*[input8] input {width: 10rem;}
table.RecordList tr>*[input12] input {width: 12rem;}
table.RecordList tr>*[input16] input {width: 16rem;}
table.RecordList tr>*[input20] input {width: 20rem;}
table.RecordList tr>*[input100] input {width: 100%;}

table.RecordList tr>*[euro]::after{content: ' €';}
table.RecordList tr>*[perc]::after{content: ' %';}

table.RecordList tr>td.Id,
table.RecordList tr>*[ref],
table.RecordList tr>*[count],
table.RecordList tr>*[euro],
table.RecordList tr>*[perc]
{
    width: 1rem;
    text-align: right;
    white-space: nowrap;
}

/* -------- CLICCABILI -------- */

table.RecordList.Clickable tbody>tr:hover td
{
    cursor: pointer;
    background-color: grey;
    color: white;
}

/* -------- FILTRABILI -------- */

table.RecordList tr[filters] th input,
table.RecordList tr[filters] th select
{
    font-size: 80%;
    width: 100%;
    border: none;
    background-color: lightgrey;
}

table.RecordList tr.FilteredOut
{
    display: none;
}

table.RecordList button
{
    font-size: 80%;
}

/* -------- CHIUDIBILI -------- */

table.RecordList[closed] button.CloseButton
{
    position: relative;
    top: -.75rem;
    left: -.75rem;
    border-radius: 1rem;
    width: 2rem;
    height: 2rem;
    font-size: 75%;
}

table.RecordList[closed=true] tbody>tr,
table.RecordList[closed=true] button.CloseButton>.fa-minus,
table.RecordList[closed=false] button.CloseButton>.fa-plus
{
    display: none;
}

/* -------- ORDINABILI -------- */

th[order]
{
    white-space: nowrap;
    position: relative;
    padding-left: 2.5rem;
}

th[order] button.OrderButton
{
    margin-right: .5rem;
    position: absolute;
    left: .5rem;
}

table.RecordList th[order=""] button.OrderButton>.fa-sort-up,
table.RecordList th[order=""] button.OrderButton>.fa-sort-down,
table.RecordList th[order=desc] button.OrderButton>.fa-sort,
table.RecordList th[order=desc] button.OrderButton>.fa-sort-up,
table.RecordList th[order=asc] button.OrderButton>.fa-sort,
table.RecordList th[order=asc] button.OrderButton>.fa-sort-down
{
    display: none;
}
