/* 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;
}

/* 🔹 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;
}

.sd-cart-btn {
    background: #ffffff;
}

/* 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-gambling {
    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-type {
    min-width: 200px;
    flex: 0 0 200px;
}


/* 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;
}
#sd-table thead th.sd-sort-asc::after,
#sd-table thead th.sd-sort-desc::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    margin-top: -4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}
#sd-table thead th.sd-sort-asc::after {
    border-bottom: 6px solid #1976d2;
}
#sd-table thead th.sd-sort-desc::after {
    border-top: 6px solid #1976d2;
}

/* ----- 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;
}
