/* ARIANE  Onglet Prédictions : cartes, cercles, calendrier semaine, toggle */

        /* PREDICTIONS STYLES */
        .predictions-main {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 50px;
        }

        @media (max-width: 1200px) {
            .predictions-main {
                grid-template-columns: 1fr;
            }
        }

        .prediction-card {
            background: white;
            border: 2px solid #ddd;
            border-radius: 16px;
            padding: 0;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .prediction-card:hover {
            border-color: #667eea;
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
        }

        .card-header {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.05) 100%);
            padding: 30px;
            border-bottom: 1px solid #ddd;
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .card-icon {
            font-size: 2.5rem;
        }

        .card-info h2 {
            font-size: 1.4rem;
            margin-bottom: 5px;
            color: #333;
        }

        .card-info p {
            color: #666;
            font-size: 0.9rem;
        }

        .card-body {
            padding: 40px;
        }

        .top-window {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.05) 100%);
            border: 2px solid #667eea;
            border-radius: 14px;
            padding: 35px;
            margin-bottom: 35px;
            text-align: center;
        }

        .top-label {
            color: #666;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 20px;
            font-weight: 700;
        }

        .top-content {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
            margin-bottom: 25px;
        }

        .top-circle {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: conic-gradient(var(--circle-color) 0deg, var(--circle-color) var(--percentage-deg), var(--circle-bg-light) var(--percentage-deg), var(--circle-bg-light) 360deg);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.8rem;
            color: var(--circle-text);
            box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
            flex-shrink: 0;
        }

        .top-text {
            flex: 1;
            min-width: 250px;
        }

        .top-time {
            font-size: 2.8rem;
            font-weight: 800;
            color: #667eea;
            margin-bottom: 8px;
            line-height: 1;
        }

        .top-range {
            font-size: 1.3rem;
            color: #666;
            margin-bottom: 15px;
        }

        .top-risk {
            display: inline-block;
            font-size: 1.3rem;
            padding: 10px 20px;
            border-radius: 25px;
            background: rgba(102, 126, 234, 0.2);
        }

        .sub-windows {
            margin-top: 25px;
            padding-top: 25px;
            border-top: 1px solid #ddd;
        }

        .sub-title {
            color: #666;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 15px;
            font-weight: 600;
        }

        .sub-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .sub-box {
            background: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            transition: all 0.3s ease;
        }

        .sub-box:hover {
            border-color: #667eea;
            background: #f5f7ff;
        }

        .sub-time {
            font-weight: 700;
            font-size: 1.2rem;
            color: #667eea;
            margin-bottom: 5px;
        }

        .sub-info {
            font-size: 0.9rem;
            color: #666;
        }

        .pred-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            margin-top: 20px;
        }

        .pred-stat {
            text-align: center;
        }

        .pred-stat-label {
            color: #666;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .pred-stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            color: #667eea;
        }

        .all-windows-pred {
            margin-top: 40px;
            padding-top: 40px;
            border-top: 2px solid #ddd;
            overflow: hidden;
        }

        .all-title-pred {
            font-size: 1.4rem;
            margin-bottom: 0;
            color: #333;
            font-weight: 700;
        }

        .breakdown-container-pred {
            background: #f9f9f9;
            padding: 20px;
            border-radius: 8px;
            margin-top: 30px;
            box-sizing: border-box;
            overflow: hidden;
        }

        .windows-grid-pred {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-top: 20px;
        }

        @media (max-width: 1200px) {
            .windows-grid-pred {
                grid-template-columns: 1fr;
            }
        }

        .windows-section-pred h3 {
            font-size: 1.1rem;
            margin-bottom: 20px;
            color: #667eea;
        }

        .window-item-pred {
            background: white;
            border: 1px solid #e0e0e0;
            border-left: 4px solid #667eea;
            border-radius: 8px;
            padding: 18px;
            margin-bottom: 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .window-item-pred:hover {
            background: #f5f7ff;
            border-color: #d0d8ff;
            border-left-color: #764ba2;
        }

        .window-left-pred {
            flex: 1;
        }

        .window-time-pred {
            font-weight: 700;
            color: #333;
            margin-bottom: 6px;
            font-size: 1rem;
        }

        .window-details-pred {
            font-size: 0.85rem;
            color: #666;
        }

        .window-right-pred {
            text-align: right;
            min-width: 100px;
        }

        .window-percent-pred {
            font-weight: 700;
            font-size: 1.4rem;
            color: #667eea;
        }

        .window-count-pred {
            font-size: 0.85rem;
            color: #666;
        }

        .history-list-pred {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 20px;
        }

        .history-item-pred {
            background: white;
            border: 1px solid #e0e0e0;
            border-left: 4px solid #667eea;
            border-radius: 8px;
            padding: 14px 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .history-item-pred:hover {
            background: #f5f7ff;
            border-color: #d0d8ff;
            border-left-color: #764ba2;
        }

        .history-user-pred {
            font-weight: 600;
            color: #333;
            font-size: 1rem;
        }

        .history-time-pred {
            display: flex;
            gap: 12px;
            align-items: center;
            font-size: 0.85rem;
        }

        .history-timestamp {
            color: #666;
        }

        .history-ago {
            background: rgba(102, 126, 234, 0.15);
            color: #667eea;
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 600;
            white-space: nowrap;
        }

        .validation-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin: 25px 0;
        }

        .validation-stat-box {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 15px;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .validation-stat-box:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.35);
        }

        .validation-stat-box.success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
        }

        .validation-stat-box.success:hover {
            box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
        }

        .validation-stat-box.error {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            box-shadow: 0 5px 15px rgba(239, 68, 68, 0.2);
        }

        .validation-stat-box.error:hover {
            box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35);
        }

        .validation-stat-box.accent {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            box-shadow: 0 5px 15px rgba(245, 158, 11, 0.2);
        }

        .validation-stat-box.accent:hover {
            box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
        }

        .validation-stat-icon {
            font-size: 2rem;
        }

        .validation-stat-content {
            flex: 1;
        }

        .validation-stat-label {
            font-size: 0.85rem;
            opacity: 0.9;
            margin-bottom: 5px;
        }

        .validation-stat-value {
            font-size: 1.8rem;
            font-weight: 700;
        }

        .validation-details {
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            padding: 20px;
            margin-top: 25px;
        }

        .validation-details h4 {
            margin: 0 0 15px;
            color: #333;
            font-size: 1.1rem;
        }

        .deviation-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
        }

        .deviation-item {
            background: #f9f9f9;
            padding: 12px 15px;
            border-radius: 8px;
            border-left: 4px solid #667eea;
        }

        .deviation-label {
            display: block;
            font-size: 0.85rem;
            color: #666;
            margin-bottom: 5px;
        }

        .deviation-value {
            display: block;
            font-size: 1.3rem;
            font-weight: 700;
            color: #667eea;
        }

        .pred-loading {
            text-align: center;
            padding: 60px 20px;
        }

        .pred-spinner {
            border: 4px solid #f0f0f0;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        .pred-spinner-text {
            color: #666;
            font-size: 1.1rem;
        }

        #pred-error-container {
            background: rgba(239, 68, 68, 0.1);
            border: 2px solid #ef4444;
            border-radius: 12px;
            padding: 25px;
            color: #ef4444;
            text-align: center;
            margin-bottom: 30px;
            font-size: 1.1rem;
            display: none;
        }

        @media (max-width: 768px) {
            .grid {
                grid-template-columns: 1fr;
            }

            header h1 {
                font-size: 1.8em;
            }

            .heatmap {
                grid-template-columns: 60px repeat(24, 25px);
                gap: 2px;
            }

            .heatmap-cell {
                width: 25px;
                height: 25px;
                font-size: 0.6em;
            }

            .tabs {
                gap: 6px;
                padding: 10px;
            }

            .tab-button {
                padding: 8px 12px;
                font-size: 0.82em;
            }

            .predictions-main {
                grid-template-columns: 1fr;
            }

            .top-content {
                gap: 20px;
            }
        }


/*  Sélecteur vue Aujourd'hui / Semaine  */

        /* PREDICTION VIEW TOGGLE */
        .prediction-view-toggle {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .view-toggle-btn {
            padding: 12px 24px;
            border: 2px solid #667eea;
            background: white;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 500;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            transition: all 0.3s ease;
            color: #667eea;
        }

        .view-toggle-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
        }

        .view-toggle-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }

        html.dark-mode .view-toggle-btn {
            background: var(--card-bg);
            border-color: #00d4ff;
            color: #00d4ff;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        html.dark-mode .view-toggle-btn:hover {
            background: rgba(0, 212, 255, 0.1);
            box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
        }

        html.dark-mode .view-toggle-btn.active {
            background: #00d4ff;
            border-color: #00d4ff;
            color: #000;
            box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
        }

        /* WEEK CALENDAR */
        .week-calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
            margin-top: 30px;
        }

        .calendar-day-card {
            background: white;
            border: 2px solid #ddd;
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            min-height: 380px;
            height: 100%;
        }

        .calendar-day-card:hover {
            border-color: #667eea;
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
        }

        .calendar-day-header {
            background: rgba(102, 126, 234, 0.1);
            color: #667eea;
            padding: 15px;
            text-align: center;
            border-bottom: 2px solid #667eea;
            border-radius: 12px 12px 0 0;
            border: 1px solid rgba(102, 126, 234, 0.3);
            flex-shrink: 0;
        }

        .calendar-day-name {
            font-size: 1.1rem;
            font-weight: 700;
            margin: 0;
        }

        .calendar-day-date {
            font-size: 0.85rem;
            opacity: 0.9;
            margin-top: 3px;
        }

        .calendar-day-anomaly {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #ff6b6b;
            color: white;
            padding: 5px 10px;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: bold;
        }

        .calendar-day-content {
            padding: 12px;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0;
            overflow: hidden;
        }

        .calendar-prediction-section {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 8px 0;
            flex: 1;
            overflow-y: auto;
            max-height: 140px;
        }

        .calendar-prediction-section:not(:last-child) {
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(102, 126, 234, 0.2);
        }

        .calendar-section-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: #667eea;
            margin-bottom: 5px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .calendar-window {
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 4px 0;
            font-size: 0.85rem;
        }

        .calendar-window-time {
            font-weight: 600;
            color: #333;
            font-size: 0.85rem;
        }

        .calendar-window-prob {
            font-size: 0.8rem;
            color: #667eea;
            font-weight: 500;
        }

        .calendar-no-data {
            color: #999;
            font-style: italic;
            text-align: center;
            padding: 20px;
            background: #f5f5f5;
            border-radius: 6px;
        }

        .calendar-anomaly-badge {
            display: inline-block;
            background: #ff6b6b;
            color: white;
            padding: 4px 10px;
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: bold;
            margin-top: 10px;
            width: 100%;
            text-align: center;
        }

        .calendar-anomaly-reason {
            font-size: 0.85rem;
            color: #ff6b6b;
            margin-top: 8px;
        }

