/* Prevent horizontal overflow on all devices */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* --- Reset e Stili Globali --- */
:root {
    --primary-color: #0d6efd; /* Un blu più vibrante */
    --primary-hover: #0b5ed7;
    --text-color: #212529;
    --text-muted: #6c757d;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --sidebar-bg: #ffffff;
    --sidebar-text: #343a40;
    --sidebar-active-bg: #e7f1ff;
    --sidebar-active-text: var(--primary-color);
    --success-color: #198754;
    --danger-color: #dc3545;
    --white: #fff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
    --card-shadow-hover: 0 5px 15px rgba(0,0,0,0.1);
}

/* Icon CTA buttons (shared editor + live) */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

/* Button variants driven by data-icon (rendered elements) */
.btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}
.btn[data-icon="instagram"] {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border: none;
    color: white;
}
.btn[data-icon="telegram"] { background-color: #0088cc; border: none; color: white; }
.btn[data-icon="whatsapp"] { background-color: #25D366; border: none; color: white; }
.btn[data-icon="download"] { background-color: #2563eb; border: none; color: white; }
.btn[data-icon="calendar"] { background-color: #4f46e5; border: none; color: white; }
.btn[data-icon="mail"] { background-color: #ea580c; border: none; color: white; }
.btn[data-icon="phone"] { background-color: #16a34a; border: none; color: white; }
.btn[data-icon="pdf"] { background-color: #dc2626; border: none; color: white; }
.btn[data-icon="appstore"] { background-color: #000000; border: none; color: white; }
.btn[data-icon="appstore"] svg { fill: currentColor; stroke: none; }
.btn[data-icon="playstore"] { background-color: #01875f; border: none; color: white; }
.btn[data-icon="playstore"] svg { fill: currentColor; stroke: none; }
.btn[data-icon="windows"] { background-color: #0078D4; border: none; color: white; }
.btn[data-icon="windows"] svg { fill: currentColor; stroke: none; }
.btn[data-icon]:hover { filter: brightness(110%); transform: translateY(-1px); }
.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.icon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.icon-button.active {
    border-color: #000;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
}
.icon-button svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}
/* Color variants */
.icon-button[data-icon="download"] { background-color: #2563eb; }
.icon-button[data-icon="instagram"] { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.icon-button[data-icon="telegram"] { background-color: #0088cc; }
.icon-button[data-icon="whatsapp"] { background-color: #25D366; }
.icon-button[data-icon="calendar"] { background-color: #4f46e5; }
.icon-button[data-icon="mail"] { background-color: #ea580c; }
.icon-button[data-icon="phone"] { background-color: #16a34a; }
.icon-button[data-icon="pdf"] { background-color: #dc2626; }
.icon-button[data-icon="appstore"] { background-color: #000000; }
.icon-button[data-icon="playstore"] { background-color: #01875f; }
.icon-button[data-icon="windows"] { background-color: #0078D4; }
.icon-button[data-icon="windows"] svg { fill: white; stroke: none; }
.icon-button[data-icon="gmail"] { background-color: #EA4335; }
.icon-button[data-icon="gmail"] svg { fill: none; stroke: none; }
.icon-button[data-icon="facebook"] { background-color: #1877F2; }
.icon-button[data-icon="facebook"] svg { fill: white; stroke: none; }
.icon-button[data-icon="messenger"] { background-color: #0084FF; }
.icon-button[data-icon="messenger"] svg { fill: white; stroke: none; }
.icon-button[data-icon="twitter"] { background-color: #000000; }
.icon-button[data-icon="twitter"] svg { fill: white; stroke: none; }
.icon-button[data-icon="linkedin"] { background-color: #0A66C2; }
.icon-button[data-icon="linkedin"] svg { fill: white; stroke: none; }
.icon-button[data-icon="youtube"] { background-color: #FF0000; }
.icon-button[data-icon="youtube"] svg { fill: white; stroke: none; }
.icon-button[data-icon="tiktok"] { background-color: #000000; }
.icon-button[data-icon="tiktok"] svg { fill: white; stroke: none; }
.icon-button.custom-icon-upload { background-color: #6b7280; border: 2px dashed #9ca3af; }
.icon-button.custom-icon-upload svg { fill: white; stroke: none; }
.icon-button.custom-icon { background-color: #2563eb; }
#form-step-2 input.form-control,
#form-step-2 textarea.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-color);
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* --- Pagina di Autenticazione (index.html) --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #eef2f7;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 1rem;
    min-height: 1.25rem;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 1rem;
    min-height: 1.25rem;
    padding: 0.75rem;
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 0.375rem;
}

.form-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.form-separator:not(:empty)::before {
    margin-right: .5em;
}

.form-separator:not(:empty)::after {
    margin-left: .5em;
}

.auth-redirect {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-redirect a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.auth-redirect a:hover {
    text-decoration: underline;
}

/* --- Layout Contenuto Principale --- */
.main-content {
    flex: 1;
    min-width: 0; /* Aggiunto per prevenire overflow con contenuti larghi */
    padding: 2rem;
    box-sizing: border-box;
    transition: margin-left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Quando la sidebar è visibile su desktop, sposta il contenuto */
@media (min-width: 993px) {
    .main-content {
        margin-left: 260px;
    }
}


/* --- Stili Modali Generici --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 37, 41, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050; /* Aumentato z-index per essere sicuri che sia sopra tutto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s; /* Transizione per nascondere */
    padding: 1rem; /* Aggiunge padding per mobile */
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease; /* Transizione per mostrare */
}

.modal-content {
    background: white;
    padding: 2rem; /* 32px */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content.modal-sm {
    max-width: 450px;
}

.modal-icon {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.modal-icon svg {
    width: 64px;
    height: 64px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.modal-actions-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-actions-right .btn {
    padding: 12px 20px;
    font-weight: 600;
    min-height: 44px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-actions-right .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal-actions-right .btn.btn-primary {
    background: #007bff;
    border: none;
    color: white;
}

.modal-actions-right .btn.btn-primary:hover {
    background: #0056b3;
}

.modal-actions-right .btn.btn-secondary {
    background: #6c757d;
    border: none;
    color: white;
}

.modal-actions-right .btn.btn-secondary:hover {
    background: #545b62;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--text-color);
}

.form-feedback {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 1rem;
    border: 1px solid transparent;
    display: none; /* Hidden by default */
}

.form-feedback.success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
    display: block;
}

.form-feedback.error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
    display: block;
}

.form-feedback.info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #055160;
    display: block;
}

.form-feedback.visible {
    display: block;
}

.form-feedback a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.form-feedback.error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}


/* --- Stili Form Moderni e Coerenti --- */

.form-group, .form-row {
    margin-bottom: 1.5rem;
}

.form-group label, .form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    background-color: var(--white);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 8px;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control:focus {
    color: var(--text-color);
    background-color: var(--white);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
}

/* Stile per Select (menu a tendina) */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 3rem;
}

/* Stile per Date Input */
input[type="date"].form-control {
    position: relative;
    padding-right: 3rem;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    color: transparent;
    opacity: 0;
}

/* Icona calendario personalizzata */
input[type="date"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3e%3cline x1='16' y1='2' x2='16' y2='6'/%3e%3cline x1='8' y1='2' x2='8' y2='6'/%3e%3cline x1='3' y1='10' x2='21' y2='10'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

input[type="date"]:focus {
    background-image: none; /* Nasconde l'icona quando il picker è attivo */
}


/* --- Settings Page --- */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

/* Scoped improvements for Project Settings page */
.page-project-settings .main-header h1 {
    padding-top: 0 !important;
}

.page-project-settings .settings-tabs {
    position: sticky;
    top: 0; /* menu.js handles sidebar overlay; sticky at top of content */
    z-index: 5;
    background: var(--light-bg);
    padding-top: 0.25rem;
}

.page-project-settings .project-preview-iframe {
    height: 60vh;
}

@media (max-width: 1024px) {
    .page-project-settings .project-preview-iframe {
        height: 55vh;
    }
}

@media (max-width: 768px) {
    .page-project-settings .main-content {
        padding: 1rem;
    }

    .page-project-settings .project-preview-iframe {
        height: 48vh;
    }

    /* Keep actions pinned and visible on mobile */
    .page-project-settings .project-preview-section { position: relative; }
    
    /* Enhanced mobile preview */
    .page-project-settings .preview-label {
        font-size: 11px;
        margin-bottom: 6px;
        padding-left: 4px;
    }
    
    .page-project-settings .project-preview-container {
        margin: 0 12px;
        border-radius: 10px;
    }
    
    
    .page-project-settings .preview-grid {
        background-size: 15px 15px;
    }

    /* Compact tabs on mobile */
    .page-project-settings .settings-tabs-container { 
        margin: 0 -1rem 2rem -1rem; 
        padding: 0 1rem;
    }
    .page-project-settings .settings-tabs { gap: 0.25rem; scroll-snap-type: x mandatory; }
    .page-project-settings .tab-link { scroll-snap-align: start; padding: 8px 12px; font-size: 0.95rem; max-width: 48vw; white-space: normal; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; text-align: center; }
    .page-project-settings .tab-link svg,
    .page-project-settings .tab-link label { display: none; }
    
    /* Position scroll buttons on mobile */
    .page-project-settings .tab-scroll-left {
        left: 4px;
    }
    
    .page-project-settings .tab-scroll-right {
        right: 4px;
    }
    
    /* Ensure scroll buttons don't overlap content */
    .page-project-settings .settings-tabs {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-project-settings .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .page-project-settings .form-inline,
    .page-project-settings #short-link-form .form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .page-project-settings .ab-testing-toggle-container {
        align-items: stretch;
    }
    
    /* Mobile form field spacing fixes for project settings */
    .page-project-settings .form-control {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .page-project-settings .form-row {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .page-project-settings .settings-section {
        padding: 1.5rem 1rem !important;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }
    
    /* Tracking platform cards mobile spacing */
    .page-project-settings .tracking-platform-card {
        margin: 0 0.5rem 1rem 0.5rem;
        padding: 1.5rem 1rem;
    }
    
    /* Input with prefix mobile adjustments for project settings */
    .page-project-settings .input-with-prefix {
        margin: 0;
        width: 100%;
    }
    
    .page-project-settings .input-with-prefix input {
        padding-left: 90px;
    }
    
    /* Override inline styles for mobile */
    .page-project-settings input[style*="width: 95%"],
    .page-project-settings textarea[style*="width: 90%"] {
        width: 100% !important;
        margin: 0;
    }
    
    .page-project-settings .form-grid[style*="gap: 1.5rem"] {
        gap: 1rem !important;
    }
    
    .page-project-settings .form-inline[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .page-project-settings .form-inline .form-control[style*="flex-grow: 1"] {
        flex-grow: 0 !important;
        width: 100% !important;
    }
    
    /* Project settings specific button improvements */
    .page-project-settings .btn {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
        box-sizing: border-box;
    }
    
    .page-project-settings .project-preview-actions .btn {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .page-project-settings .quick-links .btn-minimal {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .page-project-settings .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .page-project-settings .form-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Tablet refinements */
@media (min-width: 769px) and (max-width: 1024px) {
    .page-project-settings .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
    
    .page-project-settings .preview-label {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .page-project-settings .project-preview-container {
        margin: 0 14px;
    }
    
    .page-project-settings .preview-grid {
        background-size: 18px 18px;
    }
}

/* Desktop refinements */
@media (min-width: 1025px) {
    .page-project-settings .project-preview-container {
        position: relative;
        margin: 0;
    }
}

/* Safe overflow for tables on small screens */
.page-project-settings .table-container {
    overflow-x: auto;
}

.page-project-settings #short-links-table {
    min-width: 640px;
}

.settings-section-danger {
    border-color: #dc3545;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header-flex h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header-icon {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

/* --- Settings Tabs --- */
.settings-tabs-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 2px;
    flex: 1;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.tab-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #3b82f6;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    opacity: 0;
    visibility: hidden;
}

.tab-scroll-btn.show {
    opacity: 1;
    visibility: visible;
}

.tab-scroll-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    opacity: 1;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.tab-scroll-btn:hover svg {
    color: #1d4ed8;
}

.tab-scroll-left {
    left: -18px;
}

.tab-scroll-right {
    right: -18px;
}

.tab-scroll-btn svg {
    width: 12px;
    height: 12px;
    color: #1d4ed8;
}

/* Hide scroll buttons on desktop by default */
@media (min-width: 769px) {
    .tab-scroll-btn {
        display: none !important;
    }
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-link:hover {
    color: var(--text-color);
    background-color: var(--light-bg);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* --- History Timeline --- */
.history-timeline {
    list-style: none;
    padding: 0;
    margin-top: 24px;
}

.history-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.history-item:last-child {
    border-bottom: none;
}

.history-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-content p {
    margin: 0;
    line-height: 1.5;
}
.history-content .user-name {
    font-weight: 600;
    color: var(--text-color);
}
.history-content .timestamp {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Stili per Etichette (Tag) --- */
.project-tags-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    line-height: 1;
    transition: all 0.2s ease;
}

.tag-pill .remove-tag-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
}

.tag-pill .remove-tag-btn:hover {
    color: white;
}

.tag-pill .remove-tag-btn svg {
    width: 14px;
    height: 14px;
}

/* --- Collaborators & Tags Management --- */
.collaborators-list, .tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.collaborator-item, .tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.collaborator-item:last-child, .tag-item:last-child {
    border-bottom: none;
}

.collaborators-list .collaborator-item {
    gap: 1rem;
    padding: 1rem;
    transition: background-color 0.2s ease;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.collaborators-list .collaborator-item:hover {
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

.collaborator-info {
    flex-grow: 1;
}

.collaborator-name {
    font-weight: 600;
    color: var(--text-color);
}

.collaborator-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.role-select {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    background-color: var(--white);
    border-radius: 6px;
    width: 120px;
    border: 1px solid var(--border-color);
}

.role-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
}

.feedback-message {
    font-size: 0.85rem;
    font-weight: 500;
    width: 60px;
    display: inline-block;
    text-align: left;
    transition: opacity 0.3s ease-in-out;
}

.tag-management-form {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
}

.tag-management-form input[type="text"] {
    flex-grow: 1;
}

.tag-management-form input[type="color"] {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    margin-left: 4px;
}

.tag-management-form input[type="color"]:hover, .tag-management-form input[type="color"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(13,110,253,0.12);
}

.versions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.version-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: all 0.2s ease;
}

.version-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.version-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.version-card-actions .btn-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.version-card:hover .version-card-actions .btn-icon {
    opacity: 1;
}

.version-card-footer {
    margin-top: 20px;
}

.version-card-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.version-card-actions-row .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.version-card-actions-row .btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.version-card-actions-row .btn.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.version-card-actions-row .btn.btn-secondary:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.version-card-actions-row .btn.btn-primary {
    background: #0d6efd;
    color: white;
    border: 1px solid #0d6efd;
}

.version-card-actions-row .btn.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.version-card-actions-row .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Analytics Page --- */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-card h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.table-container {
    margin-top: 40px;
}

#versions-analytics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}

#versions-analytics-table th, 
#versions-analytics-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#versions-analytics-table th {
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--light-bg);
    font-size: 0.875rem;
}

#versions-analytics-table td {
    color: var(--text-muted);
}

#versions-analytics-table tbody tr:last-child td {
    border-bottom: none;
}

.lead-data-container {
    max-width: 400px;
}

.lead-data-item {
    margin-bottom: 8px;
    line-height: 1.4;
}

.lead-data-item:last-child {
    margin-bottom: 0;
}

.lead-data-item strong {
    color: var(--text-color);
    margin-right: 4px;
}

/* --- Form Styles --- */
.form-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.form-row input[type="password"]:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.generated-url-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.generated-url-container h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.generated-url-wrapper {
    display: flex;
    gap: 0.5rem;
}

.generated-url-wrapper input {
    background-color: var(--light-bg);
    flex-grow: 1;
}


.form-row label {
    margin-bottom: 8px;
    font-weight: 500;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.input-with-prefix:focus-within {
     border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.input-with-prefix span {
    padding: 0 12px;
    background-color: var(--light-bg);
    color: var(--text-muted);
    font-size: 1rem;
    border-right: 1px solid var(--border-color);
}

.input-with-prefix input {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
}


.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* --- Kanban Board (Lead CRM) --- */
.kanban-board {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    min-height: 70vh;
    margin: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.kanban-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    border-radius: 20px 20px 0 0;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.kanban-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--column-gradient, linear-gradient(90deg, #3b82f6, #8b5cf6));
    border-radius: 16px 16px 0 0;
}

.kanban-column[data-status="new"]::before {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.kanban-column[data-status="contacted"]::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.kanban-column[data-status="qualified"]::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.kanban-column[data-status="lost"]::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.kanban-column-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px 16px 0 0;
    position: relative;
    z-index: 2;
}

.kanban-column-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icons are now handled by individual status selectors */

/* Status icons with transparent square backgrounds */
.kanban-column[data-status="new"] .kanban-column-header h3 svg {
    color: #3b82f6;
    margin-right: 0.5rem;
    vertical-align: middle;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.kanban-column[data-status="contacted"] .kanban-column-header h3 svg {
    color: #f59e0b;
    margin-right: 0.5rem;
    vertical-align: middle;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.kanban-column[data-status="qualified"] .kanban-column-header h3 svg {
    color: #10b981;
    margin-right: 0.5rem;
    vertical-align: middle;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.kanban-column[data-status="lost"] .kanban-column-header h3 svg {
    color: #ef4444;
    margin-right: 0.5rem;
    vertical-align: middle;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.kanban-column-header .lead-count {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    color: var(--text-muted);
}

.kanban-cards {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 200px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.6));
    border-radius: 12px;
    border: 2px dashed transparent;
    transition: all 0.3s ease;
    position: relative;
}

.kanban-cards:hover {
    border-color: rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(139, 92, 246, 0.01));
}

.kanban-card-placeholder {
    height: 100px; /* Adjust height to match your card height */
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 6px;
    margin-bottom: 1rem;
    display: block; /* Ensure it takes up space */
}

.kanban-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid rgba(229, 231, 235, 0.6);
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.kanban-card:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px) scale(1.02);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(255, 255, 255, 0.98));
}

.kanban-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanban-card::before {
    content: "⋮⋮";
    position: absolute;
    top: 12px;
    right: 12px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    opacity: 0.3;
    transition: all 0.3s ease;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(255, 255, 255, 0.9));
    padding: 6px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    letter-spacing: 2px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.kanban-card:hover::before {
    opacity: 1;
    transform: scale(1.1);
    color: #3b82f6;
}

.kanban-card:hover::after {
    opacity: 1;
}

.kanban-card.is-dragging {
    opacity: 0.9;
    transform: rotate(2deg) scale(1.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border: 3px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(255, 255, 255, 0.95));
    animation: dragPulse 1s infinite;
}

@keyframes dragPulse {
    0%, 100% { 
        border-color: #3b82f6;
        box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
    }
    50% { 
        border-color: #1d4ed8;
        box-shadow: 0 25px 50px rgba(29, 78, 216, 0.4);
    }
}

.kanban-cards.drag-over {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    border: 2px dashed #3b82f6;
    border-radius: 12px;
    transform: scale(1.03);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    position: relative;
}

.kanban-cards.drag-over::before {
    content: 'Drop here to change status';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    animation: fadeInScale 0.3s ease-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-cards.drag-zone-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 2px solid #3b82f6;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    animation: pulse 1.5s infinite;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.kanban-cards.drag-zone-active::before {
    content: "Drop here to change status";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(33, 150, 243, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: fadeInScale 0.3s ease-out forwards;
}

.kanban-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.kanban-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.kanban-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lead-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lead-info {
    flex-grow: 1;
    overflow: hidden; /* Prevents long text from breaking layout */
}

.lead-info h4, .lead-info p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lead-info h4 {
    font-size: 1rem;
    color: var(--text-color);
}
.lead-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.email-lead-quick-btn {
    transition: background-color 0.2s ease-in-out;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--light-bg);
}

.lead-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Empty category message */
.empty-category-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #6b7280;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 1rem;
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.8), rgba(243, 244, 246, 0.6));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.empty-category-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 2s ease;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.empty-category-message:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.03));
    color: #3b82f6;
    transform: scale(1.02);
}

.empty-category-message:hover .empty-icon {
    color: #3b82f6;
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.7;
    animation: float 2s ease-in-out infinite;
    color: #6b7280;
}

.empty-icon svg {
    width: 48px;
    height: 48px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-category-message p {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: inherit;
}

.empty-category-message small {
    font-size: 0.9rem;
    opacity: 0.8;
    color: inherit;
}

.status-new { background-color: #cfe2ff; color: #0a58ca; }
.status-contacted { background-color: #fff3cd; color: #664d03; }
.status-qualified { background-color: #d1e7dd; color: #0f5132; }
.status-lost { background-color: #f8d7da; color: #842029; }


/* --- Footer --- */
.landing-footer {
    background-color: white;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .versions-grid,
    .stats-summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .landing-nav-links {
        display: none;
    }
}

.project-preview-section {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--light-bg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.project-preview-iframe {
    width: 100%;
    height: 50vh;
    border: none;
    background-color: white;
}

.project-preview-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

/* Preview Label - Elegant small label */
.preview-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

/* Project Preview Container */
.project-preview-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Preview Overlay with Grid */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
}

/* Preview Grid */
.preview-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

/* Preview Edit Icon */
.preview-edit-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.preview-edit-icon:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.preview-edit-icon:active {
    transform: translate(-50%, -50%) scale(1.05);
}

.preview-edit-icon svg {
    transition: all 0.2s ease;
}

.preview-edit-icon:hover svg {
    stroke-width: 2.5;
}

/* Preview Actions - New Responsive System */
.preview-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 3;
    pointer-events: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.preview-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #374151;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.preview-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #5a67d8;
}

.preview-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.preview-actions .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Responsive adjustments for preview actions */
@media (max-width: 480px) {
    .preview-actions {
        gap: 6px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .preview-actions .btn {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 120px;
    }
    
    .preview-actions .btn svg {
        width: 13px;
        height: 13px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .preview-actions {
        gap: 6px;
    }
    
    .preview-actions .btn {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 130px;
    }
    
    .preview-actions .btn svg {
        width: 13px;
        height: 13px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .preview-actions {
        gap: 10px;
        justify-content: center;
        left: 20%;
        right: 12px;
    }
    
    .preview-actions .btn {
        font-size: 14px;
        padding: 10px 16px;
        max-width: none;
        min-width: 140px;
    }
    
    .preview-actions .btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1201px) and (max-width: 1366px) {
    .preview-actions {
        gap: 12px;
        justify-content: center;
        left: 25%;
        right: 12px;
    }
    
    .preview-actions .btn {
        font-size: 14px;
        padding: 11px 18px;
        max-width: none;
        min-width: 150px;
    }
    
    .preview-actions .btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1367px) {
    .preview-actions {
        gap: 12px;
        justify-content: flex-start;
    }
    
    .preview-actions .btn {
        font-size: 14px;
        padding: 12px 20px;
        max-width: none;
    }
    
    .preview-actions .btn svg {
        width: 16px;
        height: 16px;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-header h1 {
        font-size: 1.75rem;
    }
    
    .main-header .welcome-message {
        font-size: 1rem;
    }

    .projects-section .projects-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .projects-controls {
        order: 2; /* Sposta i filtri dopo il pulsante */
    }

    #add-project-btn {
        order: 1; /* Sposta il pulsante prima dei filtri */
        width: 100%;
    }

    .versions-grid,
    .stats-summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .landing-nav-links {
        display: none;
    }
} 

/* Kanban moderna migliorata e responsive */
.modern-kanban {
    display: flex;
    gap: 2.2rem;
    overflow-x: auto;
    padding: 2rem 1rem;
    background: #f6f8fa;
    border-radius: 18px;
    min-height: 60vh;
    scroll-snap-type: x mandatory;
}
.modern-kanban-column {
    background: #fff;
    border: 1.5px solid #e3e6ed;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    min-width: 340px;
    max-width: 370px;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    scroll-snap-align: start;
}
.kanban-column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding: 1.2rem 1rem 1rem 1rem;
    border-bottom: 2px solid #f0f2f5;
    border-radius: 18px 18px 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4b5563;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.kanban-cards {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 200px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.modern-lead-card {
    border-radius: 12px;
    border: 1.5px solid #e3e6ed;
    background: #f9fafe;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 0;
    padding: 1.2rem 1rem 1rem 1rem;
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    animation: fadeInCard 0.3s;
}
@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.modern-lead-card:hover {
    box-shadow: 0 4px 16px #007bff22;
    background: #f0f6ff;
    transform: translateY(-2px) scale(1.02);
}
.modern-lead-card.is-dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(0.98);
    background: #e3e6ed;
}

.modern-kanban-column .kanban-cards.drag-over {
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
}
.modern-lead-card h4 {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modern-lead-card p {
    color: #6c757d;
    font-size: 0.97rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.2rem;
    border-top: 1px solid #f0f2f5;
    font-size: 0.85rem;
    color: #b0b4bb;
}

.footer-left {
    display: flex;
    align-items: center;
}
.kanban-cards:empty::after {
    content: 'No leads';
    color: #b0b4bb;
    font-size: 1rem;
    text-align: center;
    display: block;
    margin: 2rem 0;
}

/* Kanban pagination controls */
.kanban-column-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: white;
    border-radius: 0 0 18px 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.kanban-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.kanban-page-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.kanban-page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.kanban-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 4px;
}

/* Mobile status popup */
.mobile-status-popup {
    animation: fadeInScale 0.2s ease-out;
}

.mobile-status-content {
    text-align: center;
}

.mobile-status-content p {
    margin: 0 0 1rem 0;
    font-weight: 500;
    color: var(--text-color);
}

.status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.status-options .btn {
    flex: 1;
    min-width: 80px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideOutRight {
    from { 
        opacity: 1; 
        transform: translateX(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(100%); 
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Modale lead moderna migliorata */
.modern-lead-modal {
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    background: #fff;
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 700px;
    width: 100%;
    animation: fadeInModal 0.25s;
    position: relative; 
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* ============================================
   COMPACT LEAD MODAL - NEW DESIGN
   ============================================ */

.compact-lead-modal {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: #fff;
    max-width: 1100px;
    width: 95vw;
    max-height: 85vh;
    animation: fadeInModal 0.25s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header with Avatar and Quick Info */
.compact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Header Actions - Hidden on Desktop */
.mobile-header-actions {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.mobile-action-btn:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-action-btn:active {
    background: #f1f5f9;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-action-btn svg {
    transition: all 0.2s ease;
}

.mobile-action-btn:hover svg {
    transform: scale(1.1);
}

/* Mobile Action Colors */
.mobile-action-email {
    color: #3b82f6;
    border-color: #dbeafe;
}

.mobile-action-email:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.mobile-action-notes {
    color: #f59e0b;
    border-color: #fef3c7;
}

.mobile-action-notes:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #d97706;
}

.elegant-status-container {
    position: relative;
}

.elegant-status-select {
    appearance: none;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1.25rem 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.elegant-status-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.elegant-status-select:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.elegant-status-container::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #6b7280;
    pointer-events: none;
}

.lead-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lead-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.lead-header-text h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.lead-header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.lead-meta-item svg {
    opacity: 0.7;
}

/* Status Badge in Header */
.lead-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e5e7eb;
    color: #374151;
    transition: all 0.2s ease;
}

.lead-status-badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.lead-status-badge.contacted {
    background: #fef3c7;
    color: #92400e;
}

.lead-status-badge.qualified {
    background: #d1fae5;
    color: #065f46;
}

.lead-status-badge.lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Two Column Body Layout */
.compact-modal-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.compact-left-column {
    overflow-y: auto;
    padding-right: 1rem;
}

.compact-right-column {
    border-left: 1px solid #e5e7eb;
    padding-left: 1.5rem;
    overflow-y: auto;
}

/* Compact Sections */
.compact-section {
    margin-bottom: 1.5rem;
}

.compact-section:last-child {
    margin-bottom: 0;
}

.compact-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-section-title svg {
    opacity: 0.7;
}

/* Status Change Section - Prominent */
.compact-status-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.status-change-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-select-compact {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-select-compact:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-change-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-change-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

/* ============================================
   PLATFORM ACTIONS - PERFECT INTEGRATION
   ============================================ */

.platform-actions-section {
    margin-bottom: 1.5rem;
}

.platform-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-section-title svg {
    opacity: 0.7;
}

.platform-actions-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

/* Status Action in Quick Actions - Beautiful Design */
.platform-status-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-right: 0.5rem;
    flex: 1;
    min-width: 160px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.platform-status-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.platform-status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.platform-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.platform-status-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.platform-status-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.platform-status-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.platform-status-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    background: white;
    transform: translateY(-1px);
}

.platform-status-select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.platform-status-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.platform-status-action:hover .platform-status-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Minimal Action Buttons - Icon Only */
.minimal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.minimal-action-btn:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.minimal-action-btn:active {
    background: #f1f5f9;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.minimal-action-btn svg {
    transition: all 0.2s ease;
}

.minimal-action-btn:hover svg {
    transform: scale(1.1);
}

/* Specific Action Styles */
.platform-action-email .platform-action-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.platform-action-email:hover .platform-action-icon {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: scale(1.05);
}

.platform-action-call .platform-action-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.platform-action-call:hover .platform-action-icon {
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.05);
}

.platform-action-notes .platform-action-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.platform-action-notes:hover .platform-action-icon {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: scale(1.05);
}

.platform-action-delete .platform-action-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.platform-action-delete:hover .platform-action-icon {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: scale(1.05);
}

.platform-action-delete:hover {
    background: #fef2f2;
}

.platform-action-delete:hover .platform-action-title {
    color: #dc2626;
}

/* Hover Effects */
.platform-action-btn:hover .platform-action-title {
    color: #111827;
}

.platform-action-btn:hover .platform-action-subtitle {
    color: #4b5563;
}

/* Focus States */
.platform-action-btn:focus {
    outline: none;
    background: #f0f4ff;
    box-shadow: inset 0 0 0 2px #667eea;
}

.platform-action-btn:focus .platform-action-icon {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Active States */
.platform-action-btn:active {
    transform: scale(0.98);
}

.platform-action-btn:active .platform-action-icon {
    transform: scale(0.95);
}

/* Specific Minimal Action Styles */
.minimal-action-email {
    color: #3b82f6;
    border-color: #dbeafe;
}

.minimal-action-email:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.minimal-action-notes {
    color: #f59e0b;
    border-color: #fef3c7;
}

.minimal-action-notes:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #d97706;
}

.minimal-action-delete {
    color: #ef4444;
    border-color: #fecaca;
}

.minimal-action-delete:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.minimal-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.minimal-action-btn:active {
    transform: scale(0.95);
}

/* Mini Tags Section - Small and Compact */
.mini-tags-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.mini-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-section-title svg {
    opacity: 0.8;
}

.mini-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    min-height: 20px;
}

.mini-tag-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.mini-tag-form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.mini-select,
.mini-input {
    padding: 0.25rem 0.375rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: inherit;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

.mini-select:focus,
.mini-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.mini-color-input {
    width: 20px;
    height: 20px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.mini-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mini-btn-icon:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.mini-btn-cancel {
    background: #ef4444;
}

.mini-btn-cancel:hover {
    background: #dc2626;
}

.mini-btn-text {
    padding: 0.25rem 0.5rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.mini-btn-text:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #334155;
}

/* Compact Tags Section */
.compact-tags-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
}

.compact-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 32px;
}

.compact-tag-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.compact-tag-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compact-select,
.compact-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

.compact-select:focus,
.compact-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.compact-color-input {
    width: 40px;
    height: 36px;
    padding: 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
}

.btn-icon-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon-compact:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-cancel-compact {
    background: #ef4444;
}

.btn-cancel-compact:hover {
    background: #dc2626;
}

.btn-text-compact {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: #667eea;
    border: 1px dashed #667eea;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text-compact:hover {
    background: #f0f4ff;
    border-style: solid;
}

/* Mini Timeline - Smaller and Compact */
.compact-timeline-section {
    height: auto;
    display: flex;
    flex-direction: column;
}

.compact-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.compact-timeline li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #6b7280;
    position: relative;
    padding-left: 1.25rem;
}

.compact-timeline li:last-child {
    border-bottom: none;
}

.compact-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    border: 2px solid #f3f4f6;
}

.compact-timeline li:first-child::before {
    background: #667eea;
}

.compact-timeline .timestamp {
    display: block;
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

/* Compact Footer */
.compact-modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    margin-bottom: env(safe-area-inset-bottom);
}

.footer-actions-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    max-width: 400px;
    justify-content: space-between;
}

.btn-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-compact:hover::before {
    transform: translateX(100%);
}

.btn-compact .btn-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.btn-compact .btn-text {
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 4px;
}

.btn-compact:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-compact:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

/* ============================================
   FOOTER ACTION BUTTONS - SPECIFIC STYLES
   ============================================ */

/* Activity Save Container */
.activity-save-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Desktop Layout - Save button positioned under activity */
@media (min-width: 768px) {
    .footer-actions-container {
        justify-content: space-between;
        gap: 1rem;
        max-width: 400px;
    }
    
    .activity-save-container {
        justify-content: flex-end;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    /* Hide mobile save button on desktop */
    .mobile-save-btn {
        display: none !important;
    }
    
    /* Email Button - Small and Elegant on Desktop */
    .email-primary-btn {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
        color: #92400e !important;
        border: 1px solid #f59e0b !important;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2) !important;
        padding: 8px 12px !important;
        min-width: 100px !important;
        height: 36px !important;
        font-weight: 500 !important;
        font-size: 0.8rem !important;
        gap: 6px !important;
        border-radius: 8px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .email-primary-btn::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
        transition: left 0.6s ease !important;
    }
    
    .email-primary-btn:hover::before {
        left: 100% !important;
    }
    
    .email-primary-btn:hover {
        background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
        color: #78350f !important;
        border-color: #d97706 !important;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
        transform: translateY(-1px) scale(1.02) !important;
    }
    
    .email-primary-btn svg {
        width: 16px !important;
        height: 16px !important;
        color: #92400e !important;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)) !important;
        z-index: 1 !important;
        position: relative !important;
    }
    
    .email-primary-btn:hover svg {
        color: #78350f !important;
        transform: scale(1.1) !important;
    }
    
    .email-btn-text {
        font-size: 0.8rem !important;
        font-weight: 500 !important;
        color: inherit !important;
        z-index: 1 !important;
        position: relative !important;
    }
}

/* Close/Cancel Button - Small & Elegant */
.btn-compact.modal-close {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border-color: #dee2e6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.btn-compact.modal-close:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    border-color: #adb5bd;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.15);
    transform: translateY(-1px) scale(1.05);
}

.btn-compact.modal-close:hover .btn-icon {
    transform: scale(1.2) translateX(-2px);
    color: #495057;
    text-shadow: 
        0 0 12px rgba(73, 80, 87, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-compact.modal-close:active {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    transform: translateY(0) scale(1.02);
}

.btn-compact.modal-close .btn-icon {
    font-size: 20px;
    color: #6c757d;
    font-weight: 300;
    text-shadow: 
        0 0 8px rgba(108, 117, 125, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    transform: scale(1.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    letter-spacing: -1px;
}

/* Delete Button - Small */
.btn-compact#delete-lead-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #bd2130;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.btn-compact#delete-lead-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px) scale(1.05);
}

.btn-compact#delete-lead-btn:hover .btn-icon {
    transform: scale(1.3) rotate(0deg) translateY(-2px);
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(220, 53, 69, 0.8),
        0 5px 12px rgba(0, 0, 0, 0.4);
    filter: 
        drop-shadow(0 4px 12px rgba(220, 53, 69, 0.9))
        drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-compact#delete-lead-btn:active {
    background: linear-gradient(135deg, #bd2130 0%, #a71e2a 100%);
    transform: translateY(0) scale(1.02);
}

.btn-compact#delete-lead-btn .btn-icon {
    font-size: 24px;
    color: #ffffff;
    font-weight: 400;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(220, 53, 69, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    filter: 
        drop-shadow(0 3px 8px rgba(220, 53, 69, 0.7))
        drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    transform: scale(1.2) rotate(-2deg);
    letter-spacing: 0px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

/* Save Button - Large with Text */
.btn-compact#save-lead-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #004085;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    min-width: 80px;
    min-height: 48px;
    width: auto;
    height: 48px;
    border-radius: 12px;
    padding: 0 16px;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-compact#save-lead-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.btn-compact#save-lead-btn:active {
    background: linear-gradient(135deg, #004085 0%, #003d82 100%);
    transform: translateY(-1px) scale(1.02);
}

.btn-compact#save-lead-btn .btn-icon {
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* Button States and Animations */
.btn-compact:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-compact:focus:not(:focus-visible) {
    box-shadow: none;
}

.btn-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-compact:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Loading State */
.btn-compact.loading {
    position: relative;
    color: transparent;
}

.btn-compact.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   COMPACT LEAD FORM - CLEAN DESIGN
   ============================================ */

.compact-lead-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Data Section */
.compact-data-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
}

.compact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.compact-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.compact-form-row label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.compact-form-control {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
    font-family: inherit;
}

.compact-form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.compact-form-control::placeholder {
    color: #9ca3af;
}

/* Elegant Notes Section - Small and Elegant */
.elegant-notes-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.875rem;
    margin-top: 1rem;
}

/* Mobile Notes Spacing */
@media (max-width: 768px) {
    .elegant-notes-section {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .compact-left-column {
        margin-bottom: 0.5rem;
    }
}

.elegant-notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.elegant-notes-header svg {
    color: #64748b;
    opacity: 0.8;
}

.elegant-notes-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elegant-notes-content {
    position: relative;
}

.elegant-notes-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    color: #374151;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.elegant-notes-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.elegant-notes-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.elegant-notes-textarea:hover {
    border-color: #9ca3af;
}

/* Form Feedback */
.compact-form-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    min-height: 24px;
}

.compact-form-feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.compact-form-feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.compact-form-feedback.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Responsive Form */
@media (max-width: 768px) {
    .compact-form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .compact-data-section,
    .compact-notes-section {
        padding: 1rem;
    }
    
    .compact-form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* Responsive Design for Compact Modal */
@media (max-width: 1024px) {
    .compact-modal-body {
        grid-template-columns: 1fr 280px;
        gap: 1rem;
    }
    
    .compact-lead-modal {
        max-width: 95vw;
        width: 95vw;
    }
}

@media (max-width: 768px) {
    .compact-lead-modal {
        max-width: 100vw;
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .compact-modal-body {
        grid-template-columns: 1fr;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .compact-left-column,
    .compact-right-column {
        padding: 0;
        overflow-y: visible;
    }
    
    .compact-right-column {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        padding-top: 1.5rem;
    }
    
    .compact-modal-header {
        padding: 1rem;
    }
    
    .lead-avatar-large {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .lead-header-text h2 {
        font-size: 1.25rem;
    }
    
    .compact-modal-footer {
        padding: 0.625rem 1rem;
    }
    
    .footer-actions-container {
        max-width: 100%;
        gap: 0.375rem;
    }
    
    /* Mobile Footer Button Adjustments */
    .btn-compact.modal-close {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .btn-compact.modal-close .btn-icon {
        font-size: 22px !important;
        color: #6c757d !important;
        font-weight: 300 !important;
        text-shadow: 
            0 0 10px rgba(108, 117, 125, 0.4),
            0 1px 3px rgba(0, 0, 0, 0.3) !important;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2)) !important;
        transform: scale(1.15) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: inline-block !important;
        letter-spacing: -1px !important;
    }
    
    .btn-compact#delete-lead-btn {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .btn-compact#delete-lead-btn .btn-icon {
        font-size: 26px !important;
        color: #ffffff !important;
        font-weight: 400 !important;
        text-shadow: 
            0 0 12px rgba(255, 255, 255, 0.5),
            0 2px 6px rgba(0, 0, 0, 0.6),
            0 0 18px rgba(220, 53, 69, 0.6),
            0 4px 10px rgba(0, 0, 0, 0.4) !important;
        filter: 
            drop-shadow(0 3px 10px rgba(220, 53, 69, 0.8))
            drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5)) !important;
        transform: scale(1.25) rotate(-1deg) !important;
        letter-spacing: 0px !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: inline-block !important;
    }
    
    .btn-compact#save-lead-btn {
        min-width: 80px;
        min-height: 44px;
        height: 44px;
        padding: 0 14px;
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .btn-compact#save-lead-btn .btn-icon {
        font-size: 20px !important;
        color: white !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }
    
    .btn-compact#save-lead-btn .btn-text {
        display: inline-block !important;
        font-weight: 600 !important;
        font-size: 0.8rem !important;
    }
    
    /* Hide activity save container on mobile - Save stays in footer */
    .activity-save-container {
        display: none !important;
    }
    
    /* Hide form feedback on mobile */
    .compact-form-feedback {
        display: none !important;
    }
    
    /* Hide email button text on mobile - keep only icon */
    .email-btn-text {
        display: none !important;
    }
    
    .email-primary-btn {
        min-width: 44px !important;
        padding: 8px !important;
        height: 44px !important;
    }
    
    .btn-compact:hover {
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    /* Mobile-specific button styles */
    .btn-compact.modal-close:hover {
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.15);
    }
    
    .btn-compact.modal-close:hover .btn-icon {
        transform: scale(1.25) translateX(-1px) !important;
        color: #495057 !important;
        text-shadow: 
            0 0 15px rgba(73, 80, 87, 0.5),
            0 2px 5px rgba(0, 0, 0, 0.4) !important;
        filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3)) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .btn-compact#delete-lead-btn:hover {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
    
    .btn-compact#save-lead-btn:hover {
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
    }
    
    .btn-compact#delete-lead-btn:hover .btn-icon {
        transform: scale(1.35) rotate(0deg) translateY(-1px) !important;
        text-shadow: 
            0 0 18px rgba(255, 255, 255, 0.7),
            0 3px 10px rgba(0, 0, 0, 0.8),
            0 0 25px rgba(220, 53, 69, 0.9),
            0 6px 15px rgba(0, 0, 0, 0.5) !important;
        filter: 
            drop-shadow(0 4px 15px rgba(220, 53, 69, 1.0))
            drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6)) !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Force icon visibility on mobile */
    .footer-actions-container .btn-compact {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .footer-actions-container .btn-compact .btn-icon {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .compact-section .modern-lead-form {
        grid-template-columns: 1fr;
    }
    
    .compact-timeline {
        max-height: 200px;
    }
    
    .platform-actions-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .platform-status-action {
        margin-right: 0;
        margin-bottom: 0.5rem;
        min-width: auto;
        padding: 0.625rem 0.875rem;
    }
    
    .platform-status-icon {
        width: 28px;
        height: 28px;
    }
    
    .platform-status-title {
        font-size: 0.7rem;
    }
    
    .platform-status-select {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
    
    .minimal-action-btn {
        width: 32px;
        height: 32px;
    }
    
    .minimal-action-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 768px) {
    /* Show mobile actions on mobile */
    .mobile-header-actions {
        display: flex;
    }
    
    /* Hide desktop quick actions on mobile */
    .platform-actions-section {
        display: none;
    }
}

@media (max-width: 480px) {
    .compact-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .elegant-status-select {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.625rem 1rem 0.625rem 0.75rem;
    }
    
    .modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .lead-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .compact-tag-form {
        flex-wrap: wrap;
    }
    
    .compact-select,
    .compact-input {
        width: 100%;
    }
}

/* Custom Scrollbar for Compact Modal */
.compact-left-column::-webkit-scrollbar,
.compact-right-column::-webkit-scrollbar,
.compact-timeline::-webkit-scrollbar {
    width: 6px;
}

.compact-left-column::-webkit-scrollbar-track,
.compact-right-column::-webkit-scrollbar-track,
.compact-timeline::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.compact-left-column::-webkit-scrollbar-thumb,
.compact-right-column::-webkit-scrollbar-thumb,
.compact-timeline::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.compact-left-column::-webkit-scrollbar-thumb:hover,
.compact-right-column::-webkit-scrollbar-thumb:hover,
.compact-timeline::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox scrollbar */
.compact-left-column,
.compact-right-column,
.compact-timeline {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

/* Compact timeline items with icons */
.compact-timeline li {
    position: relative;
    padding-left: 1.75rem;
}

.compact-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    border: 2px solid #f3f4f6;
}

.compact-timeline li:first-child::before {
    background: #667eea;
}

/* Status badge in timeline */
.compact-timeline .status-change {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.compact-timeline .status-change.new {
    background: #dbeafe;
    color: #1e40af;
}

.compact-timeline .status-change.contacted {
    background: #fef3c7;
    color: #92400e;
}

.compact-timeline .status-change.qualified {
    background: #d1fae5;
    color: #065f46;
}

.compact-timeline .status-change.lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Enhanced tag pills in compact view */
.compact-tags-container .tag-pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.compact-tags-container .tag-pill .remove-tag-btn {
    width: 14px;
    height: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-tags-container .tag-pill .remove-tag-btn svg {
    width: 12px;
    height: 12px;
}

/* Loading state for compact modal */
.compact-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.compact-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Form feedback in compact modal */
.compact-section .form-feedback {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

/* Empty state for timeline */
.compact-timeline.empty::after {
    content: 'No activity yet';
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 2rem 1rem;
    font-style: italic;
}

.modern-lead-form label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.2rem;
}
.modern-lead-form input[type="text"],
.modern-lead-form textarea,
.modern-lead-form select {
    border-radius: 8px;
    border: 1.2px solid #d1d5db;
    padding: 12px 14px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    width: 100%;
}
.modern-lead-form .form-row {
    margin-bottom: 1.1rem;
}
.modern-lead-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modern-lead-form .form-grid.single-column {
    grid-template-columns: 1fr;
}
#delete-lead-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    margin-right: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 1rem;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}
#delete-lead-btn:hover {
    background: #b52a37;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}
#save-lead-btn {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-weight: 600;
    margin-right: 1rem;
    transition: all 0.2s ease;
    font-size: 1rem;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}
#save-lead-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Responsive Kanban e Modale */
@media (max-width: 1200px) {
    .modern-kanban-column {
        min-width: 270px;
        max-width: 320px;
    }
}
@media (max-width: 900px) {
    .modern-kanban {
        gap: 1.2rem;
        padding: 1.2rem 0.5rem;
    }
    .modern-kanban-column {
        min-width: 220px;
        max-width: 260px;
        font-size: 0.97rem;
    }
}
@media (max-width: 600px) {
    .modern-kanban {
        gap: 1rem;
        padding: 1rem 0.5rem;
        border-radius: 0;
        min-height: 80vh;
        /* Enable horizontal scrolling with snap */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .modern-kanban-column {
        min-width: 280px;
        max-width: 300px;
        border-radius: 12px;
        font-size: 1rem;
        max-height: 75vh;
        flex-shrink: 0;
        scroll-snap-align: start;
        /* Add visual drag indicator */
        position: relative;
    }
    .modern-kanban-column::before {
        content: "← Swipe to see all columns →";
        position: absolute;
        top: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--text-muted);
        background: rgba(255,255,255,0.9);
        padding: 2px 8px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 10;
        opacity: 0.8;
    }
    
    /* Enhanced mobile drag feedback */
    .kanban-cards.drag-zone-active {
        background-color: rgba(33, 150, 243, 0.1);
        border: 2px solid #2196f3;
        border-radius: 12px;
        position: relative;
        animation: pulse 1s infinite;
    }
    
    .kanban-cards.drag-zone-active::before {
        content: "Drop here to change status";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(33, 150, 243, 0.9);
        color: white;
        padding: 8px 12px;
        border-radius: 16px;
        font-size: 11px;
        font-weight: 500;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        animation: fadeInScale 0.3s ease-out forwards;
        white-space: nowrap;
    }
    
    /* Mobile-specific touch improvements */
    .kanban-card {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        touch-action: none; /* Prevent default touch behaviors */
    }
    
    .kanban-card:active {
        cursor: grabbing;
        transform: scale(1.02);
    }
    
    /* Better mobile scrolling */
    .modern-kanban::-webkit-scrollbar {
        height: 4px;
    }
    
    .modern-kanban::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .modern-kanban::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .modern-kanban::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    .modern-kanban-column:not(:first-child)::before {
        display: none;
    }
    .modern-lead-modal {
        padding: 1.5rem;
        max-width: 95vw;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    /* Add drag handle visual indicator */
    .kanban-card {
        position: relative;
        cursor: grab;
        transition: all 0.2s ease;
    }
    .kanban-card:active {
        cursor: grabbing;
    }
    .kanban-card::after {
        content: "⋮⋮";
        position: absolute;
        right: 8px;
        top: 8px;
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1;
        opacity: 0.6;
        pointer-events: none;
    }
    .kanban-card.is-dragging {
        opacity: 0.5;
        transform: rotate(5deg);
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    .kanban-cards.drag-over {
        background-color: rgba(13, 110, 253, 0.1);
        border: 2px dashed var(--primary-color);
        border-radius: 8px;
    }
}

@media (max-width: 600px) {
    .modal-overlay {
        /* Ripristiniamo lo sfondo scuro standard */
        background: rgba(33, 37, 41, 0.6);
        z-index: 1000;
    }
    .modern-lead-form .form-grid {
        grid-template-columns: 1fr !important;
    }
    .modern-lead-form input[type="text"],
    .modern-lead-form textarea,
    .modern-lead-form select {
        font-size: 1.08rem;
        padding: 16px 12px;
    }
    #delete-lead-btn, #save-lead-btn {
        width: 100%;
        margin: 0 0 1rem 0;
        font-size: 1.1rem;
        padding: 16px 20px;
        min-height: 52px;
    }
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0;
    }
    
    /* Mobile-specific modal improvements */
    .modal-header {
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .lead-section-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-actions-right {
        flex-direction: column;
        width: 100%;
    }
    
    .modal-actions-right .btn {
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 14px 20px;
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Tablet responsive improvements */
@media (max-width: 768px) {
    .modern-lead-modal {
        padding: 1.25rem;
        max-width: 98vw;
        margin: 0.5rem;
        max-height: 98vh;
    }
    
    .modal-overlay {
        padding: 0.25rem;
        padding-top: 1rem;
    }
    
    .modern-lead-form .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-actions-right {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .modal-actions-right .btn {
        padding: 14px 20px;
        min-height: 48px;
        font-size: 1rem;
    }
    
    #delete-lead-btn {
        order: 1;
        margin-right: 0;
        margin-bottom: 0;
        padding: 14px 20px;
        min-height: 48px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .modern-lead-modal {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 0.95rem;
    }
    
    .lead-section-card {
        padding: 0.75rem;
    }
    
    .modern-lead-form input[type="text"],
    .modern-lead-form textarea,
    .modern-lead-form select {
        font-size: 1rem;
        padding: 14px 10px;
    }
    
    .form-inline {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-inline .form-control {
        width: 100%;
    }
    
    .form-inline .btn {
        width: 100%;
        padding: 12px 16px;
        min-height: 44px;
    }
    
    .modal-actions-right .btn {
        padding: 12px 16px;
        min-height: 44px;
        font-size: 0.95rem;
    }
    
    /* Ultra-compact mobile preview */
    .page-project-settings .preview-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .page-project-settings .project-preview-container {
        margin: 0 8px;
        border-radius: 8px;
    }
    
    
    .page-project-settings .preview-grid {
        background-size: 12px 12px;
    }
    
    #delete-lead-btn, #save-lead-btn {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 1rem;
    }
    
    /* Extra small mobile form improvements */
    .form-control {
        width: calc(100% - 1rem);
        margin: 0 0.5rem;
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .form-row {
        margin-bottom: 1.25rem;
        padding: 0 0.25rem;
    }
    
    .settings-section {
        padding: 1.25rem 0.75rem !important;
        margin: 0 0.25rem 1.25rem 0.25rem;
    }
    
    .page-project-settings .settings-section {
        padding: 1.25rem 0.75rem !important;
        margin: 0 0.25rem 1.25rem 0.25rem;
    }
    
    .page-project-settings .form-row {
        padding: 0 0.25rem;
    }
    
    .page-project-settings .tracking-platform-card {
        margin: 0 0.25rem 1rem 0.25rem;
        padding: 1.25rem 0.75rem;
    }
    
    .input-with-prefix {
        margin: 0 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .page-project-settings .input-with-prefix {
        margin: 0;
        width: 100%;
    }
    
    /* Override inline styles for extra small mobile */
    .page-project-settings input[style*="width: 95%"],
    .page-project-settings textarea[style*="width: 90%"] {
        width: 100% !important;
        margin: 0;
    }
    
    .page-project-settings .form-grid[style*="gap: 1.5rem"] {
        gap: 0.75rem !important;
    }
    
    .page-project-settings .form-inline[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .page-project-settings .form-inline .form-control[style*="flex-grow: 1"] {
        flex-grow: 0 !important;
        width: 100% !important;
    }
    
    /* Extra small mobile button improvements */
    .btn {
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn-group .btn,
    .form-actions .btn,
    .project-card-footer .btn {
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .project-preview-actions .btn {
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .quick-links .btn-minimal {
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .form-actions {
        padding: 0 0.25rem;
        gap: 0.5rem;
    }
}

/* Form inline improvements for all screen sizes */
.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-inline .form-control {
    flex: 1;
    min-width: 200px;
}

.form-inline .btn {
    white-space: nowrap;
    padding: 10px 16px;
    min-height: 40px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-inline .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-control,
    .form-inline .btn {
        width: 100%;
        min-width: auto;
    }
} 

/* Card e titoli sezione per modale lead */
.lead-section-card {
    background: #f8fafd;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    padding: 1.2rem 1rem 1rem 1rem;
    margin-bottom: 1.2rem;
    border: 1px solid #e3e6ed;
    transition: all 0.2s ease;
}

.lead-section-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}
.section-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #2d3a4a;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
} 

/* Card statistiche moderne */
.modern-stats-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.modern-stats-summary .stat-card {
    flex: 1 1 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 200px;
    max-width: 320px;
    position: relative;
    border: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}
.stat-card .stat-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    opacity: 0.8;
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    position: relative;
}
.stat-card.stat-leads .stat-icon { 
    color: #007bff; 
    background: #f0f4ff;
    border-color: #cfe2ff;
}
.stat-card.stat-new .stat-icon { 
    color: #0d6efd; 
    background: #f0f4ff;
    border-color: #cfe2ff;
}
.stat-card.stat-contacted .stat-icon { 
    color: #fd7e14; 
    background: #fff3e0;
    border-color: #ffe0b3;
}
.stat-card.stat-qualified .stat-icon { 
    color: #198754; 
    background: #f0f9f4;
    border-color: #d1e7dd;
}
.stat-card.stat-lost .stat-icon { 
    color: #6c757d; 
    background: #f8f9fa;
    border-color: #e9ecef;
}
.stat-card:hover .stat-icon {
    opacity: 1;
    background: #ffffff;
    border-color: #007bff;
}
.stat-card .fa {
    font-size: 2.2rem;
    vertical-align: middle;
    position: relative;
    z-index: 1;
}
.stat-card .stat-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
    z-index: 1;
}
.stat-card .stat-label {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
}
.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
}
.stat-card.stat-leads { border-left: 4px solid #007bff; }
.stat-card.stat-new { border-left: 4px solid #0d6efd; }
.stat-card.stat-contacted { border-left: 4px solid #fd7e14; }
.stat-card.stat-qualified { border-left: 4px solid #198754; }
.stat-card.stat-lost { border-left: 4px solid #6c757d; }

/* Hover effects for stat cards - more professional */
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left-width: 5px;
}
.stat-card:hover .stat-value {
    color: #000;
}
.stat-card:hover .stat-label {
    color: #495057;
    font-weight: 500;
}

/* Box grafico */
.modern-chart-section { background: none; border: none; box-shadow: none; }
.modern-chart-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

/* Tabella lead moderna */
.modern-leads-table {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    font-size: 1rem;
}
.modern-leads-table th, .modern-leads-table td {
    padding: 1.1rem 0.7rem;
    text-align: left;
}
.modern-leads-table th {
    background: #f6f8fa;
    color: #4b5563;
    font-weight: 600;
    font-size: 1.02rem;
    border-bottom: 2px solid #e3e6ed;
}
.modern-leads-table tr {
    border-bottom: 1px solid #f0f2f5;
}
.modern-leads-table td {
    vertical-align: middle;
}
.modern-leads-table .lead-badge {
    display: inline-block;
    padding: 0.35em 0.9em;
    border-radius: 1em;
    font-size: 0.98em;
    font-weight: 600;
    color: #fff;
    background: #adb5bd;
    text-transform: capitalize;
}
.lead-badge.new { background: #0d6efd; }
.lead-badge.contacted { background: #ffc107; color: #222; }
.lead-badge.qualified { background: #198754; }
.lead-badge.lost { background: #dc3545; }

/* Variant badge styling */
.variant-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: 0.5em;
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    background: #e9ecef;
    border: 1px solid #ced4da;
}

.variant-badge-small {
    display: inline-block;
    padding: 0.15em 0.4em;
    border-radius: 0.4em;
    font-size: 0.7em;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Variant link section styling */
.variant-link-section {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.variant-link-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.variant-link-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.variant-link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    outline: none;
    transition: border-color 0.2s ease;
}

.variant-link-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.btn-copy-variant-link,
.btn-preview-variant {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-variant-link:hover,
.btn-preview-variant:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: translateY(-1px);
}

.btn-copy-variant-link:active {
    transform: translateY(0);
}

/* Success feedback for copy action */
.btn-copy-variant-link.copied {
    background: #198754;
    border-color: #198754;
    color: white;
}

.btn-copy-variant-link.copied::after {
    content: "✓";
    margin-left: 4px;
    font-weight: bold;
}

/* Variant preview section styling */
.variant-preview-section {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.variant-preview-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.variant-preview-container {
    position: relative;
    width: 100%;
    height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.variant-preview-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.variant-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.variant-preview-iframe {
    width: 200%;
    height: 400px;
    border: none;
    transform: scale(0.5);
    transform-origin: top left;
    pointer-events: none;
    background: white;
}

.variant-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.variant-preview-container:hover .variant-preview-overlay {
    opacity: 1;
}

.btn-expand-preview {
    background: rgba(255,255,255,0.95);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-expand-preview:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Loading state for iframe */
.variant-preview-iframe:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive adjustments for variant preview */
@media (max-width: 768px) {
    .variant-preview-container {
        height: 150px;
    }
    
    .variant-preview-iframe {
        height: 300px;
    }
    
    .variant-preview-section {
        margin: 12px 0;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .variant-preview-container {
        height: 120px;
    }
    
    .variant-preview-iframe {
        height: 240px;
    }
    
    .version-card-actions-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .version-card-actions-row .btn {
        width: 100%;
    }
}

/* Responsive tabella */
@media (max-width: 900px) {
    .modern-stats-summary { gap: 1rem; }
    .modern-stats-summary .stat-card { padding: 1.2rem 0.7rem; }
    .modern-chart-box { padding: 1.2rem 0.5rem; }
    .modern-leads-table th, .modern-leads-table td { padding: 0.7rem 0.3rem; }
}
@media (max-width: 600px) {
    /* Mobile stats - layout orizzontale compatto */
    .modern-stats-summary { 
        flex-direction: row; 
        gap: 0.5rem; 
        overflow-x: auto;
        padding: 0.5rem 0;
        margin-bottom: 1.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .modern-stats-summary .stat-card { 
        min-width: 120px;
        max-width: 140px;
        flex-shrink: 0;
        padding: 1rem 0.75rem;
        text-align: center;
        scroll-snap-align: start;
        border-radius: 12px;
        box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    }
    .modern-stats-summary .stat-card .stat-icon {
        font-size: 1.8rem;
        margin-bottom: 0.4rem;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 8px;
        background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
        border: 1px solid rgba(0, 123, 255, 0.15);
        transition: all 0.3s ease;
    }
    .modern-stats-summary .stat-card.stat-leads .stat-icon { 
        background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
        border-color: rgba(0, 123, 255, 0.2);
    }
    .modern-stats-summary .stat-card.stat-new .stat-icon { 
        background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
        border-color: rgba(13, 110, 253, 0.2);
    }
    .modern-stats-summary .stat-card.stat-contacted .stat-icon { 
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
        border-color: rgba(255, 193, 7, 0.2);
    }
    .modern-stats-summary .stat-card.stat-qualified .stat-icon { 
        background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05));
        border-color: rgba(25, 135, 84, 0.2);
    }
    .modern-stats-summary .stat-card.stat-lost .stat-icon { 
        background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
        border-color: rgba(220, 53, 69, 0.2);
    }
    .modern-stats-summary .stat-card .stat-label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }
    .modern-stats-summary .stat-card .stat-value {
        font-size: 1.4rem;
        margin-bottom: 0;
        line-height: 1.1;
    }
    .modern-stats-summary .stat-card.stat-leads,
    .modern-stats-summary .stat-card.stat-new,
    .modern-stats-summary .stat-card.stat-contacted,
    .modern-stats-summary .stat-card.stat-qualified,
    .modern-stats-summary .stat-card.stat-lost {
        border-left: 4px solid;
        border-radius: 8px;
    }
    .modern-chart-box { padding: 0.7rem 0.2rem; }
    .modern-leads-table { font-size: 0.97rem; }
    .modern-leads-table th, .modern-leads-table td { padding: 0.5rem 0.2rem; }
    .settings-section { padding: 0.7rem 0.2rem !important; }
}

/* Filtri compatti */
.projects-filters { gap: 1.2rem; }
.form-row label { font-weight: 500; color: #333; margin-bottom: 0.2rem; display: block; } 

/*******************
 * MOBILE ENHANCEMENTS
 *******************/
@media (max-width: 768px) {
    /* Ensure hamburger is always on top */
    .hamburger-btn {
        z-index: 1200;
        background-color: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 8px;
    }

    /* Projects section header stacks vertically */
    .projects-section .projects-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* Controls stack and take full width */
    .projects-controls {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        order: 2; /* below add-project button */
    }

    .search-bar {
        width: 100%;
    }

    .projects-filters {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .projects-filters .form-control,
    .search-bar .form-control {
        width: 100%;
    }

    /* Add Project button takes full width and shown first */
    #add-project-btn {
        width: 100%;
        order: 1;
    }
} 

/**************
 * PROJECT CARD FOOTER (MOBILE)
 **************/
@media (max-width: 768px) {
    .project-card-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    .project-card-footer .btn {
        width: 100%;
    }
} 

/****************
 * PROJECT CARD – MOBILE FIXES
 ****************/
@media (max-width: 768px) {
    /* Ensure card takes full width with small horizontal padding */
    .project-card {
        width: 100%;
        margin: 0 auto 1rem auto;
    }

    /* Kebab button larger tap area and not cut off */
    .project-card-actions {
        margin-left: auto;
    }
    .project-card-actions .btn-icon {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    /* Dropdown adapts to small screen width */
    .kebab-menu-dropdown {
        left: auto;
        right: 0;
        width: 180px;
        transform: none;
    }
} 

/**************
* MAIN CONTENT PADDING
**************/
@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 1rem; /* Reduced padding for mobile */
    }
    
    /* Mobile form field improvements */
    .form-control {
        width: calc(100% - 2rem);
        margin: 0 1rem;
        box-sizing: border-box;
    }
    
    .form-row {
        margin-bottom: 1.5rem;
    }
    
    .form-row .form-control {
        margin: 0;
        width: 100%;
    }
    
    /* Settings sections need proper mobile padding */
    .settings-section {
        padding: 1.5rem 1rem !important;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }
    
    /* Project settings specific mobile fixes */
    .page-project-settings .settings-section {
        padding: 1.5rem 1rem !important;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }
    
    /* Form grid adjustments for mobile */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Input with prefix mobile adjustments */
    .input-with-prefix {
        margin: 0 1rem;
        width: calc(100% - 2rem);
    }
    
    .input-with-prefix input {
        padding-left: 90px;
    }
    
    /* Mobile button improvements */
    .btn {
        margin: 0.25rem 0.5rem;
        min-width: auto;
        width: calc(100% - 1rem);
        box-sizing: border-box;
    }
    
    /* Button groups and inline buttons */
    .btn-group .btn,
    .form-actions .btn,
    .project-card-footer .btn {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
    }
    
    /* Specific button containers */
    .project-preview-actions .btn {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .quick-links .btn-minimal {
        margin: 0.25rem 0.5rem;
        width: calc(100% - 1rem);
    }
    
    /* Form action buttons */
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-disabled {
    opacity: 0.5;
    background: #ccc;
    color: #666;
}

.limit-warning {
    display: block;
    font-size: 11px;
    color: var(--danger-color);
    margin-top: 2px;
}

.limit-overlay {
    background-color: var(--light-bg); /* Light background */
    border: 1px solid var(--border-color); /* Subtle border */
    color: var(--text-muted); /* Muted text color */
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    text-align: center;
}
.limit-overlay .btn-warning {
    margin-top: 8px;
}

.tooltip-below {
    display: block;
    font-size: 11px;
    color: var(--danger-color);
}

.btn-icon {
    background-color: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

.btn-icon.btn-danger:hover {
    background-color: var(--danger-bg-light);
    color: var(--danger-color);
}


.btn-full {
    width: 100%;
}

/* ==========================================================================
   Tabelle
   ========================================================================== */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--light-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    background-color: #fafafa;
}

table tr:last-child td {
    border-bottom: none;
}

table td .btn-icon {
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s ease;
}

table tr:hover td .btn-icon {
    visibility: visible;
    opacity: 1;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.short-link-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.short-link-text {
    background-color: var(--light-bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#short-links-table td:last-child,
#short-links-table th:last-child {
    text-align: right;
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix span {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-prefix input {
    padding-left: 90px; /* Spazio per il prefisso */
} 

.ab-testing-toggle-container {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ab-testing-toggle-container .toggle-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-grow: 1;
}

.ab-testing-toggle-container strong {
    font-weight: 600;
    margin-right: 1rem;
} 

/* Minimal upload button for favicon/icon */
.minimal-upload-btn {
    display: inline-block;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 18px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    font-weight: 500;
    font-size: 1rem;
    color: var(--primary-color);
    outline: none;
    position: relative;
}
.minimal-upload-btn:hover, .minimal-upload-btn:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
    background: #f8faff;
}
.minimal-upload-btn-text {
    display: flex;
    align-items: center;
    gap: 0.3em;
    user-select: none;
}
#favicon-preview img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-left: 0.5em;
}

/* Delete Project Modal Specific Styles */
#delete-project-modal .modal-content {
    max-width: 500px;
    animation: slideInScale 0.3s ease-out;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#delete-project-modal .modal-icon {
    margin-bottom: 1.5rem;
}

#delete-project-modal .modal-body h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

#delete-project-modal .modal-body ul {
    list-style-type: disc;
}

#delete-project-modal .modal-body li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

#delete-project-modal .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

#delete-project-modal .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#delete-project-modal .btn-secondary {
    background: #6c757d;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

#delete-project-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Mobile responsiveness for delete modal */
@media (max-width: 768px) {
    #delete-project-modal .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    #delete-project-modal .modal-body {
        padding: 1.5rem 1rem;
    }
    
    #delete-project-modal .modal-body div[style*="display: flex"] {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #delete-project-modal .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Horizontal filters layout */
.leads-filters-horizontal {
    display: flex;
    align-items: end;
    gap: 2rem;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 140px;
    flex-shrink: 0;
}

.filter-group.search-group {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    white-space: nowrap;
}

.filter-group .form-control {
    height: 42px;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.filter-group .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-shrink: 0;
}

.filter-actions .btn {
    height: 42px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .leads-filters-horizontal {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .filter-group {
        min-width: auto;
        max-width: none;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 0.5rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .leads-filters-horizontal {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .filter-group .form-control {
        height: 44px;
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .filter-actions .btn {
        height: 44px;
        flex: 1;
        padding: 0.875rem 1.25rem;
    }
}

/* Desktop Pagination - Premium Design */
.desktop-pagination {
    margin: 2rem 1rem 1rem 1rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.desktop-pagination::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    border-radius: 16px 16px 0 0;
}

.desktop-pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.pagination-stats {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
}

.pagination-stats strong {
    color: #1f2937;
    font-weight: 700;
}

.pagination-page-info {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination-page-info strong {
    color: #374151;
    font-weight: 700;
}

.desktop-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.desktop-pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 110px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.desktop-pagination-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.desktop-pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.desktop-pagination-btn:hover:not(:disabled)::before {
    left: 100%;
}

.desktop-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
}

.desktop-pagination-btn.first-page,
.desktop-pagination-btn.last-page {
    min-width: 90px;
    padding: 0.875rem 1rem;
}

.desktop-pagination-pages {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0 1rem;
}

.desktop-page-btn {
    padding: 0.875rem 1.125rem;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 48px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.desktop-page-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.desktop-page-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.desktop-page-btn:hover::before {
    left: 100%;
}

.desktop-page-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
    font-weight: 700;
}

.desktop-page-ellipsis {
    padding: 0.875rem 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
}

/* Mobile responsive for pagination */
@media (max-width: 768px) {
    .desktop-pagination {
        margin: 1.5rem 0.5rem 1rem 0.5rem;
        padding: 1.5rem;
    }
    
    .desktop-pagination-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .desktop-pagination-controls {
        gap: 0.5rem;
    }
    
    .desktop-pagination-btn {
        min-width: 80px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .desktop-pagination-btn.first-page,
    .desktop-pagination-btn.last-page {
        min-width: 70px;
        padding: 0.75rem 0.875rem;
    }
    
    .desktop-pagination-pages {
        margin: 0 0.5rem;
        gap: 0.25rem;
    }
    
    .desktop-page-btn {
        min-width: 40px;
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .desktop-pagination {
        margin: 1rem 0.25rem;
        padding: 1rem;
    }
    
    .desktop-pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .desktop-pagination-pages {
        order: -1;
        margin: 0;
    }
    
    .desktop-pagination-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Leads Pagination Styles */
.leads-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.leads-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.leads-pagination {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.leads-pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.leads-pagination-stats {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.leads-pagination-stats strong {
    color: #1f2937;
    font-weight: 700;
}

.leads-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.leads-pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 90px;
    justify-content: center;
}

.leads-pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.leads-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: #e5e7eb;
    color: #9ca3af;
}

.leads-pagination-pages {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0 1rem;
}

.leads-page-btn {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.leads-page-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.leads-page-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
    font-weight: 700;
}

.leads-page-ellipsis {
    padding: 0.75rem 0.5rem;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.85rem;
    user-select: none;
}

/* Mobile responsive for leads pagination */
@media (max-width: 768px) {
    .leads-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .leads-actions .btn {
        justify-content: center;
    }
    
    .leads-pagination {
        padding: 1rem;
    }
    
    .leads-pagination-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .leads-pagination-controls {
        gap: 0.5rem;
    }
    
    .leads-pagination-btn {
        min-width: 70px;
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .leads-pagination-pages {
        margin: 0 0.5rem;
        gap: 0.25rem;
    }
    
    .leads-page-btn {
        min-width: 35px;
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .leads-pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .leads-pagination-pages {
        order: -1;
        margin: 0;
    }
    
    .leads-pagination-btn {
        width: 100%;
        max-width: 150px;
    }
}

/* Stili per i pulsanti nella tabella leads */
.leads-table .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.leads-table .btn-outline-primary {
    color: #3b82f6;
    border: 1px solid #3b82f6;
    background: transparent;
}

.leads-table .btn-outline-primary:hover {
    color: white;
    background: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.leads-table .btn-outline-primary svg {
    width: 14px;
    height: 14px;
}

/* Premium Leads Section Styles */
.premium-leads-section {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.leads-section-header {
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.leads-header-content h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.leads-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 400;
}

.premium-table-container {
    overflow-x: auto;
    overflow-y: visible;
    background: #ffffff;
    position: relative;
    -webkit-overflow-scrolling: touch;
    /* Assicura che il container abbia un'altezza definita per lo sticky */
    max-height: none;
}

.premium-leads-table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.premium-leads-table thead th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    /* Assicura che lo sticky funzioni correttamente */
    will-change: transform;
}

.table-header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-header-content svg {
    color: #94a3b8;
    opacity: 0.8;
    width: 14px;
    height: 14px;
}

.premium-leads-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.premium-leads-table tbody tr:hover {
    background: #f8fafc;
}

.premium-leads-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #334155;
    font-weight: 400;
}

.premium-leads-table tbody tr:last-child {
    border-bottom: none;
}

/* Project Link Styling */
.project-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.project-link:hover {
    color: #2563eb;
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.project-link svg {
    color: #3b82f6;
    flex-shrink: 0;
}

.project-link:hover svg {
    color: #2563eb;
}

/* Variant Badge Styling */
.variant-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid #e2e8f0;
}

/* Lead Badge Styling */
.lead-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #e2e8f0;
}

.lead-badge.new {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

.lead-badge.contacted {
    background: #fffbeb;
    color: #d97706;
    border-color: #fed7aa;
}

.lead-badge.qualified {
    background: #f0fdf4;
    color: #059669;
    border-color: #bbf7d0;
}

.lead-badge.lost {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Action Buttons */
.premium-leads-table .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.premium-leads-table .btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.premium-leads-table .btn-secondary:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Premium Pagination */
.premium-leads-pagination {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.premium-leads-pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.premium-leads-pagination-stats {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 400;
}

.premium-leads-pagination-stats strong {
    color: #475569;
    font-weight: 600;
}

.premium-leads-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.premium-leads-pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-width: 80px;
    justify-content: center;
}

.premium-leads-pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.premium-leads-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.premium-leads-pagination-pages {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin: 0 0.75rem;
}

.premium-leads-page-btn {
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 36px;
    text-align: center;
}

.premium-leads-page-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.premium-leads-page-btn.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
    font-weight: 600;
}

.premium-leads-page-ellipsis {
    padding: 0.5rem 0.5rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.875rem;
    user-select: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .leads-section-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
    }
    
    .premium-leads-table thead th {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .premium-leads-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .table-header-content {
        gap: 0.375rem;
    }
    
    .table-header-content svg {
        width: 12px;
        height: 12px;
    }
    
    .premium-leads-pagination {
        padding: 1rem 1.5rem;
    }
    
    .premium-leads-pagination-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .premium-leads-pagination-controls {
        gap: 0.375rem;
    }
    
    .premium-leads-pagination-btn {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .premium-leads-pagination-pages {
        margin: 0 0.5rem;
        gap: 0.125rem;
    }
    
    .premium-leads-page-btn {
        min-width: 32px;
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .premium-leads-pagination-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .premium-leads-pagination-pages {
        order: -1;
        margin: 0;
    }
    
    .premium-leads-pagination-btn {
        width: 100%;
        max-width: 150px;
    }
}

/* --- Compact Date Filters for Leads --- */
.date-filters-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-wrapper .date-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    z-index: 1;
}

.date-filters-compact .date-input {
    padding: 0.4rem 0.5rem 0.4rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--light-bg);
    transition: all 0.2s ease;
    min-width: 120px;
    color: var(--text-color);
}

.date-filters-compact .date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.date-filters-compact .date-input:focus + .date-icon {
    color: var(--primary-color);
}

.date-filters-compact .date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    margin-left: 8px;
}

.date-filters-compact .date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Stile per il dropdown del progetto con icona */
.sort-dropdown {
    position: relative;
}

.sort-dropdown svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    z-index: 1;
}

.sort-dropdown .sort-select {
    padding-left: 2rem;
}

/* Responsive adjustments for compact date filters */
@media (max-width: 1024px) {
    .date-filters-compact {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .date-filters-compact .date-input {
        min-width: 100px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .date-filters-compact {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .date-filters-compact .date-input {
        flex: 1;
        min-width: auto;
    }
    
    /* Nascondi le icone sui filtri su mobile per leads-general */
    .date-filters-compact .date-input-wrapper .date-icon,
    .sort-dropdown svg {
        display: none;
    }
    
    /* Reset padding senza icone */
    .date-filters-compact .date-input,
    .sort-dropdown .sort-select {
        padding-left: 0.75rem !important;
    }
}

/* --- Stili per filtri orizzontali in Analytics Specifica --- */
.analytics-filters {
    display: none; /* Nasconde i vecchi filtri verticali */
}

/* Stili per i filtri orizzontali in analytics.html */
.date-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-wrapper .date-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    z-index: 1;
}

.date-input {
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--light-bg);
    transition: all 0.2s ease;
    min-width: 140px;
    color: var(--text-color);
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-input:focus + .date-icon {
    color: var(--primary-color);
}

.device-filter-group {
    position: relative;
    display: flex;
    align-items: center;
}

.device-filter-group .device-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    z-index: 1;
}

.variant-filter-group {
    position: relative;
    display: flex;
    align-items: center;
}

.variant-filter-group .variant-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.filter-select {
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--light-bg);
    transition: all 0.2s ease;
    min-width: 140px;
    color: var(--text-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select:focus + .device-icon {
    color: var(--primary-color);
}

.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive per analytics specifica */
@media (max-width: 1024px) {
    .date-filters {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .date-input-group {
        width: 100%;
    }
    
    .date-input,
    .filter-select {
        width: 100%;
        min-width: auto;
    }
    
    .filter-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .filters-left,
    .filters-right {
        justify-content: center;
    }
    
    .date-filters {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .device-filter-group {
        order: 2;
        width: 100%;
    }
    
    .filter-btn {
        order: 3;
        width: 100%;
    }
}

/* --- Stili per la tabella Real-time Activity --- */
.time-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.time-hour {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.time-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.time-metric {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.conversion-rate {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.conversion-rate.high {
    background: #d4edda;
    color: #155724;
}

.conversion-rate.medium {
    background: #fff3cd;
    color: #856404;
}

.conversion-rate.low {
    background: #f8d7da;
    color: #721c24;
}

/* Animazione per i dati real-time */
.premium-leads-table tbody tr {
    transition: all 0.3s ease;
}

.premium-leads-table tbody tr:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Indicatore di dati live */
.realtime-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #28a745;
    font-size: 0.8rem;
    font-weight: 600;
}

.realtime-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Responsive per la tabella real-time */
@media (max-width: 768px) {
    .time-info {
        text-align: center;
    }
    
    .time-hour {
        font-size: 0.8rem;
    }
    
    .time-date {
        font-size: 0.7rem;
    }
    
    .time-metric {
        font-size: 0.75rem;
        padding: 0.15rem 0.4rem;
    }
    
    .conversion-rate {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* --- Stili per la tabella dettagliata dei visitatori --- */
.visitor-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.visitor-location {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.visitor-ip {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
}

.visitor-email {
    font-size: 0.75rem;
    color: #10B981;
    margin-top: 4px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.btn-view-lead {
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-lead:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    transform: translateY(-1px);
}

.conversion-count {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #10B981;
    font-weight: 500;
}

.landing-page-info {
    margin-top: 4px;
    font-size: 0.7rem;
    color: #666;
}

.variant-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.variant-name {
    font-weight: 500;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.variant-id {
    font-size: 0.7rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-type {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-align: center;
}

.device-type.desktop {
    background: #e3f2fd;
    color: #1976d2;
}

.device-type.mobile {
    background: #f3e5f5;
    color: #7b1fa2;
}

.device-type.tablet {
    background: #e8f5e8;
    color: #388e3c;
}

.device-type.unknown {
    background: #f5f5f5;
    color: #666;
}

.browser-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.source-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.source-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.utm-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.engagement-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.page-views {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.conversion-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    min-width: 80px;
    display: inline-block;
}

.conversion-badge.converted {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.conversion-badge.converted-action {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.conversion-badge.not-converted {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive per la tabella dettagliata */
@media (max-width: 1024px) {
    .visitor-location,
    .device-type,
    .source-name {
        font-size: 0.8rem;
    }
    
    .visitor-ip,
    .browser-info,
    .utm-info,
    .page-views {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .visitor-info,
    .device-info,
    .source-info,
    .engagement-info {
        text-align: center;
    }
    
    .visitor-location {
        justify-content: center;
    }
    
    .device-type {
        font-size: 0.75rem;
        padding: 0.15rem 0.4rem;
    }
    
    .conversion-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        min-width: 70px;
    }
} 