/**
 * Stili condivisi per elenchi tabellari (DataTables) e card statistiche cliccabili
 * nelle pagine lista (allenamenti, abbonamenti, pagamenti, uscite, utenti, eventi, …).
 */

/* -------------------------------------------------------------------------- */
/* Card statistiche cliccabili (hover leggero)                                   */
/* -------------------------------------------------------------------------- */

.training-participants-cell.cursor-pointer {
    cursor: pointer;
}

.ts-stats-card.cursor-pointer,
.subscription-stats-card.cursor-pointer,
.payment-stats-card.cursor-pointer,
.expense-stats-card.cursor-pointer,
.booking-stats-card.cursor-pointer,
.users-stats-card.cursor-pointer,
.events-stats-card.cursor-pointer,
.ecommerce-order-stat-card.cursor-pointer {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ts-stats-card.cursor-pointer:hover,
.subscription-stats-card.cursor-pointer:hover,
.payment-stats-card.cursor-pointer:hover,
.expense-stats-card.cursor-pointer:hover,
.booking-stats-card.cursor-pointer:hover,
.users-stats-card.cursor-pointer:hover,
.events-stats-card.cursor-pointer:hover,
.ecommerce-order-stat-card.cursor-pointer:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* -------------------------------------------------------------------------- */
/* Allenamenti (training-sessions)                                            */
/* -------------------------------------------------------------------------- */

/* Colonna # più larga (≥5 caratteri), Azioni ancora più larga, le altre si dividono il resto */
.training-sessions .card-datatable table.datatables-training-sessions {
    table-layout: fixed;
    width: 100%;
}

.training-sessions table.datatables-training-sessions col:first-child {
    min-width: 5.5ch;
}

.training-sessions table.datatables-training-sessions thead th,
.training-sessions table.datatables-training-sessions tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.training-sessions table.datatables-training-sessions thead th:first-child,
.training-sessions table.datatables-training-sessions tbody td:first-child {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.training-sessions table.datatables-training-sessions thead th:last-child,
.training-sessions table.datatables-training-sessions tbody td:last-child {
    text-align: end;
}

.training-sessions table.datatables-training-sessions .ts-col-coach .avatar {
    margin-left: auto;
    margin-right: auto;
}

.training-sessions table.datatables-training-sessions .ts-col-location .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------------------- */
/* Abbonamenti (subscriptions)                                                */
/* -------------------------------------------------------------------------- */

.subscription .card-datatable table.datatables-subscriptions {
    table-layout: fixed;
    width: 100%;
}

.subscription table.datatables-subscriptions thead th,
.subscription table.datatables-subscriptions tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subscription table.datatables-subscriptions thead th:last-child,
.subscription table.datatables-subscriptions tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Pagamenti (payments)                                                       */
/* -------------------------------------------------------------------------- */

.payments .card-datatable table.datatables-payments {
    table-layout: fixed;
    width: 100%;
}

.payments table.datatables-payments thead th,
.payments table.datatables-payments tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments table.datatables-payments thead th:last-child,
.payments table.datatables-payments tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Uscite / spese (expenses)                                                  */
/* -------------------------------------------------------------------------- */

.expenses .card-datatable table.datatables-expenses {
    table-layout: fixed;
    width: 100%;
}

.expenses table.datatables-expenses thead th,
.expenses table.datatables-expenses tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expenses table.datatables-expenses thead th:last-child,
.expenses table.datatables-expenses tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Prenotazioni (bookings)                                                    */
/* -------------------------------------------------------------------------- */

.bookings .card-datatable table.datatables-bookings {
    table-layout: fixed;
    width: 100%;
}

.bookings table.datatables-bookings thead th,
.bookings table.datatables-bookings tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookings table.datatables-bookings thead th:last-child,
.bookings table.datatables-bookings tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Utenti (users)                                                             */
/* -------------------------------------------------------------------------- */

.users .table-responsive table.datatables-users {
    table-layout: fixed;
    width: 100%;
}

.users table.datatables-users thead th,
.users table.datatables-users tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users table.datatables-users thead th:last-child,
.users table.datatables-users tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* E-commerce articoli (products)                                             */
/* -------------------------------------------------------------------------- */

.ecommerce-products .card-datatable table.datatables-ecommerce-products {
    table-layout: fixed;
    width: 100%;
}

.ecommerce-products table.datatables-ecommerce-products thead th,
.ecommerce-products table.datatables-ecommerce-products tbody td {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ecommerce-products table.datatables-ecommerce-products thead th:last-child,
.ecommerce-products table.datatables-ecommerce-products tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* E-commerce ordini (orders)                                                 */
/* -------------------------------------------------------------------------- */

/* Sette colonne tutte della stessa larghezza (table-layout + colgroup) */
.ecommerce-orders .card-datatable table.datatables-ecommerce-orders {
    table-layout: fixed;
    width: 100% !important;
}

.ecommerce-orders table.datatables-ecommerce-orders colgroup col {
    width: calc(100% / 7);
}

.ecommerce-orders table.datatables-ecommerce-orders thead th,
.ecommerce-orders table.datatables-ecommerce-orders tbody td {
    vertical-align: middle;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ecommerce-orders table.datatables-ecommerce-orders thead th:nth-child(5),
.ecommerce-orders table.datatables-ecommerce-orders tbody td:nth-child(5),
.ecommerce-orders table.datatables-ecommerce-orders thead th:nth-child(6),
.ecommerce-orders table.datatables-ecommerce-orders tbody td:nth-child(6) {
    text-align: center;
}

.ecommerce-orders table.datatables-ecommerce-orders thead th:last-child,
.ecommerce-orders table.datatables-ecommerce-orders tbody td:last-child {
    text-align: end;
}

/* -------------------------------------------------------------------------- */
/* Audit log                                                                  */
/* -------------------------------------------------------------------------- */

.audits .card-datatable table#auditsTable {
    table-layout: fixed;
    width: 100%;
}

.audits .card-datatable table#auditsTable col.audit-col-equal {
    width: calc(100% / 7);
}

.audits .card-datatable table#auditsTable thead th,
.audits .card-datatable table#auditsTable tbody td {
    vertical-align: middle;
    word-break: break-word;
}
