/* FILE: style.css */
/* VERSIONE: 3.0 (Fix Sottolineature Link Dashboard) */

/* --- 1. IMPOSTAZIONI GENERALI --- */
body {
    background-color: #f4f6f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar */
.navbar-brand {
    letter-spacing: 1px;
}

/* --- 2. GESTIONE MOBILE & TABELLE --- */
.desktop-only { display: none; }

@media (min-width: 768px) {
    .desktop-only { display: table-cell !important; }
    .mobile-only-row { display: none !important; }
    .btn-expand-wrapper { display: none; }
    .header-container { display: flex; justify-content: space-between; align-items: center; }
    .header-actions { display: flex; gap: 10px; align-items: center; }
    .filter-form { display: flex; gap: 10px; align-items: center; }
}

@media (max-width: 767px) {
    .header-container { flex-direction: column; align-items: stretch !important; gap: 15px; }
    .header-actions { flex-direction: column-reverse; width: 100%; gap: 10px; }
    .filter-form { width: 100%; display: flex; gap: 5px; }
    .filter-select { width: 50%; }
    .btn-print-mobile { width: 100%; display: flex; justify-content: center; align-items: center; gap: 5px;}
}

/* Tasto Espandi */
.btn-expand { background: none; border: none; color: #0d6efd; font-size: 1.2rem; transition: transform 0.2s; padding: 0; }
.btn-expand.collapsed { transform: rotate(0deg); }
.btn-expand:not(.collapsed) { transform: rotate(180deg); }

/* Nascondi colonne */
.col-nascosta { display: none !important; }

/* --- 3. DASHBOARD WIDGETS (FIX SOTTOLINEATURA) --- */
/* Usa !important per forzare la rimozione della linea sotto ai link */
a.card-link {
    text-decoration: none !important; /* VIA LA SOTTOLINEATURA */
    color: inherit !important;       /* MANTIENI I COLORI ORIGINALI */
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

a.card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* --- 4. BOTTONI MODERNI --- */
.btn-modern-urgent {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    border: none;
    color: white !important;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none !important;
}

.btn-modern-urgent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.5);
    background: linear-gradient(135deg, #c82333 0%, #e63946 100%);
    color: white !important;
}

.btn-modern-normal {
    background: white;
    border: 1px solid #dc3545;
    color: #dc3545 !important;
    font-weight: 700;
    padding: 5px 15px;
    border-radius: 50px;
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none !important;
}

.btn-modern-normal:hover {
    background: #dc3545;
    color: white !important;
}

/* --- 5. PAGINE LOGIN & ERRORE --- */
.login-card, .error-card { border-radius: 15px; background: white; }
.login-card { max-width: 400px; width: 100%; padding: 2.5rem; }
.error-card { max-width: 450px; width: 90%; padding: 40px 30px; text-align: center; }

/* --- 6. STAMPA --- */
@media print {
    .no-print, nav, form, .btn, .actions-col, .btn-expand-wrapper, .card-header, .header-container { display: none !important; }
    .card { border: none !important; box-shadow: none !important; }
    body { background-color: white !important; }
    .container { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    table { font-size: 12px; width: 100%; display: table !important; }
    .desktop-only { display: table-cell !important; }
    tr { break-inside: avoid; }
    th { background-color: #eee !important; color: black !important; border: 1px solid #000; }
    td { border: 1px solid #000; }
    a { text-decoration: none; color: black; }
}

/* --- 7. SMART DATE INPUTS --- */
.smart-date-wrapper {
    position: relative;
    width: 100%;
}
.smart-date-text {
    letter-spacing: 0.5px;
}
.smart-date-btn-cal {
    border-color: #ced4da;
    background-color: #f8f9fa;
    color: #6c757d;
}
.smart-date-btn-cal:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* --- 8. VRT MODERN CALENDAR POPUP ENGINE --- */
.vrt-cal-popup {
    position: fixed;
    z-index: 999999;
    width: 320px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 14px;
    font-family: inherit;
    color: #212529;
    user-select: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    box-sizing: border-box;
}
.vrt-cal-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.vrt-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 12px;
}
.vrt-cal-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #495057;
    font-size: 13px;
    transition: all 0.15s ease;
    padding: 0;
}
.vrt-cal-nav-btn:hover {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}
.vrt-cal-selectors {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    justify-content: center;
}
.vrt-cal-select {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    background-color: #f8f9fa;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.vrt-cal-select:focus {
    border-color: #0d6efd;
}
.vrt-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.vrt-cal-weekdays span {
    padding: 4px 0;
}
.vrt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.vrt-cal-day {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid transparent;
    background: transparent;
    color: #212529;
    padding: 0;
}
.vrt-cal-day:hover {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 600;
}
.vrt-cal-day.today {
    border: 2px solid #0d6efd;
    color: #0d6efd;
    font-weight: 700;
}
.vrt-cal-day.selected {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.4);
}
.vrt-cal-day.other-month {
    color: #adb5bd;
    opacity: 0.45;
}
.vrt-cal-day.other-month:hover {
    opacity: 1;
    background-color: #f1f3f5;
    color: #495057;
}
.vrt-cal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.vrt-cal-footer-btn {
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.vrt-cal-btn-today {
    color: #0d6efd;
    background: #f0f7ff;
}
.vrt-cal-btn-today:hover {
    background: #dbeafe;
}
.vrt-cal-btn-clear {
    color: #dc3545;
    background: #fff5f5;
}
.vrt-cal-btn-clear:hover {
    background: #fee2e2;
}
.vrt-cal-btn-close {
    color: #6c757d;
}
.vrt-cal-btn-close:hover {
    background: #f3f4f6;
    color: #212529;
}
@media print {
    .vrt-cal-popup {
        display: none !important;
    }
}