.Taulukko-binding {
    position: relative;
    margin-top: 20px;
    border-radius: 10px;
    border: 0.5px solid #ddd;
}
.Taulukko-binding table {
    border-spacing: 0px;
    border-collapse: separate;
    border: 0px solid #d6d6d6;
    border-radius: 0px;
    font-size: 0.9em;
    width: 100%;
}

.Taulukko-binding th input {
    min-width: 0px !important;
    width: 100% !important;
    position: relative;
    width: 100%;
    height: 30px;
    border: 1px solid #ccc;
    padding-left: 10px;
    border-radius: 7px;
}
.Taulukko-binding table th {
    background: #f5f5f5;
    color: #555;
    padding: 5px 7px;
    white-space: nowrap;
    border: 0.5px solid #ddd;
    font-weight: normal;
    border-left: 0;
    border-top: 0;
    text-align: left;
}
.Taulukko-binding table th.text-right {
    text-align: right;
}
.Taulukko-binding table th.text-center {
    text-align: center;
}
.Taulukko-binding table thead tr:first-of-type th {
    font-size: 1em;
    padding: 10px;
}

/* Jos taulukossa EI ole tfootia → muokkaa viimeistä tbody > tr:ää */
.Taulukko-binding.ei-sivuja table:not(:has(tfoot)) tbody:last-of-type tr:last-of-type td:first-of-type {
    border-bottom-left-radius: 10px;
}
.Taulukko-binding.ei-sivuja table:not(:has(tfoot)) tbody:last-of-type tr:last-of-type td:last-of-type {
    border-bottom-right-radius: 10px;
}

/* Jos taulukossa ON tfoot → muokkaa sen viimeistä tr:ää */
.Taulukko-binding.ei-sivuja table:has(tfoot) tfoot tr:last-of-type td:first-of-type {
    border-bottom-left-radius: 10px;
}
.Taulukko-binding.ei-sivuja table:has(tfoot) tfoot tr:last-of-type td:last-of-type {
    border-bottom-right-radius: 10px;
}
.Taulukko-binding table tr:first-of-type th:first-of-type {
    border-top-left-radius: 10px;
}
.Taulukko-binding table tr:first-of-type th:last-of-type {
    border-top-right-radius: 10px;
}

.Taulukko-binding thead tr:last-of-type input:not([type='checkbox']) {
    width: 100%;
    border: 1px solid #e3e3e3;
}

.Taulukko-binding table tr:nth-of-type(even) {
    background: #fafafa;
}
.Taulukko-binding table tr:nth-of-type(1) td {
    margin-top: 2px;
}

.Taulukko-binding table.Klikattava tr:hover {
    cursor: pointer;
    background: #eee;
}

.Taulukko-binding table tbody td {
    padding: 5px;
    border: 0.5px solid #ddd;
    padding-left: 10px;
    border-left: 0;
    border-top: 0;
    transition: 300ms;
}
.Taulukko-binding table th:first-of-type,
.Taulukko-binding table td:first-of-type {
    border-left: 0px;
}
.Taulukko-binding table tbody tr:nth-of-type(even) td {
    background: #fafafa;
}
.Taulukko-binding table tbody tr:last-of-type td {
    border-bottom: 0px;
}
.Taulukko-binding table tbody td .btn svg {
    margin-right: 5px;
}
.Taulukko-binding tr td:last-of-type,
.Taulukko-binding tr th:last-of-type {
    border-right: 0;
}
.Taulukko-binding .button {
    margin: 0;
    float: initial;
    clear: initial;
}
.Taulukko-binding table.Klikattava tbody tr:nth-of-type(odd):hover td {
    background: #eee;
    transition: 300ms;
}
.Taulukko-binding table.Klikattava tbody tr:nth-of-type(even):hover td {
    background: #eee;
    transition: 300ms;
}
.Taulukko-binding .Klikattava tbody tr:hover {
    cursor: pointer;
}
.Taulukko-binding.AutoWidth {
    display: inline-block;
}
.Taulukko-binding.AutoWidth ~ * {
    display: block;
}
.Taulukko-binding .textLeft {
    text-align: left;
}
.Taulukko-binding .textCenter {
    text-align: center;
}
.Taulukko-binding .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 200, 0.1);
    z-index: 100;
}
.Taulukko-binding .overlay .loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4em;
    color: #999;
    font-weight: 300;
}
.Taulukko-binding .overlay .loader i {
    margin-right: 20px;
}
.Taulukko-binding tr.Valittu td {
    background: #eaf3ffd1 !important;
}

/** sorttaus **/

.Taulukko-binding thead th.Sortattava {
    position: relative;
    user-select: none;
}

.Taulukko-binding thead th.Sortattava .SortIcon {
    margin-left: 6px;
    width: 1em;
    text-align: center;
    position: absolute;
    right: 7px;
    opacity: 0;
    transition: 200ms;
}
.Taulukko-binding thead th.Sortattava:hover .SortIcon,
.Taulukko-binding thead th.Sortattava .SortIcon.ActiveSort {
    opacity: 1;
    transition: 200ms;
}
.Taulukko-binding thead th.text-right.Sortattava .SortIcon {
    right: initial;
    left: 7px;
}

/** Sivut **/

.Taulukko-binding .Sivut {
    width: 100%;
    background: #f5f5f5;
    border: 0px solid #ddd;
    padding: 5px;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
    font-size: 0.8em;
    border-top: 0.5px solid #ddd;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
.Taulukko-binding .Sivut.infinity {
    display: none;
}
.Taulukko-binding .Sivut .SivuPainike {
    display: inline-block;
    width: 27px;
    height: 27px;
    background: #fefefe;
    border-radius: 100%;
    line-height: 27px;
    text-align: center;
    margin-left: 5px;
    border: 0.5px solid #ccc;
    transition: 300ms;
    color: #666;
    padding: 0px;
}
.Taulukko-binding .Sivut .SivuPainike i {
    color: #999;
}
.Taulukko-binding .Sivut .SivuPainike:hover {
    background: #eee;
    color: var(--PiiMegaBlue);
    cursor: pointer;
    transition: 300ms;
}
.Taulukko-binding .Sivut .RivienMaara {
    height: 33px;
    float: right;
    line-height: 33px;
    margin-right: 10px;
    color: #999;
}
.Taulukko-binding .Sivut .SivuPainike.Aktiivinen {
    background: var(--TeemaVari);
    color: white;
    border-color: var(--TeemaVari);
}
.Taulukko-binding .Sivut .SivuPainike.Disabled {
    background: #f4f4f4;
    color: #999;
}
.Taulukko-binding .Sivut .SivuPainike.Disabled:hover {
    cursor: default;
}

/* Summarivi */
.Taulukko-binding tfoot tr {
    background: #f5f5f5;
    font-weight: bold;
    border-top: 2px solid #ccc;
}
.Taulukko-binding tfoot tr:hover {
    background: #f5f5f5 !important; /* ei hover-efektiä */
}
.Taulukko-binding tfoot td {
    padding: 7px 5px;
    border: 0px solid #ddd;
    text-align: right;
    background: inherit;
    border-top: 0.5px solid #ddd;
    color: #616161;
}

.Taulukko-binding tfoot td:first-child {
    text-align: left;
    font-style: italic;
    color: #666;
}

.Taulukko-binding tfoot td.Summa {
    color: var(--yf-theme-color);
    font-size: 1em;
}
