        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --teal: #226A68;
            --crema: #F5E8D8;
            --rosso: #D93838;
            --arancione: #D98C38;
            --blu-chiaro: #7BB7B5;
            --grigio-scuro: #333333;
        }

        body {
            font-family: 'Montserrat', sans-serif;
            color: var(--grigio-scuro);
            background: linear-gradient(135deg, var(--crema) 0%, #fff 50%, var(--crema) 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        header {
            background-color: white;
            padding: 0.6rem 1.5rem;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

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

        .logo img {
            height: 135px;
            width: auto;
            max-width: 350px;
        }

        .header-user-menu {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .user-email-display {
            font-weight: 600;
        }

        .btn-dashboard {
            background: var(--teal);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-dashboard:hover {
            background: var(--blu-chiaro);
        }

        .btn-logout {
            background: var(--rosso);
            color: white;
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-logout:hover {
            background: #b82e2e;
        }

        /* Header Info Section */
        .header-info {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            align-items: flex-end;
        }

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

        .welcome-text {
            font-size: 1rem;
            color: var(--grigio-scuro);
        }

        .header-plan-badge {
            background: var(--arancione);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .header-stats {
            display: flex;
            gap: 1.5rem;
        }

        .header-stat {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.9rem;
            color: #555;
        }

        .header-stat .stat-icon {
            font-size: 1.2rem;
        }

        .header-stat .stat-text strong {
            color: var(--teal);
        }

        main {
            flex: 1;
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }

        .dashboard-container {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 2rem;
        }

        .sidebar {
            background: white;
            padding: 2rem;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
            height: fit-content;
        }

        .user-info {
            text-align: center;
            margin-bottom: 2rem;
        }

        .user-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--teal), var(--blu-chiaro));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: white;
            margin: 0 auto 1rem;
        }

        .plan-badge {
            background: var(--arancione);
            color: white;
            padding: 0.3rem 1rem;
            border-radius: 20px;
            font-size: 0.8rem;
            display: inline-block;
            margin-top: 0.5rem;
        }

        /* Sidebar Sections */
        .sidebar-section {
            padding: 1.5rem 0;
        }

        .sidebar-section.user-info {
            padding-top: 0;
        }

        .sidebar-divider {
            border: none;
            border-top: 1px solid #e0e0e0;
            margin: 0;
        }

        .sidebar-heading {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--teal);
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .sidebar-btn {
            width: 100%;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
        }

        .sidebar-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .btn-icon {
            font-size: 1.1rem;
        }

        .main-content {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .card {
            background: white;
            padding: 2rem;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        }

        .card h2 {
            font-family: 'Oswald', sans-serif;
            color: var(--teal);
            margin-bottom: 1.5rem;
            font-size: 1.8rem;
        }

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

        .stat-card {
            background: linear-gradient(135deg, var(--teal), var(--blu-chiaro));
            color: white;
            padding: 1.5rem;
            border-radius: 10px;
            text-align: center;
        }

        .stat-label {
            font-size: 0.9rem;
            opacity: 0.9;
            margin-bottom: 0.5rem;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
        }

        .recommendations {
            list-style: none;
        }

        .recommendations li {
            padding: 1rem;
            border-left: 4px solid var(--teal);
            background: var(--crema);
            margin-bottom: 1rem;
            border-radius: 5px;
        }

        .btn {
            padding: 1rem 2rem;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--teal), var(--blu-chiaro));
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(34, 106, 104, 0.3);
        }

        .loading {
            text-align: center;
            padding: 3rem;
        }

        .spinner {
            border: 4px solid var(--crema);
            border-top: 4px solid var(--arancione);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 1rem;
        }

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

        footer {
            background-color: var(--grigio-scuro);
            color: var(--crema);
            padding: 1.5rem;
            text-align: center;
            font-size: 0.9rem;
        }

        /* Pulsante Secondario */
        .btn-secondary {
            background: var(--grigio-scuro);
            color: white;
            padding: 0.8rem 1.5rem;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-secondary:hover {
            background: #555;
            transform: translateY(-2px);
        }

        /* Modale Profilo */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            overflow-y: auto;
        }

        .modal-content {
            background: white;
            border-radius: 15px;
            max-width: 600px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            background: var(--teal);
            color: white;
            padding: 1.5rem;
            border-radius: 15px 15px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

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

        .close {
            font-size: 2rem;
            cursor: pointer;
            transition: transform 0.3s;
        }

        .close:hover {
            transform: scale(1.2);
        }

        .modal-body {
            padding: 2rem;
        }

        .form-section {
            margin-bottom: 2rem;
            padding-bottom: 2rem;
            border-bottom: 2px solid var(--crema);
        }

        .form-section:last-of-type {
            border-bottom: none;
        }

        .form-section h3 {
            color: var(--teal);
            margin-bottom: 1rem;
            font-size: 1.2rem;
        }

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

        .form-group label {
            display: block;
            font-weight: 600;
            color: var(--grigio-scuro);
            margin-bottom: 0.5rem;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            padding: 0.8rem;
            border: 2px solid var(--crema);
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--teal);
        }

        .form-group input[readonly] {
            background: var(--crema);
            cursor: not-allowed;
        }

        .form-hint {
            display: block;
            font-size: 0.85rem;
            color: #666;
            margin-top: 0.3rem;
        }

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

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-top: 2rem;
        }

        /* Profile Photo Upload */
        .profile-photo-upload {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1rem;
            background: #f9f9f9;
            border-radius: 10px;
        }

        .profile-photo-preview {
            flex-shrink: 0;
        }

        .profile-photo-preview .user-avatar {
            width: 80px;
            height: 80px;
            font-size: 2.5rem;
            margin: 0;
        }

        .profile-photo-preview img {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
        }

        .profile-photo-actions {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .btn-sm {
            padding: 0.4rem 0.8rem;
            font-size: 0.85rem;
        }

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

        .btn-danger:hover {
            background: #b82e2e;
        }

        /* Nuova sezione per BIA Upload */
        #biaUploadSection {
            display: none; /* Nascosto di default */
        }

        #biaUploadSection .card-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            text-align: center;
        }

        #biaUploadSection .file-upload-area {
            border: 2px dashed var(--teal);
            padding: 2rem;
            border-radius: 10px;
            cursor: pointer;
            width: 80%;
            transition: background-color 0.3s;
        }

        #biaUploadSection .file-upload-area:hover {
            background-color: var(--crema);
        }

        #biaUploadSection .file-upload-icon {
            font-size: 3rem;
            color: var(--teal);
            margin-bottom: 0.5rem;
        }

        #biaUploadSection .file-upload-text p {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--grigio-scuro);
        }

        #biaUploadSection .file-upload-hint {
            font-size: 0.9rem;
            color: #666;
            margin-top: 0.5rem;
        }

        #biaUploadSection .upload-status {
            margin-top: 1rem;
            font-weight: 500;
        }

        #biaUploadSection .upload-status.success {
            color: green;
        }

        #biaUploadSection .upload-status.error {
            color: var(--rosso);
        }

        /* Modale per visualizzare i risultati BIA */
        #biaResultModal .modal-content {
            max-width: 700px; /* Slightly wider for BIA results */
        }

        #biaResultModal .modal-header {
            background: var(--blu-chiaro); /* Different color for BIA modal */
        }

        #biaResultModal .modal-body h3 {
            color: var(--blu-chiaro);
        }

        #biaResultModal .result-item {
            margin-bottom: 1rem;
            padding: 1rem;
            border-left: 4px solid var(--blu-chiaro);
            background: var(--crema);
            border-radius: 5px;
        }

        #biaResultModal .result-label {
            font-weight: 600;
            color: var(--grigio-scuro);
            margin-bottom: 0.5rem;
        }

        #biaResultModal .result-value {
            font-weight: 700;
            color: var(--teal);
            font-size: 1.2rem;
        }

        #biaResultModal .analysis-timestamp {
            font-size: 0.85rem;
            color: #666;
            margin-top: 1rem;
        }

        @media (max-width: 768px) {
            .dashboard-container {
                grid-template-columns: 1fr;
            }

            .logo img {
                height: 100px;
                max-width: 250px;
            }

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

        /* ========================================
           DIET CONTAINER GENERALE
           ======================================== */

        .diet-container {
            margin-top: 30px;
            padding: 20px;
            background: #f9f9f9;
            border-radius: 16px;
        }

        /* ========================================
           TABS STYLING
           ======================================== */

        .diet-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 3px solid #e0e0e0;
            padding-bottom: 5px;
        }

        .tab-btn {
            background: transparent;
            border: none;
            padding: 15px 30px;
            font-size: 16px;
            font-weight: 700;
            color: #999;
            cursor: pointer;
            border-bottom: 4px solid transparent;
            transition: all 0.3s ease;
            font-family: 'Montserrat', sans-serif;
        }

        .tab-btn:hover {
            color: #226A68;
        }

        .tab-btn.active {
            color: #226A68;
            border-bottom-color: #226A68;
        }

        .tab-btn.locked {
            opacity: 0.4;
            cursor: not-allowed;
            position: relative;
        }

        .tab-btn.locked::after {
            content: '🔒';
            margin-left: 8px;
            font-size: 14px;
        }

        .tab-btn.locked:hover {
            color: #999;
            border-bottom-color: transparent;
        }

        /* ========================================
           WEEK SELECTOR (GIORNI SETTIMANA)
           ======================================== */

        .week-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 25px;
            overflow-x: auto;
            padding-bottom: 10px;
        }

        .week-selector::-webkit-scrollbar {
            height: 6px;
        }

        .week-selector::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 3px;
        }

        .day-btn {
            min-width: 65px;
            padding: 14px 18px;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            font-weight: 700;
            font-size: 14px;
            color: #666;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: 'Montserrat', sans-serif;
            text-transform: capitalize;
        }

        .day-btn:hover {
            border-color: #226A68;
            color: #226A68;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.15);
        }

        .day-btn.active {
            background: #226A68;
            border-color: #226A68;
            color: white;
            box-shadow: 0 4px 16px rgba(34, 106, 104, 0.3);
        }

        /* Locked day pills per FREE users */
        .day-btn.locked {
            opacity: 0.5;
            cursor: not-allowed;
            position: relative;
            background: linear-gradient(135deg, rgba(217, 140, 56, 0.1), rgba(217, 140, 56, 0.2));
            border-color: rgba(217, 140, 56, 0.3);
        }

        .day-btn.locked::after {
            content: '🔒';
            position: absolute;
            top: -6px;
            right: -6px;
            font-size: 0.7em;
            background: white;
            border-radius: 50%;
            padding: 2px 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .day-btn.locked:hover {
            opacity: 0.6;
            transform: none;
            box-shadow: none;
        }

        /* ========================================
           DAY COMPLETION INDICATORS (Meal Tracking)
           ======================================== */

        /* Partial completion (3+ meals tracked) */
        .day-btn.partial-complete {
            border: 2px solid #81C784 !important; /* Light green */
            box-shadow: 0 2px 8px rgba(129, 199, 132, 0.4) !important;
            position: relative;
        }

        .day-btn.partial-complete::before {
            content: '⭐';
            position: absolute;
            top: -8px;
            right: -8px;
            font-size: 1rem;
            background: white;
            border-radius: 50%;
            padding: 2px 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.15);
            line-height: 1;
        }

        .day-btn.partial-complete:not(.active):hover {
            border-color: #66BB6A !important;
            box-shadow: 0 4px 12px rgba(102, 187, 106, 0.5) !important;
        }

        /* Full completion (all meals tracked) */
        .day-btn.full-complete {
            border: 2px solid #4CAF50 !important; /* Bright green */
            box-shadow: 0 2px 12px rgba(76, 175, 80, 0.6) !important;
            background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(129, 199, 132, 0.08) 100%) !important;
            position: relative;
        }

        .day-btn.full-complete::before {
            content: '🏆';
            position: absolute;
            top: -8px;
            right: -8px;
            font-size: 1.1rem;
            background: white;
            border-radius: 50%;
            padding: 2px 4px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
            line-height: 1;
        }

        .day-btn.full-complete:not(.active):hover {
            border-color: #43A047 !important;
            box-shadow: 0 4px 16px rgba(67, 160, 71, 0.7) !important;
        }

        /* Active day overrides (keep teal color but add badge) */
        .day-btn.active.partial-complete,
        .day-btn.active.full-complete {
            background: #226A68 !important;
            border-color: #226A68 !important;
            color: white !important;
        }

        /* ========================================
           CALENDAR NAVIGATOR (NEW)
           ======================================== */

        .calendar-navigator {
            background: white;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 25px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

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

        .calendar-nav-btn {
            background: var(--teal);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .calendar-nav-btn:hover:not(:disabled) {
            background: var(--blu-chiaro);
            transform: scale(1.1);
        }

        .calendar-nav-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            opacity: 0.5;
        }

        .calendar-week-info {
            font-size: 16px;
            font-weight: 600;
            color: var(--grigio-scuro);
            text-align: center;
            flex: 1;
        }

        .calendar-content {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }

        .calendar-day {
            min-height: 90px;
            padding: 16px 8px;
            background: white;
            border: 2px solid #ddd;
            border-radius: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 4px;
        }

        .calendar-day .day-name {
            font-size: 11px;
            color: #999;
            text-transform: uppercase;
            margin-bottom: 4px;
            font-weight: 600;
        }

        .calendar-day .day-number {
            font-size: 18px;
            font-weight: 700;
            color: var(--grigio-scuro);
        }

        .calendar-day:hover:not(.locked):not(.unavailable) {
            border-color: var(--teal);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.15);
        }

        .calendar-day.today {
            border-color: var(--arancione);
            background: rgba(217, 140, 56, 0.05);
        }

        .calendar-day.today .day-number {
            color: var(--arancione);
        }

        .calendar-day.active {
            background: var(--teal);
            border-color: var(--teal);
        }

        .calendar-day.active .day-name,
        .calendar-day.active .day-number {
            color: white;
        }

        .calendar-day.available::after {
            content: '●';
            position: absolute;
            bottom: 5px;
            left: 50%;
            transform: translateX(-50%);
            color: var(--teal);
            font-size: 8px;
        }

        .calendar-day.locked {
            opacity: 0.4;
            cursor: not-allowed;
            background: linear-gradient(135deg, rgba(217, 140, 56, 0.05), rgba(217, 140, 56, 0.1));
        }

        .calendar-day.locked::before {
            content: '🔒';
            position: absolute;
            top: 5px;
            right: 5px;
            font-size: 10px;
        }

        .calendar-day.unavailable {
            opacity: 0.3;
            cursor: not-allowed;
            background: #f5f5f5;
        }

        .calendar-legend {
            display: flex;
            gap: 15px;
            font-size: 12px;
            color: #666;
            justify-content: center;
            flex-wrap: wrap;
        }

        .calendar-legend span {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
        }

        .legend-dot.today {
            background: var(--arancione);
        }

        .legend-dot.available {
            background: var(--teal);
        }

        .legend-dot.locked {
            background: rgba(217, 140, 56, 0.3);
        }

        /* ========================================
           MONTHLY CALENDAR GRID (Piano Mensile)
           ======================================== */

        .monthly-calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
            margin-top: 20px;
        }

        .monthly-calendar-day {
            aspect-ratio: 1;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .monthly-calendar-day.header {
            background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
            color: white;
            font-weight: bold;
            font-size: 14px;
            text-transform: uppercase;
            cursor: default;
            pointer-events: none;
            border: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .monthly-calendar-day .day-number {
            font-size: 18px;
            font-weight: 600;
            color: var(--grigio-scuro);
        }

        .monthly-calendar-day:hover:not(.other-month):not(.unavailable):not(.header) {
            border-color: var(--teal);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.15);
        }

        .monthly-calendar-day.today {
            border-color: var(--arancione);
            background: rgba(217, 140, 56, 0.1);
        }

        .monthly-calendar-day.today .day-number {
            color: var(--arancione);
        }

        .monthly-calendar-day.available::after {
            content: '●';
            position: absolute;
            bottom: 8px;
            color: var(--teal);
            font-size: 8px;
        }

        .monthly-calendar-day.other-month {
            opacity: 0.3;
            cursor: default;
            background: #f9f9f9;
        }

        .monthly-calendar-day.unavailable {
            opacity: 0.5;
            cursor: not-allowed;
            background: #f5f5f5;
        }

        @media (max-width: 768px) {
            .calendar-content {
                grid-template-columns: repeat(7, 1fr);
                gap: 5px;
            }

            .calendar-day {
                padding: 10px 3px;
            }

            .calendar-day .day-name {
                font-size: 9px;
            }

            .calendar-day .day-number {
                font-size: 14px;
            }

            .calendar-legend {
                font-size: 10px;
                gap: 10px;
            }

            .monthly-calendar-grid {
                gap: 5px;
            }

            .monthly-calendar-day {
                padding: 5px;
            }

            .monthly-calendar-day .day-number {
                font-size: 14px;
            }
        }

        /* ========================================
           REMINDER CARDS
           ======================================== */

        .reminder-card {
            background: white;
            color: var(--grigio-scuro);
            padding: 25px;
            border-radius: 14px;
            border-left: 6px solid var(--teal);
            margin-bottom: 25px;
            font-size: 16px;
            line-height: 1.7;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

        .reminder-card strong {
            font-size: 18px;
            font-weight: 700;
            color: var(--teal);
            display: block;
            margin-bottom: 8px;
        }

        .reminder-card p {
            color: #555;
        }

        /* Variante per obiettivo settimanale */
        .reminder-secondary {
            border-left-color: var(--arancione);
        }

        .reminder-secondary strong {
            color: var(--arancione);
        }

        /* ========================================
           MACRO SUMMARY (RIEPILOGO MACRONUTRIENTI)
           ======================================== */

        .macro-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 18px;
            margin-bottom: 30px;
        }

        .macro-card {
            background: white;
            padding: 22px;
            border-radius: 12px;
            box-shadow: 0 3px 12px rgba(0,0,0,0.08);
            text-align: center;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .macro-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.12);
        }

        .macro-card h4 {
            font-size: 13px;
            color: #888;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 600;
        }

        .macro-card .value {
            font-size: 32px;
            font-weight: 800;
            color: #226A68;
            font-family: 'Oswald', sans-serif;
        }

        .macro-card .unit {
            font-size: 16px;
            color: #999;
            margin-left: 2px;
        }

        /* ========================================
           PASTI CONTAINER (PIANO GIORNALIERO)
           ======================================== */

        .pasti-container {
            display: flex;
            flex-direction: column;
            gap: 22px;
        }

        .pasto-card {
            background: white;
            padding: 28px;
            border-radius: 14px;
            box-shadow: 0 3px 14px rgba(0,0,0,0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .pasto-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(0,0,0,0.12);
        }

        .pasto-card h3 {
            font-size: 22px;
            color: #226A68;
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-family: 'Oswald', sans-serif;
        }

        .pasto-card h3 .icona {
            font-size: 28px;
        }

        .pasto-card .nome-ricetta {
            font-size: 18px;
            font-weight: 700;
            color: #333;
            margin-bottom: 12px;
        }

        .pasto-card .ingredienti {
            font-size: 14px;
            color: #666;
            margin-bottom: 10px;
            line-height: 1.6;
        }

        .pasto-card .ingredienti strong {
            color: #226A68;
        }

        .pasto-card .preparazione {
            font-size: 14px;
            color: #777;
            font-style: italic;
            margin-bottom: 14px;
            line-height: 1.6;
        }

        .pasto-card .macro-pasto {
            display: inline-block;
            background: #f0f8f8;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            color: #226A68;
            margin-bottom: 16px;
        }

        .pasto-actions {
            display: flex;
            gap: 12px;
            margin-top: 18px;
            flex-wrap: wrap;
        }

        .btn-favorite,
        .btn-registra,
        .btn-sostituisci {
            padding: 12px 24px;
            border: none;
            border-radius: 10px;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: 'Montserrat', sans-serif;
        }

        .btn-favorite {
            background: #f0f0f0;
            color: #666;
            border: 2px solid #ddd;
        }

        .btn-favorite:hover {
            background: #ffe6e6;
            color: #e63946;
            border-color: #e63946;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2);
        }

        .btn-favorite.active {
            background: #e63946;
            color: white;
            border-color: #e63946;
        }

        .btn-favorite.active:hover {
            background: #d62839;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
        }

        .btn-registra {
            background: #226A68;
            color: white;
        }

        .btn-registra:hover {
            background: #1a5250;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .btn-sostituisci {
            background: #D98C38;
            color: white;
        }

        .btn-sostituisci:hover {
            background: #c17a2b;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(217, 140, 56, 0.3);
        }

        /* ========================================
           PIANO SETTIMANALE - RIEPILOGO GIORNI
           ======================================== */

        .riepilogo-settimana {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 22px;
            margin-top: 20px;
        }

        .giorno-card {
            background: white;
            padding: 24px;
            border-radius: 14px;
            box-shadow: 0 3px 14px rgba(0,0,0,0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
        }

        .giorno-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 6px 24px rgba(0,0,0,0.14);
        }

        .giorno-card h3 {
            color: #226A68;
            font-size: 20px;
            margin-bottom: 14px;
            font-family: 'Oswald', sans-serif;
            text-transform: capitalize;
        }

        .giorno-card .sommario {
            font-size: 14px;
            color: #666;
            margin-bottom: 18px;
            line-height: 1.6;
            font-weight: 500;
        }

        .giorno-card ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .giorno-card ul li {
            padding: 10px 0;
            border-bottom: 1px solid #f0f0f0;
            font-size: 14px;
            color: #555;
            line-height: 1.5;
        }

        .giorno-card ul li:last-child {
            border-bottom: none;
        }

        /* FREE USER - Giorno bloccato */
        .giorno-card.locked {
            opacity: 0.5;
            pointer-events: none;
            position: relative;
        }

        .giorno-card.locked::after {
            content: '🔒';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 48px;
            opacity: 0.3;
        }

        /* ========================================
           UPGRADE CARD (FREE USERS)
           ======================================== */

        .upgrade-card {
            background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
            color: white;
            padding: 35px;
            border-radius: 16px;
            text-align: center;
            margin-top: 30px;
            box-shadow: 0 8px 28px rgba(241, 39, 17, 0.3);
        }

        .upgrade-card h3 {
            font-size: 26px;
            margin-bottom: 14px;
            font-family: 'Oswald', sans-serif;
        }

        .upgrade-card p {
            font-size: 16px;
            margin-bottom: 22px;
            opacity: 0.95;
            line-height: 1.6;
        }

        .btn-upgrade {
            background: white;
            color: #f12711;
            padding: 16px 36px;
            border: none;
            border-radius: 12px;
            font-weight: 800;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: 'Montserrat', sans-serif;
        }

        .btn-upgrade:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 24px rgba(255,255,255,0.4);
        }

        /* ========================================
           RESPONSIVE
           ======================================== */

        @media (max-width: 768px) {
            .diet-tabs {
                flex-direction: column;
                gap: 8px;
            }

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

            .week-selector {
                justify-content: flex-start;
            }

            .day-btn {
                min-width: 55px;
                padding: 12px 14px;
                font-size: 13px;
            }

            .btn-favorite,
            .btn-registra,
            .btn-sostituisci {
                width: 100%;
                margin-bottom: 8px;
            }
        }

        /* Toast notifications */
        @keyframes slideIn {
            from {
                transform: translateX(400px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(400px);
                opacity: 0;
            }
        }

        @media (max-width: 480px) {
            .macro-summary {
                grid-template-columns: repeat(2, 1fr);
            }

            .riepilogo-settimana {
                grid-template-columns: 1fr;
            }

            .pasto-actions {
                flex-direction: column;
            }

            .btn-registra,
            .btn-sostituisci {
                width: 100%;
            }
        }

        /* ========================================
           DAY SUMMARY MODAL
           ======================================== */
        .day-summary-modal-backdrop {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9998;
            backdrop-filter: blur(4px);
        }

        .day-summary-modal-backdrop.active {
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.2s ease-out;
        }

        .day-summary-modal {
            background: white;
            border-radius: 16px;
            max-width: 600px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.3s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

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

        .day-summary-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem;
            border-bottom: 2px solid #f0f0f0;
            background: linear-gradient(135deg, var(--teal), var(--blu-chiaro));
            color: white;
            border-radius: 16px 16px 0 0;
        }

        .day-summary-header h3 {
            margin: 0;
            font-size: 1.3rem;
        }

        .day-summary-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 1.5rem;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            transition: background 0.2s;
        }

        .day-summary-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .day-summary-body {
            padding: 1.5rem;
        }

        .day-summary-section {
            margin-bottom: 1.5rem;
        }

        .day-summary-section h4 {
            margin: 0 0 0.8rem 0;
            color: var(--teal);
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .day-summary-objective {
            background: #f8f9fa;
            padding: 1rem;
            border-radius: 8px;
            border-left: 4px solid var(--teal);
        }

        .day-summary-objective-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0.5rem 0;
            font-size: 0.95rem;
        }

        .day-summary-meals {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }

        .day-summary-meal {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.8rem;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #ddd;
        }

        .day-summary-meal.completed {
            border-left-color: #28a745;
            background: #e8f5e9;
        }

        .day-summary-meal.pending {
            border-left-color: #ffc107;
            background: #fff8e1;
        }

        .day-summary-meal.missed {
            border-left-color: #dc3545;
            background: #ffebee;
        }

        .day-summary-meal-info {
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .day-summary-meal-icon {
            font-size: 1.5rem;
        }

        .day-summary-macro-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-top: 0.8rem;
        }

        .day-summary-macro-item {
            background: #f8f9fa;
            padding: 0.8rem;
            border-radius: 8px;
            text-align: center;
        }

        .day-summary-macro-item strong {
            display: block;
            font-size: 1.3rem;
            color: var(--teal);
            margin-bottom: 0.2rem;
        }

        .day-summary-macro-item span {
            font-size: 0.85rem;
            color: #666;
        }

        .day-summary-footer {
            padding: 1.5rem;
            border-top: 2px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f8f9fa;
        }

        .day-summary-score {
            font-size: 1.8rem;
            font-weight: bold;
            color: var(--teal);
        }

        .day-summary-btn-detail {
            background: var(--teal);
            color: white;
            border: none;
            padding: 0.7rem 1.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }

        .day-summary-btn-detail:hover {
            background: var(--blu-chiaro);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .day-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.3rem 0.7rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .day-badge.training {
            background: #e3f2fd;
            color: #1976d2;
        }

        .day-badge.rest {
            background: #f3e5f5;
            color: #7b1fa2;
        }

        .day-badge.high-carb {
            background: #fff3e0;
            color: #e65100;
        }

        .day-badge.normal-carb {
            background: #f1f8e9;
            color: #558b2f;
        }

        .day-badge.low-carb {
            background: #fce4ec;
            color: #c2185b;
        }

        .day-badge.sgarro {
            background: #ffebee;
            color: #c62828;
        }

        @media (max-width: 600px) {
            .day-summary-modal {
                width: 95%;
                max-height: 95vh;
            }

            .day-summary-macro-grid {
                grid-template-columns: 1fr;
            }

            .day-summary-footer {
                flex-direction: column;
                gap: 1rem;
            }
        }

        /* ========================================
           WEEKLY GRID - Piano Settimanale
           ======================================== */
        .weekly-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            padding: 1rem 0;
        }

        .weekly-day-card {
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .weekly-day-card:hover {
            border-color: #5c6bc0;
            box-shadow: 0 4px 12px rgba(92, 107, 192, 0.15);
            transform: translateY(-2px);
        }

        .weekly-day-card.today {
            border-color: #5c6bc0;
            background: #f5f7ff;
        }

        .weekly-day-card.completed {
            background: #f1f8f4;
            border-color: #4caf50;
        }

        /* DOPPIO BORDO: Giorno corrente + completato */
        .weekly-day-card.today.completed {
            position: relative;
            border: 3px solid #5c6bc0; /* Bordo esterno blu (oggi) */
            background: linear-gradient(
                to right,
                rgba(76, 175, 80, 0.08) 0%,   /* Verde chiaro sinistra */
                rgba(92, 107, 192, 0.08) 100% /* Blu chiaro destra */
            );
            box-shadow:
                inset 0 0 0 3px #4CAF50,           /* Bordo interno verde (completato) */
                0 4px 16px rgba(92, 107, 192, 0.25), /* Ombra blu esterna */
                0 4px 16px rgba(76, 175, 80, 0.15);  /* Ombra verde secondaria */
        }

        .weekly-day-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid #f0f0f0;
        }

        .weekly-day-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: #333;
        }

        .weekly-day-date {
            font-size: 0.9rem;
            color: #666;
        }

        .weekly-day-badges {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .weekly-day-meals {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .weekly-meal-summary {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            color: #555;
        }

        .weekly-meal-icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .weekly-meal-check {
            color: #4caf50;
            font-weight: bold;
        }

        .weekly-meal-pending {
            color: #999;
        }

        .weekly-macros-summary {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            gap: 0.5rem;
            font-size: 0.85rem;
            flex-wrap: wrap;
        }

        .macro-item-weekly {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .macro-item-weekly .macro-icon {
            font-size: 1rem;
        }

        .macro-item-weekly .macro-value {
            font-weight: 700;
            font-size: 0.9rem;
        }

        .macro-item-weekly .macro-unit {
            font-size: 0.75rem;
            opacity: 0.8;
        }

        /* Colori differenziati per tipo macro */
        .macro-calories .macro-value {
            color: #D98C38; /* Arancione */
        }

        .macro-protein .macro-value {
            color: #5c6bc0; /* Blu */
        }

        .macro-carbs .macro-value {
            color: #FFA726; /* Giallo-arancione */
        }

        .macro-fats .macro-value {
            color: #66BB6A; /* Verde */
        }

        /* ========================================
           CUSTOM TOOLTIP CSS
           ======================================== */
        .has-tooltip {
            position: relative;
            display: inline-block;
        }

        .info-icon {
            font-size: 0.9rem;
            opacity: 0.6;
            cursor: help;
            margin-left: 6px;
            transition: opacity 0.2s;
        }

        .info-icon:hover {
            opacity: 1;
        }

        .tooltip-content {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            background: rgba(0, 0, 0, 0.92);
            color: white;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 0.85rem;
            white-space: nowrap;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            pointer-events: none;
        }

        .has-tooltip:hover .tooltip-content {
            display: block;
            animation: tooltipFadeIn 0.2s ease-out;
        }

        /* Freccia del tooltip */
        .tooltip-content::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(0, 0, 0, 0.92);
        }

        /* Tooltip multi-riga */
        .tooltip-content.multiline {
            white-space: normal;
            max-width: 280px;
            line-height: 1.4;
        }

        @keyframes tooltipFadeIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(-12px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(-8px);
            }
        }

        /* Tooltip su mobile */
        @media (max-width: 768px) {
            .tooltip-content {
                position: fixed;
                left: 50%;
                bottom: auto;
                top: 50%;
                transform: translate(-50%, -50%);
                max-width: 90%;
                white-space: normal;
            }

            .tooltip-content::after {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .weekly-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ========================================
           OBIETTIVI ENHANCED - Progress Bars
           ======================================== */
        .objective-section {
            margin-bottom: 1.5rem;
        }

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

        .objective-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: #333;
        }

        .objective-badges {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .progress-item {
            margin-bottom: 1rem;
        }

        .progress-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
            color: #555;
        }

        .progress-bar-container {
            width: 100%;
            height: 24px;
            background: #f0f0f0;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #5c6bc0 0%, #7986cb 100%);
            border-radius: 12px;
            transition: width 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .progress-bar-fill.success {
            background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
        }

        .progress-bar-fill.warning {
            background: linear-gradient(90deg, #ff9800 0%, #ffa726 100%);
        }

        .progress-bar-fill.danger {
            background: linear-gradient(90deg, #f44336 0%, #e57373 100%);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }

        .stat-card {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 1rem;
            text-align: center;
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: #5c6bc0;
            margin-bottom: 0.25rem;
        }

        .stat-label {
            font-size: 0.85rem;
            color: #666;
        }

        /* Badge scostamento percentuale */
        .stat-diff-badge {
            display: inline-block;
            margin-top: 0.5rem;
            padding: 0.3rem 0.7rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 700;
        }

        .stat-card.on-target .stat-diff-badge {
            background: #e8f5e9;
            color: #4CAF50;
        }

        .stat-card.over-target .stat-diff-badge {
            background: #fff3e0;
            color: #FF9800;
        }

        .stat-card.under-target .stat-diff-badge {
            background: #e3f2fd;
            color: #2196F3;
        }

        .objective-score {
            display: inline-block;
            padding: 0.5rem 1rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 20px;
            font-weight: 600;
            font-size: 1rem;
        }

        /* ═══════════════════════════════════════════════════════════
           SPRINT 3.5: AI LEARNING PROGRESS CARD
           ══════════════════════════════════════════════════════════ */

        .ai-learning-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white !important;
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 1.5rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .ai-learning-card h2 {
            color: white !important;
            margin-bottom: 1rem;
        }

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

        .info-tooltip {
            font-size: 1.2rem;
            cursor: help;
            opacity: 0.8;
            transition: opacity 0.3s ease;
        }

        .info-tooltip:hover {
            opacity: 1;
        }

        .progress-bar-container {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            height: 40px;
            margin: 15px 0;
            overflow: hidden;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
        }

        .progress-bar-fill {
            height: 100%;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1rem;
            transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }

        .progress-bar-fill span {
            color: white;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
        }

        .learning-phase-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 1rem 0;
            font-size: 1rem;
        }

        .learning-phase-badge {
            display: inline-block;
            padding: 0.4rem 0.9rem;
            border-radius: 16px;
            font-weight: 600;
            font-size: 0.95rem;
        }

        .learning-phase-badge.beginner {
            background: rgba(243, 156, 18, 0.3);
            border: 2px solid rgba(243, 156, 18, 0.6);
        }

        .learning-phase-badge.intermediate {
            background: rgba(52, 152, 219, 0.3);
            border: 2px solid rgba(52, 152, 219, 0.6);
        }

        .learning-phase-badge.advanced {
            background: rgba(39, 174, 96, 0.3);
            border: 2px solid rgba(39, 174, 96, 0.6);
        }

        .learning-hint {
            font-size: 0.95rem;
            opacity: 0.9;
            margin: 1rem 0;
            line-height: 1.4;
        }

        .stats-mini {
            display: flex;
            justify-content: space-around;
            margin-top: 1.2rem;
            padding-top: 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
        }

        .stat-mini-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
        }

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

        .stat-mini-item span:nth-child(2) {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .stat-mini-label {
            font-size: 0.8rem;
            opacity: 0.8;
        }

        .next-milestone {
            margin-top: 1.2rem;
            padding: 1rem;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            border-left: 4px solid rgba(255, 255, 255, 0.5);
        }

        .milestone-text {
            font-size: 0.95rem;
            margin-bottom: 0.5rem;
        }

        .milestone-progress {
            font-size: 0.85rem;
            opacity: 0.85;
        }

        /* ═══════════════════════════════════════════════════════════
           DISLIKE MEAL MODAL STYLES
           ══════════════════════════════════════════════════════════ */

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        .dislike-modal-content {
            position: relative;
            z-index: 1000;
            max-width: 500px;
            margin: 50px auto;
            background: white;
            border-radius: 12px;
            padding: 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .dislike-modal-content .modal-footer {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 1px solid #e0e0e0;
        }

        .dislike-modal-content .modal-footer .btn-secondary,
        .dislike-modal-content .modal-footer .btn-primary {
            flex: 1;
            padding: 1rem 1.5rem;
            font-size: 1rem;
            font-weight: 600;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .dislike-modal-content .modal-footer .btn-secondary {
            background: #f5f5f5;
            color: #666;
            border: 2px solid #ddd;
        }

        .dislike-modal-content .modal-footer .btn-secondary:hover {
            background: #e8e8e8;
            border-color: #ccc;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .dislike-modal-content .modal-footer .btn-primary {
            background: linear-gradient(135deg, #226a68, #2eaaa8);
            color: white;
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .dislike-modal-content .modal-footer .btn-primary:hover {
            background: linear-gradient(135deg, #2eaaa8, #226a68);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(34, 106, 104, 0.4);
        }

        .dislike-modal-content .modal-footer .btn-primary:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .meal-name {
            font-size: 1rem;
            margin-bottom: 1rem;
            padding: 0.8rem;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .ingredient-checkboxes {
            display: flex;
            flex-direction: column;
            gap: 0.7rem;
            margin: 1rem 0;
            max-height: 300px;
            overflow-y: auto;
            padding: 0.5rem;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .checkbox-ingredient {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.7rem;
            background: white;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }

        .checkbox-ingredient:hover {
            background: #e3f2fd;
            border-color: #2196F3;
        }

        .checkbox-ingredient input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .checkbox-ingredient input[type="checkbox"]:checked + span {
            font-weight: 600;
            color: #2196F3;
        }

        .checkbox-ingredient.already-disliked {
            background: #f5f5f5;
            border-color: #ddd;
            opacity: 0.7;
            cursor: not-allowed;
        }

        .checkbox-ingredient.already-disliked:hover {
            background: #f5f5f5;
            border-color: #ddd;
        }

        .already-disliked-badge {
            display: inline-block;
            padding: 2px 8px;
            background: #4caf50;
            color: white;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-left: 8px;
        }

        .checkbox-all {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.8rem;
            background: #fff3e0;
            border-radius: 8px;
            margin: 1rem 0;
            cursor: pointer;
            font-weight: 600;
            border: 2px solid #ff9800;
        }

        .checkbox-all input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .form-select {
            width: 100%;
            padding: 0.8rem;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 0.95rem;
            margin-top: 0.5rem;
            transition: border-color 0.2s ease;
        }

        .form-select:focus {
            outline: none;
            border-color: #2196F3;
        }

        .no-ingredients {
            text-align: center;
            padding: 2rem;
            color: #999;
            font-style: italic;
        }

        .replace-confirm-content {
            position: relative;
            z-index: 1000;
            max-width: 450px;
            margin: 100px auto;
            background: white;
            border-radius: 12px;
            padding: 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .replace-confirm-content .modal-footer {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid #e0e0e0;
        }

        .replace-confirm-content .modal-footer .btn-secondary,
        .replace-confirm-content .modal-footer .btn-primary {
            flex: 1;
            padding: 1rem 1.5rem;
            font-size: 1rem;
            font-weight: 600;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .replace-confirm-content .modal-footer .btn-secondary {
            background: #f5f5f5;
            color: #666;
            border: 2px solid #ddd;
        }

        .replace-confirm-content .modal-footer .btn-secondary:hover {
            background: #e8e8e8;
            border-color: #ccc;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .replace-confirm-content .modal-footer .btn-primary {
            background: linear-gradient(135deg, #226a68, #2eaaa8);
            color: white;
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .replace-confirm-content .modal-footer .btn-primary:hover {
            background: linear-gradient(135deg, #2eaaa8, #226a68);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(34, 106, 104, 0.4);
        }

        .btn-dislike {
            background: #dc3545;
            color: white;
            border: none;
            padding: 10px 18px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
        }

        .btn-dislike:hover {
            background: #c82333;
            box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
            transform: translateY(-2px);
        }

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

        /* ==========================================
           WATER TRACKING WIDGET v2.0 (Sprint 5 - Refactored)
           ========================================== */

        .water-tracking-container {
            margin-top: 2rem;
        }

        .water-tracking-card {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            border: 2px solid var(--blu-chiaro);
        }

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

        .water-tracking-header h3 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0;
        }

        /* Input Controls Section */
        .water-input-controls {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1.5rem;
            margin: 1.5rem 0;
            padding: 1rem;
            background: #f8f9fa;
            border-radius: 12px;
        }

        .water-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 2px solid var(--teal);
            background: white;
            color: var(--teal);
            font-size: 1.8rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        .water-btn:hover {
            background: var(--teal);
            color: white;
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

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

        .water-btn-plus span,
        .water-btn-minus span {
            margin-top: -3px;
        }

        .water-input-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: white;
            padding: 0.75rem 1.25rem;
            border-radius: 12px;
            border: 2px solid var(--blu-chiaro);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        .water-input-wrapper input {
            width: 80px;
            border: none;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--teal);
            text-align: center;
            outline: none;
            background: transparent;
        }

        .water-input-wrapper input::-webkit-outer-spin-button,
        .water-input-wrapper input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .water-input-wrapper input[type=number] {
            -moz-appearance: textfield;
        }

        .water-unit {
            font-size: 1.2rem;
            font-weight: 600;
            color: #666;
        }

        /* Progress Bar with Milestones */
        .water-progress-container {
            width: 100%;
            margin: 1.5rem 0;
        }

        .water-progress-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
            font-size: 0.95rem;
            color: #666;
        }

        .water-progress-current {
            font-weight: 700;
            color: var(--teal);
            font-size: 1.1rem;
        }

        .water-progress-target {
            font-weight: 600;
            color: #999;
        }

        .water-progress-bar {
            width: 100%;
            height: 40px;
            background: #f0f0f0;
            border-radius: 20px;
            overflow: visible;
            position: relative;
            box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
        }

        /* Milestone Lines */
        .water-milestone-line {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 2px;
            background: rgba(0, 0, 0, 0.15);
            z-index: 1;
        }

        .water-milestone-line::after {
            content: '';
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 8px;
            height: 8px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 50%;
        }

        .water-milestone-label {
            position: absolute;
            top: -30px;
            left: 0;
            transform: translateX(-50%);
            font-size: 0.75rem;
            font-weight: 600;
            color: #666;
            white-space: nowrap;
        }

        /* Progress Fill with Dynamic Colors */
        .water-progress-fill {
            height: 100%;
            border-radius: 20px;
            transition: width 0.6s ease, background 0.4s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 2;
            min-width: 60px;
        }

        .water-progress-fill span {
            color: white;
            font-weight: 700;
            font-size: 1rem;
            text-shadow: 0 1px 3px rgba(0,0,0,0.3);
            z-index: 3;
        }

        /* Dynamic Color Levels */
        .water-level-danger {
            background: linear-gradient(90deg, #ff6b6b 0%, #ee5a6f 100%);
        }

        .water-level-warning {
            background: linear-gradient(90deg, #ffa500 0%, #ffb347 100%);
        }

        .water-level-success {
            background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
        }

        .water-level-excellent {
            background: linear-gradient(90deg, #2196f3 0%, #42a5f5 100%);
        }

        .water-level-max {
            background: linear-gradient(90deg, #1976d2 0%, #2196f3 100%);
            animation: waterPulse 2s infinite;
        }

        @keyframes waterPulse {
            0%, 100% {
                box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
            }
            50% {
                box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
            }
        }

        /* Warning Modal */
        .water-warning-modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 10000;
            display: none;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }

        .water-warning-modal-backdrop.active {
            display: flex;
            animation: fadeIn 0.3s ease-out;
        }

        .water-warning-modal {
            background: white;
            border-radius: 16px;
            max-width: 500px;
            width: 90%;
            padding: 2rem;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.3s ease-out;
        }

        .water-warning-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .water-warning-icon {
            font-size: 3rem;
        }

        .water-warning-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: #ff9800;
            margin: 0;
        }

        .water-warning-body {
            margin-bottom: 1.5rem;
            line-height: 1.6;
            color: #555;
        }

        .water-warning-body p {
            margin-bottom: 1rem;
        }

        .water-warning-body strong {
            color: #d32f2f;
            font-weight: 700;
        }

        .water-warning-footer {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .water-warning-checkbox {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem;
            background: #f8f9fa;
            border-radius: 8px;
            cursor: pointer;
        }

        .water-warning-checkbox input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .water-warning-checkbox label {
            cursor: pointer;
            font-size: 0.95rem;
            color: #666;
        }

        .water-warning-actions {
            display: flex;
            gap: 1rem;
        }

        .water-warning-btn {
            flex: 1;
            padding: 0.9rem 1.5rem;
            border: none;
            border-radius: 10px;
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

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

        .water-warning-btn-primary:hover {
            background: var(--blu-chiaro);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(34, 106, 104, 0.3);
        }

        .water-warning-btn-secondary {
            background: #f5f5f5;
            color: #666;
            border: 2px solid #ddd;
        }

        .water-warning-btn-secondary:hover {
            background: #e8e8e8;
            border-color: #ccc;
        }

        /* Toast Notification */
        .water-toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: var(--teal);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
            z-index: 9999;
            font-weight: 600;
            animation: slideInUp 0.4s ease-out;
        }

        .water-toast.hiding {
            animation: slideOutDown 0.4s ease-out;
        }

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

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

        /* Mobile Responsive */
        @media (max-width: 600px) {
            .water-input-controls {
                gap: 1rem;
                padding: 0.75rem;
            }

            .water-btn {
                width: 45px;
                height: 45px;
                font-size: 1.5rem;
            }

            .water-input-wrapper input {
                width: 70px;
                font-size: 1.3rem;
            }

            .water-progress-bar {
                height: 35px;
            }

            .water-warning-modal {
                width: 95%;
                padding: 1.5rem;
            }

            .water-warning-actions {
                flex-direction: column;
            }

            .water-toast {
                bottom: 20px;
                right: 20px;
                left: 20px;
            }
        }
