/* ===================================================
   CSS DASHBOARD MODERNO - VERSIONE FORZATA
   =================================================== */

/* Reset globale */
* {
    box-sizing: border-box !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background-color: #f8f9fa !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
}

/* === LAYOUT DASHBOARD === */
.dashboard-container {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
}

.dashboard-sidebar {
    width: 250px !important;
    background-color: #212529 !important;
    color: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
}

.sidebar-header {
    padding: 20px !important;
    text-align: center !important;
    border-bottom: 1px solid #343a40 !important;
}

.sidebar-header h3 {
    margin: 0 !important;
    color: #fff !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
}

.sidebar-nav {
    flex-grow: 1 !important;
    padding-top: 15px !important;
}

.sidebar-nav a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    color: #adb5bd !important;
    text-decoration: none !important;
    font-size: 0.95em !important;
    transition: all 0.2s !important;
}

.sidebar-nav a:hover {
    background-color: #343a40 !important;
    color: #fff !important;
}

.sidebar-nav a i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1em !important;
}

.notification-badge {
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 50% !important;
    padding: 2px 6px !important;
    font-size: 0.75em !important;
    font-weight: bold !important;
    margin-left: 8px !important;
    min-width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-footer {
    padding: 20px !important;
    border-top: 1px solid #343a40 !important;
}

.start-selling-btn {
    display: block !important;
    background-color: #28a745 !important;
    color: #fff !important;
    text-align: center !important;
    padding: 12px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
}

.logout-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #adb5bd !important;
    text-decoration: none !important;
    font-size: 0.9em !important;
}

/* === CONTENUTO PRINCIPALE === */
.dashboard-content {
    flex-grow: 1 !important;
    padding: 30px !important;
    background-color: #f8f9fa !important;
    min-height: 100vh !important;
}

.content-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    padding: 30px !important;
    border-radius: 15px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.content-header h2 {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    margin: 0 0 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    color: white !important;
}

.content-header p {
    font-size: 1.1rem !important;
    opacity: 0.9 !important;
    margin: 0 !important;
    color: white !important;
}

/* === GRID STATISTICHE === */
.dashboard-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 25px !important;
    margin-bottom: 40px !important;
}

.stat-card {
    background: white !important;
    border-radius: 15px !important;
    padding: 25px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    border: 1px solid #e3e6f0 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    position: relative !important;
    overflow: hidden !important;
}

.stat-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #4e73df, #224abe) !important;
}

.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
}

.stat-icon {
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #4e73df, #224abe) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    color: white !important;
    flex-shrink: 0 !important;
}

.stat-icon.pending {
    background: linear-gradient(135deg, #f6c23e, #dda20a) !important;
}

.stat-icon.completed {
    background: linear-gradient(135deg, #1cc88a, #13855c) !important;
}

.stat-icon.amount {
    background: linear-gradient(135deg, #36b9cc, #258391) !important;
}

.stat-icon.favorites {
    background: linear-gradient(135deg, #e74a3b, #c0392b) !important;
}

.stat-icon.messages {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

.stat-content {
    flex: 1 !important;
}

.stat-number {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    line-height: 1.2 !important;
    margin-bottom: 5px !important;
}

.stat-label {
    font-size: 0.95rem !important;
    color: #6c757d !important;
    font-weight: 500 !important;
}

/* === AZIONI RAPIDE === */
.quick-actions-section {
    margin-bottom: 40px !important;
}

.quick-actions-section h3 {
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 25px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.quick-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
}

.quick-action-card {
    background: white !important;
    border: 2px solid #e3e6f0 !important;
    border-radius: 12px !important;
    padding: 25px 20px !important;
    text-align: center !important;
    text-decoration: none !important;
    color: #2c3e50 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 120px !important;
    justify-content: center !important;
}

.quick-action-card:hover {
    border-color: #4e73df !important;
    background: #f8f9fc !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(78, 115, 223, 0.15) !important;
    color: #4e73df !important;
    text-decoration: none !important;
}

.quick-action-card i {
    font-size: 2rem !important;
    margin-bottom: 8px !important;
}

.quick-action-card span {
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

/* === CONTENT BOX === */
.content-box {
    background: white !important;
    border-radius: 15px !important;
    padding: 30px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    border: 1px solid #e3e6f0 !important;
    margin-bottom: 30px !important;
}

.content-box h3 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 0 25px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #f1f2f6 !important;
}

/* === TABELLE === */
.orders-table-container {
    overflow-x: auto !important;
    margin-bottom: 25px !important;
}

.orders-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
}

.orders-table th {
    background: #f8f9fc !important;
    color: #5a5c69 !important;
    font-weight: 600 !important;
    padding: 15px !important;
    text-align: left !important;
    border-bottom: 1px solid #e3e6f0 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.orders-table td {
    padding: 15px !important;
    border-bottom: 1px solid #e3e6f0 !important;
    vertical-align: middle !important;
}

.orders-table tbody tr:hover {
    background: #f8f9fc !important;
}

.amount {
    font-weight: 600 !important;
    color: #1cc88a !important;
    font-size: 1.05rem !important;
}

/* === STATUS BADGES === */
.status-badge {
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.status-pending {
    background: #fff3cd !important;
    color: #856404 !important;
}

.status-completed {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
}

/* === PULSANTI === */
.btn {
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: center !important;
    justify-content: center !important;
}

.btn-primary {
    background: linear-gradient(135deg, #4e73df, #224abe) !important;
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #224abe, #1e3a8a) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center !important;
    padding: 60px 20px !important;
    color: #6c757d !important;
}

.empty-state i {
    font-size: 4rem !important;
    color: #dee2e6 !important;
    margin-bottom: 20px !important;
}

.empty-state h4 {
    font-size: 1.4rem !important;
    color: #495057 !important;
    margin-bottom: 15px !important;
    font-weight: 600 !important;
}

.view-all-orders {
    text-align: center !important;
    margin-top: 25px !important;
    padding-top: 25px !important;
    border-top: 1px solid #e3e6f0 !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column !important;
    }
    
    .dashboard-sidebar {
        width: 100% !important;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .content-header {
        padding: 20px !important;
        text-align: center !important;
    }
    
    .content-header h2 {
        font-size: 1.8rem !important;
        justify-content: center !important;
    }
}

/* === SIDEBAR LISTS === */
.sidebar-section-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sidebar-section-list li a {
    display: flex !important;
    align-items: center !important;
    padding: 8px 20px !important;
    color: #adb5bd !important;
    text-decoration: none !important;
    font-size: 0.9em !important;
    transition: all 0.2s !important;
}

.sidebar-section-list li a:hover {
    background-color: #343a40 !important;
    color: #fff !important;
}

.sidebar-section-list li a i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1em !important;
}

/* === NOTIFICATION CONTAINER === */
.notification-container { 
    position: relative !important; 
}

.notifications-dropdown { 
    display: none !important; 
    position: absolute !important; 
    left: 260px !important; 
    top: 0 !important; 
    width: 350px !important; 
    background-color: #fff !important; 
    border-radius: 8px !important; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; 
    z-index: 1000 !important; 
    color: #333 !important; 
}

.notifications-dropdown.is-visible { 
    display: block !important; 
}
.container {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}
.profile-page-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.profile-sidebar {
    flex: 0 0 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 25px;
    position: sticky;
    top: 20px;
}
.profile-main-content {
    flex: 1 1 0;
    min-width: 0;
}
.profile-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}
.profile-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e9ecef;
}
.profile-header h1 {
    margin: 15px 0 5px 0;
    font-size: 1.8em;
    color: #343a40;
}
.profile-header .member-since {
    font-size: 0.9em;
    color: #6c757d;
}
.seller-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}
.stat-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.stat-item .stat-value {
    font-weight: 700;
    display: block;
    font-size: 1.5em;
    color: #007bff;
}
.stat-item .stat-label {
    font-size: 0.9em;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 5px;
}
.seller-categories-list {
    list-style: none;
    padding: 0;
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}
.seller-categories-list li a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #343a40;
    border-radius: 5px;
}
.seller-categories-list li a:hover {
    background-color: #e9ecef;
}
h2.section-title {
    margin-top: 0;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 300;
    font-size: 1.8em;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}
.product-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.product-image-link img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}
.product-card-content {
    padding: 15px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #222;
}
.product-card-content .price {
    color: #007bff;
    font-weight: bold;
    margin-bottom: 5px;
}
.product-card-content .stock {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 10px;
}
.product-card-actions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.actions-main a {
    background: #007bff;
    color: #fff;
    padding: 7px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.98em;
    transition: background 0.2s;
}
.actions-main a:hover {
    background: #0056b3;
}
.actions-secondary {
    display: flex;
    gap: 10px;
}
.actions-secondary a {
    background: #f0f0f0;
    color: #333;
    padding: 7px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.98em;
    transition: background 0.2s;
}
.actions-secondary a:hover {
    background: #e0e0e0;
}
@media (max-width: 768px) {
    .profile-page-layout {
        flex-direction: column;
    }
    .profile-sidebar {
        position: relative;
        top: auto;
        flex: 1 1 100%;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    h2.section-title {
        font-size: 1.5em;
    }
}
@media (max-width: 576px) {
    .container {
        padding: 20px;
    }
    .profile-header img {
        width: 100px;
        height: 100px;
    }
    .stat-item .stat-value {
        font-size: 1.2em;
    }
    .product-card-content h3 {
        font-size: 1em;
    }
    .actions-main a, .actions-secondary a {
        font-size: 0.9em;
        padding: 6px 12px;
    }
}

/* ========================================= */
/* == STILI PER LOGIN E REGISTRAZIONE == */
/* ========================================= */

body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.auth-container {
    max-width: 420px;
    width: 100%;
    margin: 20px;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}
.auth-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}
.auth-container button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
.auth-container button:hover {
    background-color: #0056b3;
}
.auth-container p {
    margin-top: 20px;
    color: #666;
}
.auth-container p a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.auth-container p a:hover {
    text-decoration: underline;
}
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================= */
/* === STILI PER DASHBOARD ACQUIRENTE === */
/* ========================================= */

body {
    background-color: #f8f9fa; /* Sfondo generale più chiaro */
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.dashboard-sidebar {
    width: 250px;
    background-color: #212529; /* Sfondo scuro come dashboard venditore */
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #343a40;
}

.sidebar-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2em;
}

.sidebar-nav {
    flex-grow: 1;
    padding-top: 15px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.95em;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
    background-color: #343a40;
    color: #fff;
}

.sidebar-nav a.active {
    background-color: #007bff;
    color: #fff;
    font-weight: bold;
}

.sidebar-nav a i {
    width: 30px; /* Allinea le icone */
    text-align: center;
    margin-right: 10px;
    font-size: 1.1em;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #343a40;
}

.start-selling-btn {
    display: block;
    background-color: #28a745; /* Verde per risaltare */
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-bottom: 15px;
}

.start-selling-btn:hover {
    background-color: #218838;
}

.start-selling-btn i {
    margin-right: 8px;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.9em;
}

.logout-link:hover {
    color: #fff;
}

.logout-link i {
    margin-right: 8px;
}


/* Stili per il contenuto principale della dashboard */
.dashboard-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #f8f9fa;
}

.content-header {
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 30px;
}

.content-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: #343a40;
}

.content-header p {
    margin: 5px 0 0;
    color: #6c757d;
}

.content-box {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #343a40;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

ul.order-list {
    list-style: none;
    padding: 0;
}

ul.order-list li {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

ul.order-list li:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.order-id { font-weight: bold; flex-basis: 120px; }
.order-total { flex-basis: 120px; color: #28a745; }
.order-status { flex-basis: 150px; }
.order-date { flex-grow: 1; color: #6c757d; text-align: right; }
.order-details-link {
    margin-left: 20px;
    padding: 5px 15px;
    background-color: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}
.order-details-link:hover {
    background-color: #5a6268;
}

.no-orders {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/*
=============================================
--- STILI PROFESSIONALI PER LA RICERCA TYPESENSE ---
=============================================
*/

/* Contenitore principale della ricerca */
#typesense-search-container {
    position: relative;
    width: 100%;
    max-width: 700px; /* Imposta una larghezza massima per un aspetto migliore */
    margin: 30px auto; /* Centra il contenitore */
}

/* La barra di ricerca vera e propria */
#typesense-searchbox {
    width: 100%;
    box-sizing: border-box; /* Assicura che padding e border non alterino la larghezza */
    padding: 15px 20px 15px 50px; /* Più spazio interno, specialmente a sinistra per l'icona */
    font-size: 1.1rem;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 50px; /* Angoli completamente arrotondati per un look moderno */
    background-color: #fff;
    
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none; /* Rimuove stili di default su iOS */
}

/* Effetto al focus sulla barra */
#typesense-searchbox:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}

/* Contenitore a tendina per i risultati */
#typesense-results {
    display: none;
    position: absolute;
    width: 100%;
    left: 0;
    top: calc(100% + 8px); /* Distanza dalla barra di ricerca */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* Angoli più arrotondati */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 1010;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px 0; /* Spazio interno sopra e sotto la lista */
}

/* Singolo elemento nei risultati */
.ts-result-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #343a40;
    padding: 12px 20px;
    border-bottom: none; /* Rimuoviamo il bordo di default */
    transition: background-color 0.2s ease;
    cursor: pointer;
}

/* Effetto hover sugli elementi */
.ts-result-item:hover {
    background-color: #f0f2f5;
    color: #0056b3;
}

/* Immagine del prodotto nel risultato */
.ts-result-item img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    margin-right: 18px;
    border-radius: 8px; /* Angoli arrotondati per l'immagine */
    background-color: #f0f0f0;
    border: 1px solid #eee;
}

/* Contenuto testuale (nome, prezzo) */
.ts-result-item .content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Titolo del prodotto */
.ts-result-item h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Aggiunge '...' se il testo è troppo lungo */
}

/* Prezzo del prodotto */
.ts-result-item p {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
    color: #007bff;
    font-weight: 500;
}

/* Messaggio "Nessun risultato" */
#typesense-results > div {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}
/* ================================================================ */
/* STILI AVANZATI PER "I MIEI PAGAMENTI A RATE" (my_installments.php) */
/* ================================================================ */

/* Card principale che contiene un intero ordine a rate */
.order-payment-card {
    display: flex;
    flex-wrap: wrap; /* Permette di andare a capo su schermi piccoli */
    gap: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 41, 112, 0.07); /* Un'ombra più morbida e profonda */
    margin-bottom: 35px;
    padding: 25px;
    border: 1px solid #eef2f9;
    transition: all 0.3s ease;
}
.order-payment-card:hover {
    box-shadow: 0 15px 40px rgba(0, 41, 112, 0.1);
    transform: translateY(-5px);
}

/* Colonna Sinistra: Immagine del Prodotto */
.order-payment-card__image-box {
    flex: 1 1 200px; /* Base di 200px, può crescere e restringersi */
    min-width: 200px;
}
.order-payment-card__image-box img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

/* Colonna Destra: Tutti i dettagli */
.order-payment-card__details-box {
    flex: 2 1 400px; /* Occupa il doppio dello spazio dell'immagine */
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #002970;
    margin: 0 0 10px 0;
}

.order-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #5a718d;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eef2f9;
}
.order-meta strong {
    color: #002970;
    font-weight: 600;
}

/* Storico delle rate (struttura a griglia) */
.installments-history {
    width: 100%;
}

.history-header, .installment-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr 1.5fr 2fr; /* Layout a 5 colonne */
    gap: 15px;
    align-items: center;
    padding: 10px 15px;
}

.history-header {
    font-weight: 700;
    color: #5a718d;
    font-size: 0.8em;
    text-transform: uppercase;
    border-bottom: 2px solid #eef2f9;
}

.installment-row {
    background-color: #fcfdff;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.95em;
    transition: background-color 0.2s;
}
.installment-row:hover {
    background-color: #f8fafc;
}

.installment-row [class^="cell-"] {
    display: flex;
    align-items: center;
}

.cell-importo {
    font-weight: 600;
    color: #333;
}

/* Badge per lo stato della rata */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    color: #fff;
    text-align: center;
}
.status-badge.status-paid { background-color: #28a745; }
.status-badge.status-pending { background-color: #ffc107; color: #333; }
.status-badge.status-overdue { background-color: #dc3545; }

/* I NUOVI BOTTONI PROFESSIONALI */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-payment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: white !important; /* Forza il colore del testo bianco */
}
.btn-payment i {
    font-size: 1.1em; /* Icona leggermente più grande del testo */
}
.btn-payment:hover {
    transform: translateY(-3px) scale(1.03); /* Effetto al passaggio del mouse */
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.1);
}

.btn-stripe {
    background: linear-gradient(45deg, #6772e5, #5469d4);
}
.btn-crypto {
    background: linear-gradient(45deg, #f7931a, #f9b115);
}

.cell-azione span {
    font-size: 1.5em;
    color: #28a745;
}

/* Adattabilità per schermi piccoli */
@media (max-width: 992px) {
    .order-payment-card__details-box {
        flex-basis: 100%; /* La colonna dei dettagli va a capo */
    }
    .history-header {
        display: none; /* Nasconde l'header su mobile per risparmiare spazio */
    }
    .installment-row {
        grid-template-columns: 1fr 1fr; /* Layout a 2 colonne su mobile */
        padding: 15px;
        gap: 20px 15px;
    }
    .installment-row [class^="cell-"]::before {
        content: attr(data-label); /* Usa l'attributo data-label come etichetta */
        font-weight: 700;
        color: #5a718d;
        display: block;
        margin-bottom: 5px;
    }
    .installment-row [class^="cell-"] {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .cell-azione {
        grid-column: 1 / -1; /* Occupa tutta la larghezza */
    }
    .action-buttons {
        width: 100%;
    }
    .action-buttons .btn-payment {
        flex-grow: 1; /* I bottoni occupano lo stesso spazio */
    }
}
/* ======================================================= */
/* STILI PER BOX DETTAGLIO RATE (order_details.php) */
/* ======================================================= */

.installments-info-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 30px;
    padding: 25px;
}

.installments-info-box h3.box-title {
    font-size: 1.5em;
    color: #343a40;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.credit-history {
    margin-bottom: 30px;
}

.credit-history h4 {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 15px;
}

.credit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-card .value {
    font-size: 2em;
    font-weight: 700;
    display: block;
}

.stat-card .label {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

/* Colori specifici per le statistiche */
.stat-card .value.paid { color: #28a745; }
.stat-card .value.pending { color: #ffc107; }
.stat-card .value.overdue { color: #dc3545; }

/* Tabella del piano rate */
.order-installments-plan table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden; /* Per arrotondare gli angoli della tabella */
    border: 1px solid #dee2e6;
}

.order-installments-plan th,
.order-installments-plan td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.order-installments-plan th {
    background-color: #f8f9fa;
}

.order-installments-plan tbody tr:last-child td {
    border-bottom: none;
}

/* Badge di stato (riutilizzati dalla pagina precedente) */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    color: #fff;
    text-align: center;
    display: inline-block;
}
.status-badge.status-paid { background-color: #28a745; }
.status-badge.status-pending { background-color: #ffc107; color: #333; }
.status-badge.status-overdue { background-color: #dc3545; }

/* === STILI DASHBOARD PROFESSIONALE ACQUIRENTE === */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    background: #007bff;
    color: white;
    font-size: 1.5em;
}

.stat-icon.pending { background: #ffc107; }
.stat-icon.completed { background: #28a745; }
.stat-icon.amount { background: #17a2b8; }
.stat-icon.favorites { background: #e74c3c; }
.stat-icon.messages { background: #6f42c1; }

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #343a40;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.quick-actions-section {
    margin-bottom: 30px;
}

.quick-actions-section h3 {
    color: #343a40;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-action-card {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quick-action-card:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    text-decoration: none;
}

.quick-action-card i {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.quick-action-card span {
    font-weight: 600;
    font-size: 0.9em;
}

.orders-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.orders-table th,
.orders-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-table td.amount {
    font-weight: 600;
    color: #28a745;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-outline-primary {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

.view-all-orders {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4em;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Responsive design per mobile */
@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        margin-right: 15px;
    }
    
    .stat-number {
        font-size: 1.6em;
    }
}

/* === OTTIMIZZAZIONI DASHBOARD POST-MIGRAZIONE === */
/* Assicura la compatibilità cross-browser */
.dashboard-stats-grid {
    display: -ms-grid !important; /* IE 10-11 */
    display: grid !important;
    -ms-grid-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

.stat-card {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
    -webkit-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.stat-card:hover {
    -webkit-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    transform: translateY(-5px);
}

/* Fix per flexbox su browser più vecchi */
.quick-actions-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 20px;
}

.quick-action-card {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(16.666% - 20px);
    flex: 0 0 calc(16.666% - 20px);
    min-width: 200px;
}

/* Assicura che le icone Font Awesome si carichino correttamente */
.fa, .fas, .far, .fal, .fab {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}