/* ============================================================
   DASHBOARD STRUMENTI � CSS
   Incluso via wp_enqueue_style in functions.php
   ============================================================ */

/* -- Contenuto WPBakery -- */
.dashboard-wpbakery-content {
    margin-bottom: 40px;
}

/* -- Contenitore principale -- */
.dashboard-custom-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* -- Selettore iniziale Strumenti/Artisti -- */
.dashboard-selettore {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px auto;
    padding: 0 20px;
    flex-wrap: wrap;
}
.dashboard-selettore-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    padding: 30px 40px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}
.dashboard-selettore-btn .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #3498db;
}
.dashboard-selettore-btn:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.dashboard-torna-selettore {
    display: inline-block;
    margin: 0 20px 20px 20px;
    padding: 14px 28px;
    background: #e74c3c;
    border: none;
    border-bottom: 4px solid #a5281b;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.35);
    transition: all 0.15s ease;
}
.dashboard-torna-selettore:hover {
    background: #d63e2c;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.45);
}
.dashboard-torna-selettore:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.35);
}

/* -- Header -- */
.dashboard-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 30px;
    margin: 0 0 30px 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.user-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
    justify-content: center;
}

/* -- Statistiche -- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-top: 4px solid #3498db;
}

.stat-card.disponibile { border-top-color: #27ae60; }
.stat-card.noleggiato  { border-top-color: #e67e22; }

.clickable-stat {
    cursor: pointer;
    transition: all 0.3s ease;
}
.clickable-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.clickable-stat.active-filter {
    box-shadow: 0 0 0 3px rgba(52,152,219,0.3), 0 5px 20px rgba(0,0,0,0.15);
}
.active-filter .stat-label            { font-weight: bold; }
.active-filter.disponibile .stat-label { color: #27ae60; }
.active-filter.noleggiato .stat-label  { color: #e67e22; }

.stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.filter-icon  { margin-right: 5px; font-size: 12px; }
.filter-hint  { display: block; font-size: 11px; color: #7f8c8d; margin-top: 5px; opacity: 0.7; transition: opacity 0.3s; }
.clickable-stat:hover .filter-hint { opacity: 1; }

/* -- Tabella -- */
.dashboard-table-container {
    background: white;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}
.dashboard-table-container h2 {
    padding: 0 20px 15px 20px;
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

/* -- Blocchi Vetrine Artisti (da approvare / pubblicate): separazione visiva -- */
.dashboard-blocco-pending,
.dashboard-blocco-pubblicate {
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    padding-bottom: 20px;
    margin-bottom: 35px;
}
.dashboard-blocco-pending:last-child,
.dashboard-blocco-pubblicate:last-child {
    margin-bottom: 0;
}

.dashboard-blocco-pending {
    background: #fff8ef;
    border: 1px solid #f5dfc0;
}
.dashboard-blocco-pubblicate {
    background: #f0f9f2;
    border: 1px solid #c9e8d1;
}

.dashboard-blocco-pending h2,
.dashboard-blocco-pubblicate h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 15px 20px;
}
.dashboard-blocco-pending h2 {
    color: #b9670f;
    border-bottom: 2px solid #f0d6ab;
}
.dashboard-blocco-pubblicate h2 {
    color: #1e8449;
    border-bottom: 2px solid #b9e0c3;
}
.dashboard-blocco-pending h2 .dashicons {
    color: #e67e22;
}
.dashboard-blocco-pubblicate h2 .dashicons {
    color: #27ae60;
}

.strumenti-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    box-sizing: border-box;
}
.strumenti-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}
.strumenti-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}
.strumenti-table tr:hover { background: #f8f9fa; }

.stato-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stato-badge.disponibile { background: #d4edda; color: #155724; }
.stato-badge.noleggiato  { background: #fff3cd; color: #856404; }

.scaduto            { color: #e74c3c; font-weight: bold; }
.deposito-ok        { color: #2e7d32; }
.deposito-restituito { color: #27ae60; }
.deposito-da-restituire { color: #e67e22; }

/* -- Bottoni -- */
.button {
    display: inline-block;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}
.button:hover { background: #2980b9; color: white; }
.button-small { padding: 6px 12px; font-size: 12px; margin-right: 5px; }
.button-primary { background: #2ecc71; }
.button-primary:hover { background: #27ae60; }
.azioni-rapide { margin-top: 8px; }

/* -- Vuoto -- */
.nessuno-strumento {
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    width: 100%;
    box-sizing: border-box;
}
.nessuno-strumento p { margin-bottom: 20px; color: #6c757d; }

/* ============================================================
   MODALI � stili condivisi
   ============================================================ */
.modale-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modale-overlay.aperta {
    display: flex;
}

.modale-box {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
}
.modale-box--large {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modale-chiudi {
    position: absolute;
    top: 15px; right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.modale-chiudi:hover { color: #333; }

.modale-titolo {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.modale-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* -- Campi form nelle modali -- */
.campo-gruppo        { margin-bottom: 20px; }
.campo-gruppo--sfondo { padding: 15px; background: #f8f9fa; border-radius: 6px; }
.campo-label         { display: block; margin-bottom: 8px; font-weight: 600; color: #444; }
.campo-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    background: white;
}
.campo-textarea      { resize: vertical; }
.campo-nota          { margin-top: 5px; font-size: 13px; color: #666; }
.campo-griglia-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.radio-gruppo        { display: flex; gap: 20px; }
.radio-opzione       { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-etichetta     { padding: 10px 20px; border-radius: 6px; font-weight: 500; border: 2px solid transparent; }
.radio-etichetta.disponibile { background: #f0f9f0; color: #155724; }
.radio-etichetta.noleggiato  { background: #fff9e6; color: #856404; }

.checkbox-opzione    { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.button-annulla {
    padding: 12px 25px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
}
.button-annulla:hover { background: #e2e6ea; }

.button-salva {
    padding: 12px 25px;
    background: #4CAF50;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    color: white;
    cursor: pointer;
}
.button-salva:hover    { background: #43a047; }
.button-salva:disabled { background: #a5d6a7; cursor: not-allowed; }

.messaggio-area { margin-bottom: 20px; }

/* -- Modale approvazione vetrina: galleria e audio -- */
.approva-galleria-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}
.approva-galleria-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}
.approva-galleria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.approva-galleria-rimuovi {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: white;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.approva-galleria-rimuovi:hover { background: #e74c3c; }

.approva-audio-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.approva-audio-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.approva-audio-etichetta {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    min-width: 60px;
}
.approva-audio-item audio { flex: 1; height: 32px; }
.approva-audio-rimuovi {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: white;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.approva-audio-rimuovi:hover { background: #e74c3c; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    body .dashboard-custom-container,
    body .dashboard-header,
    body .dashboard-stats,
    body .dashboard-table-container,
    body .strumenti-table {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .dashboard-selettore    { gap: 15px; margin: 25px auto; }
    .dashboard-selettore-btn { min-width: 140px; padding: 22px 20px; font-size: 16px; }
    .dashboard-torna-selettore { margin: 0 15px 12px 15px; }

    .dashboard-header   { padding: 25px 0 !important; margin-bottom: 20px; }
    .user-info          { flex-direction: column; gap: 8px; align-items: center; padding: 0 15px; font-size: 13px; }
    .dashboard-stats    { grid-template-columns: 1fr !important; gap: 12px; margin-bottom: 25px; padding: 0 15px !important; }
    .stat-card          { padding: 18px 15px !important; margin: 0 !important; }
    .stat-number        { font-size: 32px; }
    .stat-label         { font-size: 13px; }

    .dashboard-table-container h2 { padding: 20px 15px !important; font-size: 20px; }

    .strumenti-table         { display: block; }
    .strumenti-table thead   { display: none; }
    .strumenti-table tbody   { display: block; width: 100% !important; }
    .strumenti-table tr {
        display: block;
        width: 100% !important;
        margin-bottom: 15px;
        padding: 0 !important;
        background: white;
        border-bottom: 1px solid #e0e0e0 !important;
        border-radius: 0 !important;
    }
    .strumenti-table tr:last-child { margin-bottom: 0; border-bottom: none !important; }
    .strumenti-table td {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        padding: 12px 15px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-align: left;
        box-sizing: border-box;
    }
    .strumenti-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #2c3e50;
        font-size: 12px;
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .strumento-info  { padding-top: 15px !important; background: #f8f9fa; }
    .strumento-info::before  { content: "STRUMENTO"; color: #3498db; }
    .stato-cell::before      { content: "STATO"; color: #27ae60; }
    .data-cell::before       { content: "DATA RITORNO"; color: #e67e22; }
    .deposito-cell::before   { content: "DEPOSITO"; color: #9b59b6; }
    .azioni-cell::before     { content: "AZIONI"; color: #e74c3c; margin-bottom: 10px; }

    .azioni-cell     { gap: 8px; padding-top: 15px !important; padding-bottom: 15px !important; }
    .gestisci-stato-btn { width: 100% !important; padding: 12px !important; margin-bottom: 8px; }
    .azioni-rapide   { display: flex; flex-direction: column; gap: 8px; width: 100% !important; }
    .azioni-rapide .button-small { width: 100% !important; padding: 10px !important; text-align: center; }

    .stato-badge { padding: 8px 12px !important; margin-top: 5px; align-self: flex-start; }

    .campo-griglia-2 { grid-template-columns: 1fr; }
    .radio-gruppo    { flex-direction: column; gap: 10px; }

    body .page-content,
    body .content-area,
    body .site-content,
    body #content,
    body .entry-content,
    body .main-content {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1    { font-size: 22px; padding: 0 12px; }
    .dashboard-stats        { padding: 0 12px !important; }
    .stat-card              { padding: 15px 12px !important; }
    .stat-number            { font-size: 28px; }
    .dashboard-table-container h2 { padding: 15px 12px !important; font-size: 18px; }
    .strumenti-table td     { padding: 10px 12px !important; }
    .gestisci-stato-btn     { padding: 10px !important; font-size: 13px; }
    .azioni-rapide .button-small { padding: 8px !important; font-size: 12px; }
    .user-info              { padding: 0 12px; }
}

@media (min-width: 768px) {
    .dashboard-custom-container,
    .dashboard-header,
    .dashboard-table-container {
        max-width: 100% !important;
        border-radius: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* -- Date periodo noleggio -- */
.data-label-inline {
    color: #7f8c8d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.data-inizio {
    color: #2c3e50;
    font-weight: 500;
}

@media screen and (max-width: 778px) {
    #main > .wf-wrap { padding: 0 6px; }
}