﻿/*BADGE STATUS - TURNOVER*/

.badge-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: normal;
}

.badge-not-assigned {
    background-color: var(--badge-not-assigned-bg);
    color: var(--badge-not-assigned-color);
}

.badge-pending {
    background-color: var(--badge-pending-bg);
    color: var(--badge-pending-color);
}

.badge-assigned {
    background-color: var(--badge-assigned-bg);
    color: var(--badge-assigned-color);
}

.badge-in-progress {
    background-color: var(--badge-in-progress-bg);
    color: var(--badge-in-progress-color);
}

.badge-completed {
    background-color: var(--badge-completed-bg);
    color: var(--badge-completed-color);
    font-weight: 600;
}


/* Titolo */

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--app-text);
}

/*========================= TABELLA  =========================*/

/*Loading*/
.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-bg);
    backdrop-filter: blur(1px);
}

/*classe quando non si trova nessun elemento nella tabella*/
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    text-align: center;
    background-color: var(--app-bg);
}

/* scroll orizzontale per tabelle larghe */
.hover-scroll-x {
    width: 100%;
    min-height: 200px;
    overflow-x: auto;
    overflow-y: visible;
    background-color: var(--app-bg-layout);
}

/* ========================= TABLE CONTAINER ========================= */

.table-container {
    background-color: var(--app-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

    .table-container table.items-table[theme="loondry"] {
        border-radius: 1rem;
    }
        /* arrotonda gli angoli dell'header */

        .table-container table.items-table[theme="loondry"] thead th:first-child {
            border-top-left-radius: 1rem;
        }

        .table-container table.items-table[theme="loondry"] thead th:last-child {
            border-top-right-radius: 1rem;
        }

    .table-container .dropdown-menu {
        z-index: 3000;
    }

    .table-container td.col-actions .dropdown {
        position: relative;
    }


    /* ========================= QUICKGRID (theme="loondry") ========================= */

    .table-container table.items-table[theme="loondry"] {
        width: 100%;
        margin-bottom: 0;
        border-collapse: separate;
        border-spacing: 0;
    }
        /* header */

        .table-container table.items-table[theme="loondry"] thead {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #fff;
        }

            .table-container table.items-table[theme="loondry"] thead th {
                padding: 1rem;
                font-weight: 600;
                text-transform: uppercase;
                font-size: 0.82rem;
                letter-spacing: 0.5px;
                vertical-align: middle;
                border-bottom: 1px solid var(--app-border-color);
            }

        /* body */

        .table-container table.items-table[theme="loondry"] tbody td {
            padding: 1rem;
            vertical-align: middle;
            border-bottom: 1px solid var(--app-border-color);
        }

        .table-container table.items-table[theme="loondry"] tbody tr:hover {
            background-color: rgba(255,255,255,0.03); /* ok sia dark che light */
        }

    /* ========================= COLUMN SIZES ========================= */

    .table-container th.col-select, .table-container td.col-select {
        width: 48px;
        min-width: 48px;
        text-align: center;
    }

        .table-container th.col-select .form-check-input, .table-container td.col-select .form-check-input {
            width: 1.1rem;
            height: 1.1rem;
            margin: 0;
            cursor: pointer;
        }
    /* colonna azioni */

    .table-container th.col-actions, .table-container td.col-actions {
        width: 64px;
        min-width: 64px;
        max-width: 64px;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }

        .table-container td.col-actions .btn {
            color: var(--navigation-color);
            padding: 0.25rem;
        }

            .table-container td.col-actions .btn:hover {
                background-color: var(--app-border-color);
                border-radius: 8px;
            }

/* ========================= TABLE FOOTER (Loondry style) ========================= */

.table-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 0.75rem 1rem;
    background: linear-gradient( 180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.015) 100% );
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--app-border-color);
}
    /* contenuto interno */

    .table-footer .text-muted {
        font-size: 0.85rem;
        color: var(--app-text-muted);
    }
    /* ========================= PAGE SIZE SELECT ========================= */

    .table-footer select.form-select {
        background-color: var(--app-bg);
        color: var(--app-text);
        border: 1px solid var(--app-border-color);
        border-radius: 999px;
        padding: 0.25rem 0.75rem;
        font-size: 0.85rem;
        min-height: 32px;
        width: 80px;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .table-footer select.form-select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(102,126,234,0.25);
        }
    /* colonna sinistra footer */

    .table-footer .footer-left {
        flex: 1; /* prende più spazio */
    }
/* Nasconde le righe placeholder che QuickGrid aggiunge per riempire ItemsPerPage */

.table-container table.items-table[theme="loondry"] tbody tr:has(td:empty) {
    display: none !important;
}

/* ========================= PAGINATOR (QuickGrid) ========================= */

.table-footer .paginator {
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: none;
    margin-top: 0px;
}

.table-footer .paginator,
.table-footer nav.paginator,
.table-footer nav[role="navigation"] {
    border-top: none !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    padding: 0 !important;
}
/* ===== Paginator: bottoni base ===== */

.table-footer nav[role="navigation"] > button {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--app-border-color);
    background-color: rgba(255,255,255,0.04);
    color: var(--app-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative; /* necessario per ::before */
    overflow: hidden; /* uccide eventuali icone/immagini interne del componente */
    background-image: none !important;
}
    /* hover */

    .table-footer nav[role="navigation"] > button:hover:not(:disabled) {
        background-color: rgba(255,255,255,0.10);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }
    /* disabled */

    .table-footer nav[role="navigation"] > button:disabled {
        opacity: .35;
        cursor: not-allowed;
        background-color: transparent;
    }
    /* ===== QUI: le frecce "nostre" ===== */

    .table-footer nav[role="navigation"] > button::before { /* IMPORTANTISSIMO: segue sempre il colore del bottone (dark/hover/active) */
        color: currentColor;
        font-size: 16px;
        font-weight: 700;
        line-height: 1; /* centratura perfetta */
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        content: "";
    }
    /* mapping bottoni QuickGrid */

    .table-footer nav[role="navigation"] > button.go-first::before {
        content: "<<";
    }

    .table-footer nav[role="navigation"] > button.go-previous::before {
        content: "<";
    }

    .table-footer nav[role="navigation"] > button.go-next::before {
        content: "<";
    }

    .table-footer nav[role="navigation"] > button.go-last::before {
        content: "<<";
    }


/* ========================= MOBILE ========================= */

@media (max-width: 768px) {
    .table-footer {
        padding: 0.5rem 0.75rem;
    }

        .table-footer .text-muted {
            font-size: 0.8rem;
        }
}
/* ========================= RESPONSIVE ========================= */

@media (max-width: 768px) {
    .table-container table.items-table[theme="loondry"] thead th, .table-container table.items-table[theme="loondry"] tbody td {
        padding: 0.75rem 0.5rem;
    }
}


.pointer-events-none {
    pointer-events: none;
}