/**
 * Yoyomove.ai - Dashboard Analisi Dati
 * Stylesheet principale
 *
 * Struttura:
 * 1. Reset & Base Styles
 * 2. Dark Liquid Background
 * 3. Header
 * 4. Sidebar Navigation
 * 5. Main Content
 * 6. Stats Cards
 * 7. Chart Cards
 * 8. Tables
 * 9. Mobile Menu
 * 10. Responsive Design
 */

/* ===== 1. RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 2. DARK LIQUID BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(255, 193, 7, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 75%, rgba(138, 43, 226, 0.1) 0%, transparent 50%);
    z-index: 0;
    animation: liquidMove 30s ease-in-out infinite;
}

@keyframes liquidMove {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.7; }
    50% { transform: scale(1.1) translateY(-30px); opacity: 1; }
}

/* ===== 3. HEADER ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(30px);
    border-bottom: 3px solid #FFC107;
    padding: 1rem 2rem;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.3));
}

.back-button {
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    color: #000000;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

/* ===== 4. SIDEBAR NAVIGATION ===== */
.dashboard-container {
    display: flex;
    margin-top: 70px;
    position: relative;
    z-index: 2;
    overflow-x: hidden;
    max-width: 100vw;
}

.sidebar {
    width: 260px;
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(20px);
    border-right: 2px solid rgba(255, 193, 7, 0.3);
    height: calc(100vh - 70px);
    position: fixed;
    left: 0;
    overflow-y: auto;
    padding: 2rem 0;
    transition: transform 0.3s ease;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #a0a0a0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border-left-color: #FFC107;
}

.sidebar-menu a.active {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
    border-left-color: #FFC107;
}

.sidebar-menu .icon {
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
}

/* ===== 5. MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    overflow-x: hidden;
    max-width: calc(100vw - 260px);
}

.content-header {
    margin-bottom: 2rem;
}

.content-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #FFC107 0%, #0077FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    font-weight: 800;
    filter: drop-shadow(0 0 20px rgba(255, 193, 7, 0.2));
}

.content-subtitle {
    color: #a0a0a0;
    font-size: 1rem;
}

/* ===== 5.5. KPI PERIOD SELECTOR ===== */
.kpi-period-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.kpi-period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.period-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
}

.period-btn.active {
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    color: #000;
    border-color: #FFC107;
    font-weight: 600;
}

.kpi-period-dropdowns {
    display: flex;
    gap: 0.5rem;
}

.kpi-period-select {
    padding: 0.6rem 1rem;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #fff;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.kpi-period-select:hover {
    border-color: #FFC107;
}

.kpi-period-select:focus {
    outline: none;
    border-color: #FFC107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
}

.kpi-period-select option {
    background: #1a1a1a;
    color: #fff;
}

.kpi-period-label {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

/* ===== 6. STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFC107, #0077FF);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #FFC107;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
}

.stat-card-clickable {
    cursor: pointer;
}

.stat-card-clickable::after {
    content: 'Clicca per dettagli';
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.65rem;
    color: rgba(255, 193, 7, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card-clickable:hover::after {
    opacity: 1;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.3));
}

.stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #a0a0a0;
    font-size: 0.95rem;
    font-weight: 500;
}

.stat-change {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-change.positive {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.stat-change.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* ===== 7. CHART CARDS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-card:hover {
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFC107;
}

.chart-filter {
    display: flex;
    gap: 0.5rem;
}

.chart-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-filter-select {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.chart-filter-select:hover,
.chart-filter-select:focus {
    border-color: #FFC107;
    outline: none;
}

.chart-filter-select option {
    background: #1a1a1a;
    color: #ffffff;
}

.filter-btn {
    background: rgba(255, 193, 7, 0.1);
    color: #a0a0a0;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border-color: #FFC107;
}

/* Chart Header Actions */
.chart-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.top-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.top-input-wrapper label {
    font-size: 0.8rem;
    color: #a0a0a0;
}

.chart-filter-input {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffffff;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    width: 60px;
    text-align: center;
}

.chart-filter-input:focus {
    border-color: #FFC107;
    outline: none;
}

/* Pulsante CSV */
.btn-csv {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.btn-csv:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Mini Dashboard Grid (for Leads Over dashboard) */
.mini-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 0;
}

.mini-stat {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.mini-stat:hover {
    border-color: rgba(255, 193, 7, 0.5);
    transform: translateY(-2px);
}

.mini-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.mini-stat-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== 8. TABLES ===== */
.table-card {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: hidden;
    max-width: 100%;
}

.table-header {
    margin-bottom: 1.5rem;
}

.table-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFC107;
    margin-bottom: 0.5rem;
}

.table-search {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.search-input {
    flex: 1;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #FFC107;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.data-table thead {
    background: rgba(255, 193, 7, 0.1);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #FFC107;
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
}

.data-table td {
    padding: 1rem;
    color: #c0c0c0;
    border-bottom: 1px solid rgba(255, 193, 7, 0.1);
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 193, 7, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-badge.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ===== 9. MOBILE MENU ===== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: linear-gradient(90deg, #FFC107, #FFD54F);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ===== 9.5. TEMPLATE EDITOR ===== */
.template-editor {
    padding: 1rem;
}

.template-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.template-textarea:focus {
    outline: none;
    border-color: #FFC107;
    background: rgba(255, 193, 7, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.template-textarea::placeholder {
    color: #666;
}

.template-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.btn-template-save {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-template-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-template-save:active {
    transform: translateY(0);
}

.btn-template-test {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-template-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-template-test:active {
    transform: translateY(0);
}

.btn-template-test:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.template-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.template-preview-label {
    font-size: 0.8rem;
    color: #FFC107;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-preview-content {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #a0a0a0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.template-preview-content::-webkit-scrollbar {
    width: 6px;
}

.template-preview-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.template-preview-content::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 3px;
}

.template-save-success {
    color: #4ade80;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.template-save-success.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== 9.6. MAPPA ATTIVAZIONI STYLES ===== */

/* Filtri Attivazioni e Consulenti */
.attivazioni-filters,
.consulenti-filters {
    margin-top: 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    border-color: #FFC107;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.2);
}

.filter-select option {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-export {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

/* Tabella Scrollabile */
.table-scroll-container {
    display: block;
    overflow-x: scroll;
    overflow-y: auto;
    margin-top: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    max-height: 500px;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-scroll-container .attivazioni-table {
    width: 100%;
    table-layout: auto;
    min-width: 0;
}

/* Quando mostra tutte le colonne, la tabella si espande */
.attivazioni-table.show-all-cols {
    width: auto !important;
    min-width: 3500px !important;
    table-layout: auto;
}

.table-scroll-container::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.5);
    border-radius: 6px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.7);
}

.attivazioni-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: separate;
    border-spacing: 0;
}

.attivazioni-table th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(30, 30, 30, 1) 0%, rgba(20, 20, 20, 1) 100%);
    z-index: 10;
    white-space: nowrap;
    padding: 1rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #FFC107;
}

.attivazioni-table td {
    padding: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 193, 7, 0.1);
}

.attivazioni-table td:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    position: relative;
    z-index: 5;
    background: rgba(40, 40, 40, 0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.sticky-col {
    position: sticky;
    left: 0;
    background: rgba(25, 25, 25, 0.98);
    z-index: 11;
    font-weight: 600;
    color: #FFC107;
}

/* Colonne visibili per default - le altre nascoste */
.attivazioni-table .col-hidden {
    display: none;
}

/* Toggle per mostrare tutte le colonne */
.attivazioni-table.show-all-cols .col-hidden {
    display: table-cell;
}

/* Colonna Toggle */
.col-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.col-toggle-btn {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.col-toggle-btn:hover {
    background: rgba(255, 193, 7, 0.25);
    border-color: #FFC107;
}

.col-toggle-btn.active {
    background: #FFC107;
    color: #000;
}

.col-toggle-btn .icon {
    font-size: 1rem;
}

/* Badge Esito */
.esito-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.esito-badge.approvata {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.esito-badge.approvata-condizione {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.esito-badge.approvata-annullata {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.esito-badge.respinta {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.esito-badge.in-corso {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.esito-badge.approvata-senza-contratto {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.esito-badge.approvata-con-contratto {
    background: rgba(20, 184, 166, 0.2);
    color: #14b8a6;
}

.esito-badge.info-mancanti {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Paginazione */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 193, 7, 0.2);
}

.pagination-info {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.pagination-info span {
    color: #FFC107;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-btn {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-current {
    color: #ffffff;
    font-weight: 500;
}

.pagination-current span {
    color: #FFC107;
}

/* Row colori alternati per leggibilità */
.attivazioni-table tbody tr:nth-child(even) {
    background: rgba(255, 193, 7, 0.03);
}

.attivazioni-table tbody tr:hover {
    background: rgba(255, 193, 7, 0.08);
}

/* Colonna evidenziata (Esito, Note) */
.highlight-col {
    background: rgba(255, 193, 7, 0.05);
}

/* ===== 9.7. MODAL E BOTTONE NUOVA ATTIVAZIONE ===== */

/* Bottone + Nuova Attivazione */
.btn-add-attivazione {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    color: #0a0a0a;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    margin-left: 1rem;
}

.btn-add-attivazione:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.btn-add-attivazione .btn-icon {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

/* Pulsante Ricarica Dati */
.btn-reload {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-reload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-reload .reload-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-reload.loading .reload-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transform: none !important;
    isolation: isolate;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: linear-gradient(180deg, rgba(25, 25, 25, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 193, 7, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container.modal-large {
    max-width: 800px;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    background: rgba(255, 193, 7, 0.05);
}

.modal-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #a0a0a0;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Modal Body */
.modal-body {
    padding: 2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFC107;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFC107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
    background: rgba(40, 40, 40, 0.9);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
}

.form-group select option {
    background: #1a1a1a;
    color: #ffffff;
}

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

.form-group input:disabled,
.form-group select:disabled {
    background: rgba(20, 20, 20, 0.6);
    color: #888;
    cursor: not-allowed;
    border-color: rgba(255, 193, 7, 0.15);
}

.form-group input[readonly] {
    background: rgba(25, 25, 25, 0.7);
    color: #4ade80;
    cursor: default;
    border-color: rgba(74, 222, 128, 0.3);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.4rem;
    font-style: italic;
}

/* Form Row (2 colonne) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Sezioni del Modal */
.modal-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.1);
}

.modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFC107;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-section-title .section-icon {
    font-size: 1rem;
}

/* Modal Section Header con pulsante modifica */
.modal-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-section-header .modal-section-title {
    margin-bottom: 0;
}

.btn-edit-section {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    color: #FFC107;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit-section:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
}

.btn-edit-section .edit-icon {
    font-size: 0.9rem;
}

/* Selettore Tipo Attivazione */
.tipo-attivazione-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tipo-attivazione-option {
    cursor: pointer;
}

.tipo-attivazione-option input[type="radio"] {
    display: none;
}

.tipo-attivazione-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem;
    background: rgba(30, 30, 30, 0.6);
    border: 2px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.tipo-attivazione-option input[type="radio"]:checked + .tipo-attivazione-card {
    background: rgba(255, 193, 7, 0.1);
    border-color: #FFC107;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.2);
}

.tipo-attivazione-card:hover {
    border-color: rgba(255, 193, 7, 0.5);
    background: rgba(40, 40, 40, 0.8);
}

.tipo-icon {
    font-size: 2rem;
}

.tipo-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.tipo-desc {
    font-size: 0.75rem;
    color: #888;
}

/* Info box warning */
.modal-info-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.modal-info-warning .info-icon {
    color: #fbbf24;
}

/* Modal Conferma - deve stare SOPRA il modal dettaglio */
.modal-confirm {
    z-index: 999999 !important;
}

.modal-confirm .modal-container {
    z-index: 999999;
    position: relative;
}

.modal-small {
    max-width: 450px;
}

.modal-header-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-bottom-color: rgba(251, 191, 36, 0.3);
}

.modal-header-warning h2 {
    color: #fbbf24;
}

.confirm-content {
    text-align: center;
    padding: 1rem 0;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

.confirm-desc {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.confirm-desc strong {
    color: #FFC107;
}

.confirm-warning {
    font-size: 0.85rem;
    color: #fbbf24;
    font-style: italic;
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.btn-modal-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000000;
}

.btn-modal-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.4);
}

/* Preview Dati MyBoard */
.myboard-preview {
    background: rgba(255, 193, 7, 0.05);
    border: 1px dashed rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.myboard-preview.loading {
    text-align: center;
    color: #888;
    font-style: italic;
}

.myboard-preview.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    text-align: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-item .label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-item .value {
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 500;
}

.preview-item .value.empty {
    color: #555;
    font-style: italic;
}

/* Input nella preview grid */
.preview-item input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.preview-item input:disabled {
    background: rgba(20, 20, 20, 0.6);
    color: #aaa;
    cursor: not-allowed;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 193, 7, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
}

.btn-modal {
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-modal-primary {
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-modal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.btn-modal-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-modal-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-modal-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-modal-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

/* Righe cliccabili nella tabella */
.attivazioni-table tbody tr.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.attivazioni-table tbody tr.clickable-row:hover {
    background: rgba(255, 193, 7, 0.12);
    transform: scale(1.002);
}

/* Info messaggio */
.modal-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.modal-info .info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.modal-info p {
    font-size: 0.85rem;
    color: #a0a0a0;
    line-height: 1.5;
}

/* Title con bottone inline */
.section-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-title-row h2 {
    margin: 0;
}

/* ===== CEO DASHBOARD - ANDAMENTO YOYOMOVE ===== */

/* Filtri CEO */
.ceo-filters-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.ceo-period-selector {
    display: flex;
    gap: 0.5rem;
}

.ceo-period-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.ceo-period-btn:hover {
    background: rgba(255, 193, 7, 0.2);
}

.ceo-period-btn.active {
    background: #FFC107;
    color: #000;
    border-color: #FFC107;
}

.ceo-period-dropdowns {
    display: flex;
    gap: 0.5rem;
}

.ceo-period-select {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.ceo-period-select:focus {
    border-color: #FFC107;
    outline: none;
}

.ceo-period-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Stats Grid CEO */
.ceo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ceo-stat-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.ceo-stat-card:hover {
    border-color: rgba(255, 193, 7, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ceo-stat-card.ceo-stat-primary {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 193, 7, 0.4);
}

.ceo-stat-icon {
    font-size: 2.5rem;
}

.ceo-stat-content {
    flex: 1;
}

.ceo-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.ceo-stat-label {
    font-size: 0.95rem;
    color: #a0a0a0;
    margin-top: 0.2rem;
}

.ceo-stat-sublabel {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.1rem;
}

.ceo-stat-change {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.ceo-stat-change.positive {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.ceo-stat-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Section Titles CEO */
.ceo-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0 1rem;
}

.ceo-section-title h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.rappel-note {
    font-size: 0.8rem;
    color: #a0a0a0;
    font-style: italic;
}

/* Provider Cards CEO */
.ceo-provider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ceo-provider-card {
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.ceo-provider-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.ceo-provider-card.provider-leasys {
    border-color: rgba(0, 102, 204, 0.5);
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(20, 20, 20, 0.9) 100%);
}

.ceo-provider-card.provider-arval {
    border-color: rgba(220, 53, 69, 0.5);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(20, 20, 20, 0.9) 100%);
}

.ceo-provider-card.provider-ayvens {
    border-color: rgba(40, 167, 69, 0.5);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(20, 20, 20, 0.9) 100%);
}

.provider-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.provider-stats {
    display: flex;
    gap: 2rem;
}

.provider-stat {
    display: flex;
    flex-direction: column;
}

.provider-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFC107;
}

.provider-stat-label {
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Rappel Cards */
.rappel-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.rappel-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.rappel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.rappel-provider {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.rappel-period {
    font-size: 0.75rem;
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
}

.rappel-progress-container {
    margin-bottom: 1rem;
}

.rappel-progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.rappel-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107, #ff9800);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.rappel-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 0.5rem;
}

.rappel-bonus {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rappel-bonus-label {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.rappel-bonus-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #22c55e;
}

/* Responsive CEO Dashboard */
@media (max-width: 1200px) {
    .ceo-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ceo-provider-grid,
    .rappel-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ceo-filters-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .ceo-period-selector {
        flex-wrap: wrap;
    }

    .ceo-stats-grid,
    .ceo-provider-grid,
    .rappel-container {
        grid-template-columns: 1fr;
    }

    .ceo-period-label {
        margin-left: 0;
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .btn-modal {
        width: 100%;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 10. RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    /* Header Mobile */
    header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        padding: 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1001;
        padding-top: 80px;
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Overlay quando sidebar aperta */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1000;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main Content Mobile */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 80px;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
        background: rgba(255, 193, 7, 0.1);
        border: 1px solid rgba(255, 193, 7, 0.3);
        color: #FFC107;
        padding: 0.5rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.5rem;
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-change {
        font-size: 0.7rem;
    }

    /* Charts Mobile */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-card h3 {
        font-size: 1rem;
    }

    .chart-container {
        height: 220px;
    }

    /* Content Title Mobile */
    .content-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Tabella Mobile */
    .table-scroll-container {
        margin-top: 1rem;
        max-height: 400px;
        border-radius: 8px;
    }

    .attivazioni-table th,
    .attivazioni-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.75rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.4rem;
    }

    /* Filtri Mobile */
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-select {
        width: 100%;
        min-width: unset;
    }

    .btn-export {
        width: 100%;
        text-align: center;
    }

    /* Toggle colonne mobile */
    .col-toggle-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .col-toggle-btn {
        justify-content: center;
    }

    /* Paginazione Mobile */
    .table-pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Mini Dashboard Grid */
    .mini-dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Bottone Aggiungi Mobile */
    .btn-add-attivazione {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* Badge esito più piccoli */
    .esito-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }

    /* Fix sidebar menu - rimuove spazio vuoto sopra */
    .sidebar {
        padding-top: 60px;
    }

    .sidebar-menu {
        padding-top: 0;
        margin-top: 0;
    }

    .sidebar-menu li:first-child {
        margin-top: 0;
    }

    /* Fix grafici troppo grandi su mobile */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .chart-container {
        height: 250px;
        max-width: 100%;
    }

    /* Fix torta canali acquisizione - più grande */
    .chart-container canvas {
        max-width: 100%;
        height: auto !important;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .chart-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .chart-filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .chart-filter-select {
        flex: 1;
        min-width: 120px;
    }

    .btn-csv {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    /* Header Compact */
    header {
        padding: 0.5rem 0.75rem;
    }

    .logo {
        font-size: 1rem;
    }

    .back-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    /* Main Content Compact */
    .main-content {
        padding: 0.75rem;
        padding-top: 70px;
    }

    /* Title Compact */
    .content-title {
        font-size: 1.3rem;
    }

    /* Stats Compact */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-card h3 {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    /* Charts Compact */
    .chart-card {
        padding: 0.75rem;
    }

    .chart-container {
        height: 180px;
    }

    /* Table Compact */
    .attivazioni-table th,
    .attivazioni-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Sidebar width mobile */
    .sidebar {
        width: 260px;
    }

    .sidebar-menu a {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    /* Modal Compact */
    .modal-container {
        width: 95%;
        margin: 0.5rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .form-group label {
        font-size: 0.75rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Landscape orientation fix */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding-top: 60px;
    }

    .sidebar {
        padding-top: 60px;
    }

    .modal-container {
        max-height: 95vh;
    }

    .chart-container {
        height: 150px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .attivazioni-table tbody tr.clickable-row {
        min-height: 48px;
    }

    .pagination-btn,
    .filter-select,
    .btn-export,
    .btn-add-attivazione,
    .btn-modal {
        min-height: 44px;
    }

    .sidebar-menu a {
        min-height: 48px;
    }
}

/* ===== MAPPA EUROPA - LIQUID GLASS STYLE ===== */

.europe-map-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.europe-map-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 193, 7, 0.5),
        transparent);
}

.europe-map-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 193, 7, 0.05) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.map-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.map-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFC107 0%, #FFD54F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.3rem;
}

.map-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 400;
}

.europe-map-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Leaflet Map Container */
.leaflet-map {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Custom dark theme per Leaflet */
.leaflet-container {
    background: #1a1a2e !important;
    font-family: 'Poppins', sans-serif;
}

/* Nasconde controlli di zoom di default */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: rgba(30, 30, 30, 0.9) !important;
    color: #FFC107 !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 193, 7, 0.2) !important;
}

/* Attribution styling */
.leaflet-control-attribution {
    background: rgba(10, 10, 10, 0.8) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: rgba(255, 193, 7, 0.7) !important;
}

/* Custom marker styles */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFC107 0%, #FF9800 100%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 0 20px rgba(255, 193, 7, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: markerPulse 2s ease-out infinite;
}

.marker-pin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.marker-pin.hq {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #FFC107 0%, #F57C00 100%);
    border: 4px solid #fff;
    box-shadow:
        0 0 30px rgba(255, 193, 7, 0.8),
        0 0 60px rgba(255, 193, 7, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.4);
}

.marker-pin.hq::after {
    width: 12px;
    height: 12px;
}

.marker-pin.hq::before {
    content: 'HQ';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes markerPulse {
    0% {
        box-shadow:
            0 0 20px rgba(255, 193, 7, 0.6),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 35px rgba(255, 193, 7, 0.9),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
    100% {
        box-shadow:
            0 0 20px rgba(255, 193, 7, 0.6),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
}

/* Popup styling */
.leaflet-popup-content-wrapper {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98)) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-content {
    color: #fff !important;
    font-family: 'Poppins', sans-serif !important;
    margin: 12px 16px !important;
}

.leaflet-popup-tip {
    background: rgba(30, 30, 30, 0.95) !important;
}

.popup-title {
    font-size: 14px;
    font-weight: 700;
    color: #FFC107;
    margin-bottom: 4px;
}

.popup-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.popup-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
}

/* Legenda */
.map-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #FFC107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.legend-marker.hq {
    width: 16px;
    height: 16px;
    border: 2px solid #FFC107;
    background: rgba(255, 193, 7, 0.3);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

.legend-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Stats della mappa */
.map-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.map-stat {
    background: linear-gradient(135deg,
        rgba(255, 193, 7, 0.15) 0%,
        rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    text-align: center;
    min-width: 100px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.map-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.2);
}

.map-stat-value {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFC107;
    line-height: 1.2;
}

.map-stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive mappa */
@media (max-width: 768px) {
    .europe-map-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .map-title {
        font-size: 1.2rem;
    }

    .map-subtitle {
        font-size: 0.8rem;
    }

    .leaflet-map {
        height: 300px;
    }

    .map-legend {
        gap: 1rem;
    }

    .legend-text {
        font-size: 0.75rem;
    }

    .map-stats {
        gap: 0.5rem;
    }

    .map-stat {
        padding: 0.6rem 0.8rem;
        min-width: 70px;
    }

    .map-stat-value {
        font-size: 1.2rem;
    }

    .map-stat-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .europe-map-card {
        padding: 1rem;
    }

    .map-title {
        font-size: 1rem;
    }

    .leaflet-map {
        height: 250px;
    }

    .map-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .map-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
    }

    .map-stat {
        min-width: unset;
    }
}

/* ===== PROFILO CONSULENTE MODAL ===== */

.profilo-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(138, 43, 226, 0.05) 100%);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.profilo-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.profilo-info-main {
    flex: 1;
}

.profilo-info-main h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.profilo-team {
    margin-bottom: 1rem;
}

.team-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.profilo-piva-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#profilo-piva-label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.piva-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.piva-badge.si {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.piva-badge.no {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.piva-badge.unknown {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.btn-edit-piva {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #a0a0a0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-edit-piva:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: #FFC107;
    color: #FFC107;
}

.piva-edit-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-wrap: wrap;
}

.piva-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.piva-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #FFC107;
}

.piva-option {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.piva-option.si {
    color: #22c55e;
}

.piva-option.no {
    color: #ef4444;
}

.btn-save-piva {
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    border: none;
    color: #1a1a1a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-save-piva:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Profilo KPI Grid */
.profilo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profilo-kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s;
}

.profilo-kpi-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 193, 7, 0.3);
}

.profilo-kpi-card.highlight {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
    border-color: rgba(255, 193, 7, 0.3);
}

.profilo-kpi-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profilo-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.profilo-kpi-card.highlight .profilo-kpi-value {
    color: #FFC107;
}

.profilo-kpi-label {
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Profilo Tables */
.profilo-table-container {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profilo-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.profilo-detail-table th {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.profilo-detail-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: #e0e0e0;
}

.profilo-detail-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Riga Consulenti Cliccabile */
.consulenti-row-clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.consulenti-row-clickable:hover {
    background: rgba(255, 193, 7, 0.1) !important;
}

.consulenti-row-clickable:hover td {
    color: #FFC107;
}

/* Responsive Profilo */
@media (max-width: 768px) {
    .profilo-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profilo-piva-status {
        justify-content: center;
    }

    .profilo-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .piva-edit-form {
        justify-content: center;
    }
}

/* ===== MOBILE FIX - FULL WIDTH ===== */
@media (max-width: 768px) {
    /* Container principale - DEVE essere flex column su mobile */
    .dashboard-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin-top: 60px !important;
    }

    /* Main content occupa tutta la larghezza */
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding: 1rem !important;
        padding-top: 10px !important;
        min-height: calc(100vh - 60px) !important;
    }

    /* Nasconde sidebar di default su mobile */
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 60px !important;
        width: 260px !important;
        height: calc(100vh - 60px) !important;
        transform: translateX(-100%) !important;
        z-index: 1001 !important;
        transition: transform 0.3s ease !important;
    }

    .sidebar.active {
        transform: translateX(0) !important;
    }

    /* Overlay quando sidebar aperta */
    .sidebar-overlay.active {
        display: block !important;
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 60px) !important;
        background: rgba(0, 0, 0, 0.7) !important;
        z-index: 1000 !important;
    }

    /* Fix per sezioni */
    .section-content,
    .content-section,
    #mappa-attivazioni-section,
    #consulenti-section {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
    }

    /* Fix tabella su mobile */
    .table-scroll-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Header responsive */
    .header-content {
        width: 100% !important;
        padding: 0 0.5rem !important;
    }

    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .stat-card {
        padding: 0.75rem !important;
    }

    /* Ultima card (Provvigioni Totali) occupa tutta la larghezza */
    .stats-grid .stat-card:last-child {
        grid-column: 1 / -1 !important;
    }

    .stat-value {
        font-size: 1.2rem !important;
    }

    /* ===== FIX GRAFICI MOBILE ===== */
    .charts-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .chart-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .chart-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 220px !important;
        position: relative !important;
    }

    .chart-container canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
    }

    .chart-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .chart-header-actions {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .chart-filters {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .chart-filter-select {
        flex: 1 !important;
        min-width: 100px !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .chart-title {
        font-size: 1rem !important;
    }

    .btn-csv {
        width: 100% !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Fix main content overflow */
    .main-content {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Fix content header */
    .content-header {
        padding: 0 !important;
    }

    .content-title {
        font-size: 1.3rem !important;
    }

    .content-subtitle {
        font-size: 0.8rem !important;
    }
}

/* ===== KPI DETAIL MODAL ===== */
.kpi-detail-modal {
    max-width: 600px;
    width: 90%;
}

.kpi-detail-summary {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.kpi-detail-total {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.kpi-detail-label {
    font-size: 1.1rem;
    color: #a0a0a0;
}

.kpi-detail-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFC107;
}

.kpi-detail-period {
    font-size: 0.9rem;
    color: #888;
}

.kpi-breakdown-section {
    margin-bottom: 1.5rem;
}

.kpi-breakdown-section h3 {
    font-size: 1rem;
    color: #FFC107;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.kpi-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kpi-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 30, 30, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #FFC107;
    gap: 1rem;
}

.kpi-breakdown-info {
    flex: 1;
    min-width: 0;
}

.kpi-breakdown-name {
    font-weight: 500;
    color: #fff;
}

.kpi-breakdown-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kpi-breakdown-count {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #FFC107;
    font-size: 1.1rem;
}

.kpi-breakdown-percent {
    font-size: 0.8rem;
    color: #888;
    background: rgba(255, 193, 7, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.kpi-breakdown-bar {
    height: 4px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.kpi-breakdown-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107, #FFD54F);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.kpi-breakdown-empty {
    text-align: center;
    color: #666;
    padding: 1rem;
    font-style: italic;
}

/* ===== BOTTONE LISTA CONSULENTI ===== */
.lista-consulenti-btn-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.btn-lista-consulenti {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 16px;
    padding: 1.25rem 3rem;
    color: #FFC107;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 300px;
}

.btn-lista-consulenti:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-color: #FFC107;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.2);
}

.btn-lista-consulenti .btn-icon {
    font-size: 1.5rem;
}

.btn-lista-consulenti .btn-text {
    flex: 1;
    text-align: center;
}

.btn-lista-consulenti .btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.btn-lista-consulenti:hover .btn-arrow {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .lista-consulenti-btn-container {
        margin: 1.5rem 0;
        padding: 0 0.5rem;
    }

    .btn-lista-consulenti {
        min-width: unset;
        width: 100%;
        max-width: 100%;
        padding: 1rem 1rem;
        font-size: 0.95rem;
        gap: 0.5rem;
        box-sizing: border-box;
    }

    .btn-lista-consulenti .btn-icon {
        font-size: 1.2rem;
    }

    .btn-lista-consulenti .btn-arrow {
        font-size: 1rem;
    }
}

/* ===== MOBILE OVERRIDE FINALE ===== */
@media screen and (max-width: 768px) {
    /* Forza tutto al 100% larghezza */
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .dashboard-container,
    .main-content,
    section,
    .content-header,
    .charts-grid,
    .chart-card,
    .stats-grid,
    .table-card,
    .filter-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .charts-grid {
        display: block !important;
    }

    .chart-card {
        margin-bottom: 1rem !important;
        padding: 0.75rem !important;
    }

    .chart-header {
        display: block !important;
    }

    .chart-header-actions {
        display: block !important;
        margin-top: 0.5rem !important;
    }

    .chart-filters {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .chart-filter-select {
        flex: 1 1 45% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .btn-csv {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    .chart-container {
        height: 200px !important;
        max-height: 200px !important;
    }

    /* Sidebar fix spazio */
    .sidebar {
        padding-top: 10px !important;
    }

    .sidebar-menu {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ===== TABELLA STATISTICHE REGIONI ===== */

.regioni-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.regioni-filters .filter-select {
    flex: 1;
    min-width: 150px;
}

.regioni-table {
    width: 100%;
}

.regioni-table thead th {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
}

.regioni-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.regioni-table tbody tr:hover {
    background: rgba(255, 193, 7, 0.05);
}

.regioni-table td {
    padding: 0.875rem 1rem;
    color: #e0e0e0;
}

.regioni-table tfoot {
    background: rgba(255, 193, 7, 0.08);
}

.regioni-table tfoot td {
    padding: 1rem;
    color: #FFC107;
    font-weight: 600;
    border-top: 2px solid rgba(255, 193, 7, 0.3);
}

/* Progress bar per percentuale */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107 0%, #FFD54F 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Mobile responsivo tabella regioni */
@media (max-width: 768px) {
    .regioni-filters {
        flex-direction: column;
    }

    .regioni-filters .filter-select {
        width: 100%;
    }

    .regioni-table thead th,
    .regioni-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .regioni-table th:nth-child(3),
    .regioni-table td:nth-child(3),
    .regioni-table th:nth-child(4),
    .regioni-table td:nth-child(4) {
        display: none; /* Nasconde B2B e B2C su mobile */
    }

    .progress-bar-container {
        height: 20px;
    }

    .progress-bar-text {
        font-size: 0.65rem;
    }
}

/* ===== HEADER BUTTONS & LOGOUT ===== */

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.logout-button {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ff6b6b;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.logout-button:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
    .header-buttons {
        gap: 0.5rem;
    }

    .logout-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}
