/* WRAPPER GENERALE */
#sites-dashboard {
    background: #f5f5f5;
    color: #222;
    padding: 16px;
    border-radius: 6px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border: 1px solid #ddd;
	width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 🔹 FILTRI COMPATTI IN ORIZZONTALE */

.sd-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 16px; /* row gap, column gap */
    margin-bottom: 12px;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0; /* niente spazio verticale extra */
}

/* la riga con i pulsanti va a destra */
.sd-filter-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* INPUT E SELECT */

.sd-filter-row input,
.sd-filter-row select {
    background: #ffffff;
    border: 1px solid #cfd8dc;
    color: #222;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    min-width: 400px;
}

#sd-search-site {
    min-width: 220px;
}

/* PULSANTI FILTRO */

.sd-filter-actions button,
.sd-filters button {
    background: #1976d2;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}

#sd-btn-reset {
    background: #757575;
}

/* WRAPPER TABELLA */

.sd-table-wrapper {
    margin-top: 8px;
    background: #ffffff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

/* EXPORT BUTTON */

.sd-export-btn {
    float: right;
    margin-bottom: 6px;
    background: #eeeeee;
    border: 1px solid #cfd8dc;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* TABELLA */

#sd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#sd-table thead {
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 11px;
}

#sd-table th,
#sd-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

#sd-table tbody tr:nth-child(even) {
    background: #fafafa;
}

#sd-table tbody tr:hover {
    background: #e3f2fd;
}

/* =========================
   BOTTONE CARRELLO (tabella)
   ========================= */
#sd-table .sd-add-cart{
  background: #1d73e8;
  color: #fff !important;
  border: 1px solid #155bb2;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

#sd-table .sd-add-cart:hover{
  filter: brightness(0.95);
}

#sd-table .sd-add-cart:active{
  transform: translateY(1px);
}


/* MODALE CARRELLO */

.sd-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.sd-modal-inner {
    background: #ffffff;
    padding: 18px;
    border-radius: 6px;
    width: 480px;
    max-width: 95%;
    border: 1px solid #e0e0e0;
}

.sd-modal-inner h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.sd-order-form input,
.sd-order-form textarea {
    width: 100%;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #cfd8dc;
    color: #222;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.sd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sd-modal-actions button {
    background: #1976d2;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
}

#sd-close-cart {
    background: #757575;
}

#sd-order-message {
    margin-top: 8px;
    font-size: 13px;
}

/* ELEMENTI CARRELLO */

.sd-cart-item {
    font-size: 13px;
    margin-bottom: 4px;
}

.sd-cart-item .sd-remove {
    margin-left: 6px;
    background: #e53935;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    padding: 0 6px;
    font-size: 11px;
}

#sd-filter-seo {
    min-width: 100px;
    max-width: 120px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

/* Riduco la larghezza dei campi numerici ZA / DA / TF / DR / AS / PRICE / SPECIAL */
#sd-filter-za,
#sd-filter-da,
#sd-filter-tf,
#sd-filter-dr,
#sd-filter-as {
    min-width: 60px;
    max-width: 70px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

#sd-filter-price,
#sd-filter-discount,
#sd-filter-special {
    min-width: 180px;
    max-width: 200px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

/* Riduco un po' anche gli altri campi per farci stare tutto in una riga larga */
#sd-filter-state,
#sd-filter-reg,
#sd-filter-adv,
#sd-filter-link_type,
#sd-filter-type {
    min-width: 220px;
    flex: 0 0 220px;
}


/* Ingrandisce il campo Note aggiuntive nel carrello */
#sd-order-notes {
    min-height: 250px !important;
    resize: vertical;
    font-size: 14px;
    padding: 10px;
}

/* Forza la dimensione del campo Note aggiuntive */
#sd-order-notes {
    min-height: 180px !important;
    height: 180px !important;
    max-height: none !important;
    padding: 12px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Cursor a mano sui titoli ordinabili */
#sd-table thead th {
    cursor: pointer;
    position: relative;
    padding-right: 16px; /* spazio per la freccia */
}

/* Prima colonna (carrello) non ordinabile */
#sd-table thead th:first-child {
    cursor: default;
}

#sd-table thead th {
    cursor: pointer;
    position: relative;
    padding-right: 16px;
}
#sd-table thead th:first-child {
    cursor: default;
}

/* ----- Frecce di ordinamento SEMPRE visibili ----- */

/* =========================
   HEADER COLONNE – TESTO + ICONA SOTTO
   ========================= */

/* icona default */
#sd-table thead th::after {
    content: "⇅";
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;       /* grigio leggibile */
    line-height: 1;
}

/* ordinamento ASC */
#sd-table thead th.sd-sort-asc::after {
    content: "▲";
	display: block;
	    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #1d73e8;
}

/* ordinamento DESC */
#sd-table thead th.sd-sort-desc::after {
    content: "▼";
	display: block;
	    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #1d73e8;
}

/* hover */
#sd-table thead th:hover::after {
    color: #0f172a;
}

/* colonna carrello: niente icona */
#sd-table thead th:first-child::after {
    content: "";
}

.sd-num-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sd-num-group .sd-op {
    width: 46px;
    min-width: 46px;
    padding: 4px 6px;
}

.sd-num-group input[type="number"] {
    min-width: 46px;
}

/* --- Contenitore generale filtri --- */
.sd-filters {
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* --- Righe dei filtri --- */
.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* --- SELECT e INPUT standard --- */
.sd-filter-row select,
.sd-filter-row input[type="text"],
.sd-filter-row input[type="number"] {
    padding: 6px 8px;
    height: 34px !important;   /* più piccoli */
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* --- CONTENITORE FILTRI NUMERICI (operatore + input) --- */
.sd-num-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

/* --- Label sopra il filtro numerico --- */
.sd-num-filter label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    width: 100%;
}

/* --- Operatore numerico --- */
.sd-num-filter select {
    width: 55px;               /* piccolo */
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

/* --- Input numerico --- */
.sd-num-filter input[type="number"] {
    width: 110px;
}

/* --- Pulsanti --- */
.sd-filter-actions button {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

#sd-btn-search {
    background: #0073aa;
    color: #fff;
}

#sd-btn-reset {
    background: #e5e5e5;
}

/* =========================
   BOTTONE CARRELLO
   ========================= */

.sd-cart-btn {
    background: #000000;          /* sfondo nero */
    color: #ffffff;               /* icona bianca */
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: background 0.2s ease, transform 0.15s ease;
}

/* se usi SVG o font-icon */
.sd-cart-btn svg,
.sd-cart-btn i {
    fill: #ffffff;
    color: #ffffff;
    font-size: 15px;
}

/* hover */
.sd-cart-btn:hover {
    background: #1f2933;          /* nero leggermente più chiaro */
    transform: scale(1.05);
}

/* focus (accessibilità) */
.sd-cart-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3);
}


/* --- Responsiveness --- */
@media (max-width: 768px) {
    .sd-num-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sd-num-filter input[type="number"] {
        width: 100%;
    }

    .sd-num-filter select {
        width: 100%;
    }
}

/* ---- Operatori numerici ultra-compatti ---- */

.sd-num-filter select {
    width: 30px !important;   /* prima era 55px */
    min-width: 30px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    text-align: center;
    font-size: 12px;
}

/* Riduci ulteriormente l'altezza */
.sd-num-filter select,
.sd-num-filter input[type="number"] {
    height: 28px !important;
    padding: 4px 6px !important;
}

/* Riduci spazi tra i filtri */
.sd-num-filter {
    gap: 4px !important;
    margin-right: 6px;
}

/* Contenitore tabella */
.sd-table-wrapper {
    margin-top: 15px;
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    
    /* 👇 importantissimo per non farla "uscire" a destra */
    overflow-x: auto;
    overflow-y: visible;
}

/* Assicura che non superi il contenitore esterno */
#sites-dashboard .sd-table-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}


/* Tabella principale */
#sd-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* se vuoi più compattezza puoi usare 'fixed' */
}

/* Celle più pulite */
#sd-table th,
#sd-table td {
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;     /* evita che vada a capo e allarghi righe a caso */
}

/* Intestazioni */
#sd-table th {
    background: #f5f5f5;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

/* righe */
#sd-table tr:nth-child(even) td {
    background: #fafafa;
}

@media (max-width: 768px) {
    #sd-table th,
    #sd-table td {
        font-size: 12px;
        padding: 4px 6px;
    }
}


#sd-table {
    width: 100% !important;   /* forza larghezza piena */
    min-width: 100% !important;
    border-collapse: collapse;
    table-layout: auto;        /* permette alle colonne di espandersi */
}

.sd-pagination-ajax {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
}

.sd-pagination-ajax .sd-page-btn-ajax:disabled {
    opacity: 0.4;
    cursor: default;
}

.sd-pagination-ajax .sd-page-info {
    font-size: 13px;
}

/* --- Paginazione AJAX: mostra solo PRECEDENTE / SUCCESSIVA --- */

/* stile base pulsanti paginazione */
.sd-pagination-ajax {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
}

/* disabilitati */
.sd-pagination-ajax .sd-page-btn-ajax[disabled] {
    opacity: 0.4;
    cursor: default;
}

/* testo centrale */
.sd-pagination-ajax .sd-page-info {
    font-size: 13px;
}

/* ❗ nasconde TUTTI i bottoni di paginazione
   che NON sono "pagina precedente" o "pagina successiva" */
.sd-pagination-ajax .sd-page-btn-ajax:not(.sd-page-prev):not(.sd-page-next) {
    display: none;
}


/* --- Pulsanti PREV / NEXT in blu --- */

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #1d73e8;
    background: #1d73e8;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

/* Hover */
.sd-pagination-ajax .sd-page-btn-ajax:hover:not([disabled]) {
    background: #155bb2;
    border-color: #155bb2;
}

/* Disabled */
.sd-pagination-ajax .sd-page-btn-ajax[disabled] {
    background: #9fc4f5;
    border-color: #9fc4f5;
    cursor: default;
    opacity: 0.7;
}

/* ---------------------------
   Riorganizzazione riga filtri
---------------------------- */

/* Ogni .sd-filter-row è una linea */
.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* Rende più compatti i blocchi numerici */
.sd-num-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* RIGA SPECIFICA: porta Price, Gambling e Discount su nuova riga */
.sd-filter-group-lower {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: -4px;
}

/* Ogni filtro occuperà uno spazio proporzionato */
.sd-filter-group-lower .sd-num-filter {
    min-width: 220px;
}

/* ---------------------------
   Pulsanti allineati a sinistra
---------------------------- */
.sd-filter-actions {
    display: flex;
    justify-content: flex-start;   /* allinea a sinistra */
    gap: 12px;
}

/* stile opzionale per migliorare l'aspetto */
.sd-filter-actions button {
    min-width: 90px;
}

/* Link "I miei ordini" vicino al carrello */
.sd-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sd-filter-actions button {
    margin: 0;
}

.sd-orders-link {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #2271b1;
    color: #2271b1;
    background: #f0f7ff;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sd-orders-link:hover {
    background: #2271b1;
    color: #fff;
    border-color: #1b5a8a;
}


/* ==============================
   TABELLA SITI – FIX OVERLAP
   ============================== */

/* Tabelle fluide ma leggibili */
#sd-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* INTESTAZIONI */
#sd-table thead th {
    color: #000 !important;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    vertical-align: middle;

    /* SOLO header va a capo */
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;

    padding: 8px 6px;
}

/* CELLE */
#sd-table tbody td {
    font-size: 13px;
    padding: 10px 8px;
    vertical-align: middle;

    /* ❗ EVITA SOVRAPPOSIZIONI */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colonna SITE più larga */
#sd-table thead th:nth-child(2),
#sd-table tbody td:nth-child(2) {
    width: 220px;
    white-space: normal;        /* il nome sito può andare a capo */
    word-break: break-word;
}

/* Colonne testuali medie */
#sd-table thead th:nth-child(3),
#sd-table thead th:nth-child(4),
#sd-table thead th:nth-child(5),
#sd-table tbody td:nth-child(3),
#sd-table tbody td:nth-child(4),
#sd-table tbody td:nth-child(5) {
    width: 100px;
}

/* Colonne metriche (ZA, DA, TF, DR, ecc.) */
#sd-table thead th:nth-child(n+9),
#sd-table tbody td:nth-child(n+9) {
    width: 70px;
    text-align: center;
}

/* Link sito */
#sd-table td a {
    word-break: break-word;
    color: #00a651;
}

.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}

/* Stato ordine (se lo usi) */
.sd-order-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.sd-order-status--pending {
    background: #fff7e6;
    color: #b35c00;
}

.sd-order-status--completed {
    background: #e6f9ea;
    color: #1e7e34;
}

.sd-order-status--cancelled {
    background: #fdeaea;
    color: #c0392b;
}

/* Link nell'elenco ordini */
.sd-orders-table a {
    color: #2271b1;
    text-decoration: none;
}

.sd-orders-table a:hover {
    text-decoration: underline;
}


/* =====================================================
   ORDINI – FULL WIDTH REALE (FIX FINALE)
   ===================================================== */



/* contenitore tabella */
.sd-orders-list {
    width: 100%;
    overflow-x: auto;
}

/* tabella */
.sd-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

/* HEADER */
.sd-orders-table thead th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 12px 10px;
    border-bottom: 2px solid #d1d5db;
    white-space: nowrap;
}

/* CELLE */
.sd-orders-table tbody td {
    padding: 10px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

/* RIGHE */
.sd-orders-table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}

/* =====================================================
   ORDINI – FULL WIDTH REALE (FIX FINALE)
   ===================================================== */

/* 🔥 Fa uscire la sezione ordini dal container del tema */
.sd-orders-fullwidth {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 24px; /* respiro ai lati */
    box-sizing: border-box;
}


/* contenitore tabella */
.sd-orders-list {
    width: 100%;
    overflow-x: auto;
}

/* tabella */
.sd-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

/* HEADER */
.sd-orders-table thead th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 12px 10px;
    border-bottom: 2px solid #d1d5db;
    white-space: nowrap;
}

/* CELLE */
.sd-orders-table tbody td {
    padding: 10px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

/* RIGHE */
.sd-orders-table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}

.sd-orders-table td,
.sd-orders-table th {
    white-space: normal;          /* permette il wrap */
    word-break: break-word;       /* spezza parole lunghe */
    overflow-wrap: anywhere;      /* spezza anche URL */
}

.sd-orders-table td details {
    max-width: 100%;
}

.sd-orders-table td details ul {
    padding-left: 18px;
    margin: 6px 0;
}

.sd-orders-table td details li {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.sd-orders-table a {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sd-orders-table td details summary {
    cursor: pointer;
    font-weight: 600;
}

.sd-orders-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

.sd-orders-table td:nth-child(7) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}


/* =====================================================
   ORDINI: esce dal container del tema (full width)
   ===================================================== */
.sd-orders-fullwidth{
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 24px;
    box-sizing: border-box;
}

/* contenitore tabella */
.sd-orders-list{
    width: 100%;
    max-width: 100%;
    overflow-x: visible;   /* niente scroll se ci sta */
}

/* tabella */
.sd-orders-table{
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;  /* IMPORTANTISSIMO: permette alla colonna 7 di “prendere il resto” */
}

/* colonne 1-6 compatte */
.sd-orders-table th:nth-child(-n+6),
.sd-orders-table td:nth-child(-n+6){
    white-space: nowrap;
}

/* colonna 7 (Dettagli) prende il resto e va a capo */
.sd-orders-table th:nth-child(7),
.sd-orders-table td:nth-child(7){
    width: auto;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* anche i link dentro Dettagli vanno a capo */
.sd-orders-table td:nth-child(7) a{
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* WRAPPER GENERALE */
#sites-dashboard {
    background: #f5f5f5;
    color: #222;
    padding: 16px;
    border-radius: 6px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border: 1px solid #ddd;
	width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}



/* 🔹 FILTRI COMPATTI IN ORIZZONTALE */

.sd-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 16px; /* row gap, column gap */
    margin-bottom: 12px;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0; /* niente spazio verticale extra */
}

/* la riga con i pulsanti va a destra */
.sd-filter-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* INPUT E SELECT */

.sd-filter-row input,
.sd-filter-row select {
    background: #ffffff;
    border: 1px solid #cfd8dc;
    color: #222;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    min-width: 400px;
}

#sd-search-site {
    min-width: 220px;
}

/* PULSANTI FILTRO */

.sd-filter-actions button,
.sd-filters button {
    background: #1976d2;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}

#sd-btn-reset {
    background: #757575;
}


/* WRAPPER TABELLA */

.sd-table-wrapper {
    margin-top: 8px;
    background: #ffffff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

/* EXPORT BUTTON */

.sd-export-btn {
    float: right;
    margin-bottom: 6px;
    background: #eeeeee;
    border: 1px solid #cfd8dc;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* TABELLA */

#sd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#sd-table thead {
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 11px;
}

#sd-table th,
#sd-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

#sd-table tbody tr:nth-child(even) {
    background: #fafafa;
}

#sd-table tbody tr:hover {
    background: #e3f2fd;
}

/* BOTTONE CARRELLO IN TABELLA */

.sd-add-cart {
    background: #ffffff;
    border: none;
    padding: 4px 7px;
    border-radius: 3px;
    cursor: pointer;
    color: #fff;
    font-size: 12px;
}

/* MODALE CARRELLO */

.sd-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.sd-modal-inner {
    background: #ffffff;
    padding: 18px;
    border-radius: 6px;
    width: 480px;
    max-width: 95%;
    border: 1px solid #e0e0e0;
}

.sd-modal-inner h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.sd-order-form input,
.sd-order-form textarea {
    width: 100%;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #cfd8dc;
    color: #222;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.sd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sd-modal-actions button {
    background: #1976d2;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
}

#sd-close-cart {
    background: #757575;
}

#sd-order-message {
    margin-top: 8px;
    font-size: 13px;
}

/* ELEMENTI CARRELLO */

.sd-cart-item {
    font-size: 13px;
    margin-bottom: 4px;
}

.sd-cart-item .sd-remove {
    margin-left: 6px;
    background: #e53935;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    padding: 0 6px;
    font-size: 11px;
}

#sd-filter-seo {
    min-width: 100px;
    max-width: 120px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

/* Riduco la larghezza dei campi numerici ZA / DA / TF / DR / AS / PRICE / SPECIAL */
#sd-filter-za,
#sd-filter-da,
#sd-filter-tf,
#sd-filter-dr,
#sd-filter-as {
    min-width: 60px;
    max-width: 70px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

#sd-filter-price,
#sd-filter-discount,
#sd-filter-special {
    min-width: 180px;
    max-width: 200px;
    flex: 0 0 60px;
    padding: 4px 6px;
    font-size: 12px;
}

/* Riduco un po' anche gli altri campi per farci stare tutto in una riga larga */
#sd-filter-state,
#sd-filter-reg,
#sd-filter-adv,
#sd-filter-link_type,
#sd-filter-type {
    min-width: 220px;
    flex: 0 0 220px;
}


/* Ingrandisce il campo Note aggiuntive nel carrello */
#sd-order-notes {
    min-height: 250px !important;
    resize: vertical;
    font-size: 14px;
    padding: 10px;
}

/* Forza la dimensione del campo Note aggiuntive */
#sd-order-notes {
    min-height: 180px !important;
    height: 180px !important;
    max-height: none !important;
    padding: 12px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Cursor a mano sui titoli ordinabili */
#sd-table thead th {
    cursor: pointer;
    position: relative;
    padding-right: 16px; /* spazio per la freccia */
}

/* Prima colonna (carrello) non ordinabile */
#sd-table thead th:first-child {
    cursor: default;
}

#sd-table thead th {
    cursor: pointer;
    position: relative;
    padding-right: 16px;
}
#sd-table thead th:first-child {
    cursor: default;
}

/* ----- Frecce di ordinamento SEMPRE visibili ----- */

/* Stile base (freccia doppia grigia) */
#sd-table thead th::after {
    content: '⇅';
    font-size: 10px;
    color: #aaa;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

/* Freccia ordinamento ASC attiva */
#sd-table thead th.sd-sort-asc::after {
    content: '▲';
    color: #1976d2;
}

/* Freccia ordinamento DESC attiva */
#sd-table thead th.sd-sort-desc::after {
    content: '▼';
    color: #1976d2;
}

/* Colonna carrello NON ordinabile → nessuna freccia */
#sd-table thead th:first-child::after {
    content: '' !important;
}

.sd-num-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sd-num-group .sd-op {
    width: 46px;
    min-width: 46px;
    padding: 4px 6px;
}

.sd-num-group input[type="number"] {
    min-width: 46px;
}

/* --- Contenitore generale filtri --- */
.sd-filters {
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* --- Righe dei filtri --- */
.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* --- SELECT e INPUT standard --- */
.sd-filter-row select,
.sd-filter-row input[type="text"],
.sd-filter-row input[type="number"] {
    padding: 6px 8px;
    height: 34px !important;   /* più piccoli */
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* --- CONTENITORE FILTRI NUMERICI (operatore + input) --- */
.sd-num-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

/* --- Label sopra il filtro numerico --- */
.sd-num-filter label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    width: 100%;
}

/* --- Operatore numerico --- */
.sd-num-filter select {
    width: 55px;               /* piccolo */
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

/* --- Input numerico --- */
.sd-num-filter input[type="number"] {
    width: 110px;
}

/* --- Pulsanti --- */
.sd-filter-actions button {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

#sd-btn-search {
    background: #0073aa;
    color: #fff;
}

#sd-btn-reset {
    background: #e5e5e5;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    .sd-num-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sd-num-filter input[type="number"] {
        width: 100%;
    }

    .sd-num-filter select {
        width: 100%;
    }
}

/* ---- Operatori numerici ultra-compatti ---- */

.sd-num-filter select {
    width: 30px !important;   /* prima era 55px */
    min-width: 30px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    text-align: center;
    font-size: 12px;
}

/* Riduci ulteriormente l'altezza */
.sd-num-filter select,
.sd-num-filter input[type="number"] {
    height: 28px !important;
    padding: 4px 6px !important;
}

/* Riduci spazi tra i filtri */
.sd-num-filter {
    gap: 4px !important;
    margin-right: 6px;
}

/* Contenitore tabella */
.sd-table-wrapper {
    margin-top: 15px;
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    
    /* 👇 importantissimo per non farla "uscire" a destra */
    overflow-x: auto;
    overflow-y: visible;
}

/* Assicura che non superi il contenitore esterno */
#sites-dashboard .sd-table-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}


/* Tabella principale */
#sd-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* se vuoi più compattezza puoi usare 'fixed' */
}

/* Celle più pulite */
#sd-table th,
#sd-table td {
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;     /* evita che vada a capo e allarghi righe a caso */
}

/* Intestazioni */
#sd-table th {
    background: #f5f5f5;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

/* righe */
#sd-table tr:nth-child(even) td {
    background: #fafafa;
}

@media (max-width: 768px) {
    #sd-table th,
    #sd-table td {
        font-size: 12px;
        padding: 4px 6px;
    }
}


#sd-table {
    width: 100% !important;   /* forza larghezza piena */
    min-width: 100% !important;
    border-collapse: collapse;
    table-layout: auto;        /* permette alle colonne di espandersi */
}

.sd-pagination-ajax {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
}

.sd-pagination-ajax .sd-page-btn-ajax:disabled {
    opacity: 0.4;
    cursor: default;
}

.sd-pagination-ajax .sd-page-info {
    font-size: 13px;
}

/* --- Paginazione AJAX: mostra solo PRECEDENTE / SUCCESSIVA --- */

/* stile base pulsanti paginazione */
.sd-pagination-ajax {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
}

/* disabilitati */
.sd-pagination-ajax .sd-page-btn-ajax[disabled] {
    opacity: 0.4;
    cursor: default;
}

/* testo centrale */
.sd-pagination-ajax .sd-page-info {
    font-size: 13px;
}

/* ❗ nasconde TUTTI i bottoni di paginazione
   che NON sono "pagina precedente" o "pagina successiva" */
.sd-pagination-ajax .sd-page-btn-ajax:not(.sd-page-prev):not(.sd-page-next) {
    display: none;
}


/* --- Pulsanti PREV / NEXT in blu --- */

.sd-pagination-ajax .sd-page-btn-ajax {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #1d73e8;
    background: #1d73e8;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

/* Hover */
.sd-pagination-ajax .sd-page-btn-ajax:hover:not([disabled]) {
    background: #155bb2;
    border-color: #155bb2;
}

/* Disabled */
.sd-pagination-ajax .sd-page-btn-ajax[disabled] {
    background: #9fc4f5;
    border-color: #9fc4f5;
    cursor: default;
    opacity: 0.7;
}

/* ---------------------------
   Riorganizzazione riga filtri
---------------------------- */

/* Ogni .sd-filter-row è una linea */
.sd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* Rende più compatti i blocchi numerici */
.sd-num-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* RIGA SPECIFICA: porta Price, Gambling e Discount su nuova riga */
.sd-filter-group-lower {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: -4px;
}

/* Ogni filtro occuperà uno spazio proporzionato */
.sd-filter-group-lower .sd-num-filter {
    min-width: 220px;
}

/* ---------------------------
   Pulsanti allineati a sinistra
---------------------------- */
.sd-filter-actions {
    display: flex;
    justify-content: flex-start;   /* allinea a sinistra */
    gap: 12px;
}

/* stile opzionale per migliorare l'aspetto */
.sd-filter-actions button {
    min-width: 90px;
}

/* Link "I miei ordini" vicino al carrello */
.sd-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sd-filter-actions button {
    margin: 0;
}

.sd-orders-link {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #2271b1;
    color: #2271b1;
    background: #f0f7ff;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sd-orders-link:hover {
    background: #2271b1;
    color: #fff;
    border-color: #1b5a8a;
}


/* ==============================
   TABELLA SITI – FIX OVERLAP
   ============================== */

/* Tabelle fluide ma leggibili */
#sd-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* INTESTAZIONI */
#sd-table thead th {
    color: #000 !important;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    vertical-align: middle;

    /* SOLO header va a capo */
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;

    padding: 8px 6px;
}

/* CELLE */
#sd-table tbody td {
    font-size: 13px;
    padding: 10px 8px;
    vertical-align: middle;

    /* ❗ EVITA SOVRAPPOSIZIONI */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colonna SITE più larga */
#sd-table thead th:nth-child(2),
#sd-table tbody td:nth-child(2) {
    width: 220px;
    white-space: normal;        /* il nome sito può andare a capo */
    word-break: break-word;
}

/* Colonne testuali medie */
#sd-table thead th:nth-child(3),
#sd-table thead th:nth-child(4),
#sd-table thead th:nth-child(5),
#sd-table tbody td:nth-child(3),
#sd-table tbody td:nth-child(4),
#sd-table tbody td:nth-child(5) {
    width: 100px;
}

/* Colonne metriche (ZA, DA, TF, DR, ecc.) */
#sd-table thead th:nth-child(n+9),
#sd-table tbody td:nth-child(n+9) {
    width: 70px;
    text-align: center;
}

/* Link sito */
#sd-table td a {
    word-break: break-word;
    color: #00a651;
}

.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}

/* Stato ordine (se lo usi) */
.sd-order-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.sd-order-status--pending {
    background: #fff7e6;
    color: #b35c00;
}

.sd-order-status--completed {
    background: #e6f9ea;
    color: #1e7e34;
}

.sd-order-status--cancelled {
    background: #fdeaea;
    color: #c0392b;
}

/* Link nell'elenco ordini */
.sd-orders-table a {
    color: #2271b1;
    text-decoration: none;
}

.sd-orders-table a:hover {
    text-decoration: underline;
}


/* =====================================================
   ORDINI – FULL WIDTH REALE (FIX FINALE)
   ===================================================== */



/* contenitore tabella */
.sd-orders-list {
    width: 100%;
    overflow-x: auto;
}

/* tabella */
.sd-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

/* HEADER */
.sd-orders-table thead th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 12px 10px;
    border-bottom: 2px solid #d1d5db;
    white-space: nowrap;
}

/* CELLE */
.sd-orders-table tbody td {
    padding: 10px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

/* RIGHE */
.sd-orders-table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}

/* =====================================================
   ORDINI – FULL WIDTH REALE (FIX FINALE)
   ===================================================== */

/* 🔥 Fa uscire la sezione ordini dal container del tema */
.sd-orders-fullwidth {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 24px; /* respiro ai lati */
    box-sizing: border-box;
}


/* contenitore tabella */
.sd-orders-list {
    width: 100%;
    overflow-x: auto;
}

/* tabella */
.sd-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

/* HEADER */
.sd-orders-table thead th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 12px 10px;
    border-bottom: 2px solid #d1d5db;
    white-space: nowrap;
}

/* CELLE */
.sd-orders-table tbody td {
    padding: 10px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

/* RIGHE */
.sd-orders-table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.sd-orders-table tbody tr:hover {
    background: #eef6ff;
}


/* 🔥 Sblocca il contenitore del tema SOLO per la tabella ordini */
.sd-orders-list {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* forza lo scroll anche se il tema lo nasconde */
.sd-orders-list {
    overflow-x: auto !important;
}

/* tabella larga quanto serve */
.sd-orders-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

/* forza sblocco overflow del contenitore del tema */
.entry-content,
.entry-content > *,
.wp-site-blocks,
.site-content,
.container,
.wrap {
    overflow-x: visible;
}

/* ma SOLO la tabella fa scroll */
.sd-orders-list {
    overflow-x: auto;
}

.sd-orders-table td,
.sd-orders-table th {
    white-space: normal;          /* permette il wrap */
    word-break: break-word;       /* spezza parole lunghe */
    overflow-wrap: anywhere;      /* spezza anche URL */
}

.sd-orders-table td details {
    max-width: 100%;
}

.sd-orders-table td details ul {
    padding-left: 18px;
    margin: 6px 0;
}

.sd-orders-table td details li {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.sd-orders-table a {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sd-orders-table td details summary {
    cursor: pointer;
    font-weight: 600;
}

.sd-orders-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

.sd-orders-table td:nth-child(7) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sd-orders-fullwidth{
    transform: none !important;
}

/* Colonna DATE: non troncare */
#sd-table th:last-child,
#sd-table td:last-child{
  min-width: 110px;          /* aumenta se vuoi */
  width: 110px;
  white-space: nowrap;
}

/* Evita che la tabella tagli l’ultima colonna */
#sd-table{
  table-layout: auto !important;
}

#sites-dashboard .sd-table-wrapper{
  overflow-x: auto;          /* se serve scroll solo quando necessario */
}


#sd-table td:last-child{
  overflow: visible !important;
  text-overflow: clip !important;
}



/* =====================================================
   FIX SOLO: BOTTONE "AGGIUNGI AL CARRELLO" + ICONE SORT
   (senza toccare il resto del file)
   ===================================================== */

/* 1) Bottone aggiungi al carrello: icona bianca su sfondo nero + mai tagliato */
#sd-table .sd-add-cart{
  background: #000 !important;
  border: 1px solid #000 !important;
  color: #fff !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;

  border-radius: 8px !important;
  line-height: 1 !important;
  font-size: 16px !important;

  box-shadow: 0 1px 2px rgba(0,0,0,.12) !important;
}

/* Se dentro hai SVG o <i> (FontAwesome, ecc.) */
#sd-table .sd-add-cart svg,
#sd-table .sd-add-cart i{
  fill: #fff !important;
  color: #fff !important;
  font-size: 16px !important;
}

/* Evita che la cella col bottone lo tronchi (nel tuo CSS c'è overflow:hidden) */
#sd-table tbody td:first-child{
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Hover/active coerenti */
#sd-table .sd-add-cart:hover{
  background: #111 !important;
  border-color: #111 !important;
  filter: none !important;
}

#sd-table .sd-add-cart:active{
  transform: translateY(1px) !important;
}


/* 2) Icone ordinamento: SOTTO al testo (no a destra) + più leggibili */
#sd-table thead th{
  padding-right: 0 !important; /* niente spazio a destra */
}

/* Reset totale dell'icona a destra impostata da altri blocchi */
#sd-table thead th::after{
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;

  display: block !important;
  margin-top: 4px !important;

  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  color: #64748b !important; /* grigio più visibile */
  content: "⇅" !important;
}

/* Stato ASC/DESC in blu */
#sd-table thead th.sd-sort-asc::after{
  content: "▲" !important;
  color: #1d73e8 !important;
}

#sd-table thead th.sd-sort-desc::after{
  content: "▼" !important;
  color: #1d73e8 !important;
}

/* Hover più evidente */
#sd-table thead th:hover::after{
  color: #0f172a !important;
}

/* Colonna carrello: nessuna icona */
#sd-table thead th:first-child::after{
  content: "" !important;
}

/* FIX: toglie barra/triangolo blu senza toccare le tue icone testuali */
#sd-table thead th.sd-sort-asc::before,
#sd-table thead th.sd-sort-desc::before{
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

#sd-table thead th.sd-sort-asc,
#sd-table thead th.sd-sort-desc{
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.sd-link-badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.sd-link-badge--ok{ background:#e6f9ea; color:#1e7e34; }
.sd-link-badge--ko{ background:#fdeaea; color:#c0392b; }
.sd-link-badge--na{ background:#f3f4f6; color:#374151; }
