      .stats {
            display: flex;
            gap: 15px;
            margin-top: 10px;
            flex-wrap: wrap;
        }

        .stat-box {
            padding: 8px 12px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 13px;
        }

        .stat-box.clashes {
            background-color: #ffebee;
            color: #c62828;
        }

        .stat-box.warnings {
            background-color: #fff3e0;
            color: #ef6c00;
        }

        .controls {
            background-color: white;
            padding: 12px;
            margin-bottom: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

        .search-box {
            padding: 6px 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 13px;
            width: 200px;
        }

        .filter-btn {
            padding: 6px 12px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .filter-btn.active {
            background-color: #2c3e50;
            color: white;
        }

        .filter-btn:not(.active) {
            background-color: white;
            color: #666;
            border: 1px solid #ddd;
        }

        .filter-btn:not(.active):hover {
            background-color: #f8f9fa;
        }

        .timeline-container {
            background-color: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            overflow-x: auto;
        }

        .timeline-header {
            display: flex;
            margin-bottom: 10px;
            position: sticky;
            top: 0;
            background-color: white;
            z-index: 100;
            padding-bottom: 8px;
            border-bottom: 2px solid #e0e0e0;
        }

        .timeline-label-column {
            width: 150px;
            flex-shrink: 0;
            font-weight: 600;
            font-size: 12px;
            color: #2c3e50;
            padding-right: 10px;
        }

        .timeline-grid-container {
            flex: 1;
            min-width: 800px;
            position: relative;
        }

        .time-axis {
            display: flex;
            height: 24px;
            position: relative;
            border-bottom: 1px solid #ccc;
        }

        .time-marker {
            flex: 1;
            text-align: center;
            font-size: 10px;
            color: #666;
            border-left: 1px solid #e0e0e0;
            padding-top: 3px;
        }

        .time-marker:first-child {
            border-left: none;
        }

        .time-marker.hour {
            font-weight: 600;
            color: #2c3e50;
        }

        .athlete-row {
            display: flex;
            min-height: 35px;
            border-bottom: 1px solid #f0f0f0;
            transition: background-color 0.2s;
        }

        .athlete-row:hover {
            background-color: #f8f9fa;
        }

        .athlete-row.hidden {
            display: none;
        }

        .athlete-label {
            width: 150px;
            flex-shrink: 0;
            padding: 6px 10px 6px 0;
            display: flex;
            align-items: center;
            justify-content: space-between;  /* Spreads items to edges */
            gap: 6px;
            font-size: 12px;
            font-weight: 500;
            color: #2c3e50;
        }

        .athlete-label .status-indicator {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .athlete-label .status-indicator.clash {
            background-color: #f44336;
            box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
        }

        .athlete-label .status-indicator.warning {
            background-color: #ff9800;
            box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
        }

        .athlete-label .status-indicator.ok {
            background-color: #4caf50;
        }

        .timeline-track {
            flex: 1;
            min-width: 800px;
            position: relative;
            padding: 6px 0;
        }

        .timeline-grid {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            pointer-events: none;
        }

        .grid-column {
            flex: 1;
            border-left: 1px solid #f5f5f5;
        }

        .grid-column.hour {
            border-left: 1px solid #e8e8e8;
        }

        /* Compact bar styles - single row layout */
        .race-label {
            position: absolute;
            height: 14px;
            top: 0;
            background-color: rgba(255, 255, 255, 0.95);
            border: 1px solid #ddd;
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 6px;
            font-size: 10px;
            font-weight: 600;
            color: #2c3e50;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
            pointer-events: auto;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 20;
        }

        .race-label.clash {
            border-color: #f44336;
            color: #c62828;
            background-color: rgba(255, 235, 238, 0.95);
        }

        .race-label.warning {
            border-color: #ff9800;
            color: #ef6c00;
            background-color: rgba(255, 243, 224, 0.95);
        }

        .race-label .race-num {
            font-weight: 700;
            margin-right: 4px;
        }

        .race-label .boat-type {
            font-weight: 500;
            opacity: 0.85;
        }

        .report-bar {
            position: absolute;
            height: 3px;
            top: 16px;
            border-radius: 2px;
            background: repeating-linear-gradient(
                90deg,
                rgba(156, 39, 176, 0.4),
                rgba(156, 39, 176, 0.4) 4px,
                rgba(156, 39, 176, 0.2) 4px,
                rgba(156, 39, 176, 0.2) 8px
            );
            border: 1px solid rgba(156, 39, 176, 0.5);
        }

        .report-bar.clash {
            background: repeating-linear-gradient(
                90deg,
                rgba(244, 67, 54, 0.4),
                rgba(244, 67, 54, 0.4) 4px,
                rgba(244, 67, 54, 0.2) 4px,
                rgba(244, 67, 54, 0.2) 8px
            );
            border-color: rgba(244, 67, 54, 0.6);
        }

        .report-bar.warning {
            background: repeating-linear-gradient(
                90deg,
                rgba(255, 152, 0, 0.4),
                rgba(255, 152, 0, 0.4) 4px,
                rgba(255, 152, 0, 0.2) 4px,
                rgba(255, 152, 0, 0.2) 8px
            );
            border-color: rgba(255, 152, 0, 0.6);
        }

        .onwater-bar {
            position: absolute;
            height: 5px;
            top: 16px;
            border-radius: 2px;
            background: linear-gradient(135deg, rgba(33, 150, 243, 0.6) 0%, rgba(33, 150, 243, 0.4) 100%);
            border: 1px solid rgba(33, 150, 243, 0.6);
            z-index: 10;
        }

        .onwater-bar.clash {
            background: linear-gradient(135deg, rgba(244, 67, 54, 0.6) 0%, rgba(244, 67, 54, 0.4) 100%);
            border-color: rgba(244, 67, 54, 0.7);
        }

        .onwater-bar.warning {
            background: linear-gradient(135deg, rgba(255, 152, 0, 0.6) 0%, rgba(255, 152, 0, 0.4) 100%);
            border-color: rgba(255, 152, 0, 0.7);
        }

        .race-bar {
            position: absolute;
            height: 8px;
            top: 14px;
            border-radius: 3px;
            display: flex;
            align-items: center;
            padding: 0;
            font-size: 9px;
            font-weight: 600;
            color: white;
            transition: all 0.2s;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
            pointer-events: auto;
            cursor: pointer;
            gap: 3px;
            z-index: 15;
        }

        .race-bar:hover {
            height: 10px;
            top: 13px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.3);
            z-index: 25;
        }

        .race-bar.normal {
            background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        }

        .race-bar.clash {
            background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
            animation: pulse-clash 2s infinite;
        }

        .race-bar.warning {
            background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
        }

        @keyframes pulse-clash {
            0%, 100% {
                box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 0 rgba(244, 67, 54, 0.7);
            }
            50% {
                box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 4px rgba(244, 67, 54, 0);
            }
        }

        .race-bar .race-number {
            font-weight: 700;
            font-size: 10px;
            min-width: 12px;
        }

        .race-bar .race-event {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 8px;
        }

        .race-bar .race-time {
            font-size: 7px;
            opacity: 0.85;
            margin-left: auto;
        }

        .recovery-bar {
            position: absolute;
            height: 3px;
            top: 21px;
            border-radius: 2px;
            background: repeating-linear-gradient(
                90deg,
                rgba(129, 199, 132, 0.4),
                rgba(129, 199, 132, 0.4) 4px,
                rgba(129, 199, 132, 0.2) 4px,
                rgba(129, 199, 132, 0.2) 8px
            );
            border: 1px solid rgba(129, 199, 132, 0.5);
        }

        .recovery-bar.clash {
            background: repeating-linear-gradient(
                90deg,
                rgba(244, 67, 54, 0.4),
                rgba(244, 67, 54, 0.4) 4px,
                rgba(244, 67, 54, 0.2) 4px,
                rgba(244, 67, 54, 0.2) 8px
            );
            border-color: rgba(244, 67, 54, 0.6);
        }

        .recovery-bar.warning {
            background: repeating-linear-gradient(
                90deg,
                rgba(255, 152, 0, 0.4),
                rgba(255, 152, 0, 0.4) 4px,
                rgba(255, 152, 0, 0.2) 4px,
                rgba(255, 152, 0, 0.2) 8px
            );
            border-color: rgba(255, 152, 0, 0.6);
        }

        .clash-connector {
            position: absolute;
            height: 2px;
            background-color: #f44336;
            top: 18px;
            z-index: 5;
            opacity: 0.5;
        }

        .clash-connector::before,
        .clash-connector::after {
            content: '';
            position: absolute;
            width: 5px;
            height: 5px;
            background-color: #f44336;
            border-radius: 50%;
            top: 50%;
            transform: translateY(-50%);
        }

        .clash-connector::before {
            left: 0;
        }

        .clash-connector::after {
            right: 0;
        }

        .tooltip {
            position: fixed;
            background-color: rgba(0, 0, 0, 0.9);
            color: white;
            padding: 8px 10px;
            border-radius: 5px;
            font-size: 11px;
            pointer-events: none;
            z-index: 1000;
            max-width: 250px;
            display: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }

        .tooltip.show {
            display: block;
        }

        .tooltip-title {
            font-weight: 600;
            margin-bottom: 4px;
            color: #fff;
        }

        .tooltip-detail {
            font-size: 10px;
            opacity: 0.9;
            margin: 2px 0;
        }

        .tooltip-warning {
            margin-top: 6px;
            padding-top: 6px;
            border-top: 1px solid rgba(255,255,255,0.2);
            color: #ff9800;
            font-weight: 600;
        }

        .legend {
            margin-top: 12px;
            padding: 10px;
            background-color: #f8f9fa;
            border-radius: 4px;
            font-size: 10px;
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .legend-box {
            width: 24px;
            height: 12px;
            border-radius: 2px;
        }

        .no-results {
            text-align: center;
            padding: 30px;
            color: #999;
            font-size: 13px;
        }

        .zoom-controls {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .zoom-btn {
            padding: 5px 10px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
        }

        .zoom-btn:hover {
            background-color: #f8f9fa;
        }

        @media (max-width: 1024px) {
            .athlete-label {
                width: 120px;
            }
            
            .timeline-label-column {
                width: 120px;
            }
        }


         .detail-container {
            width : 100%
            margin: 0 auto;
            padding: 0px;
        }

.detail-header {
    background-color: white;
    padding: 2px 2px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-athlete-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-athlete-name {
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.detail-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}

.detail-status-badge.ok {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.detail-status-badge.warning {
    background-color: #fff3e0;
    color: #ef6c00;
}

.detail-status-badge.clash {
    background-color: #ffebee;
    color: #c62828;
}

/* Single row stats - compact inline style */
.detail-summary-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
}


.detail-stat-card {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 5px;  /* ADD BACK padding */
    background: white;  /* ADD BACK background */
    border: 1px solid #e0e0e0;  /* ADD border */
    border-radius: 6px;  /* ADD border radius */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);  /* ADD subtle shadow */
}


.detail-stat-label {
    font-size: 7px;
    color: #777;
    margin-bottom: 0;
    white-space: nowrap;
}

.detail-stat-value {
    font-size: 8px;
    font-weight: 700;
    color: #2c3e50;
}

.detail-back-button {
    display: none;  /* Hidden in embedded view */
}

        .detail-timeline-container {
            background-color: white;
            padding: 5px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            overflow-x: auto;
        }

        .detail-timeline-header {
            display: flex;
            margin-bottom: 2px;
            position: sticky;
            top: 0;
            background-color: white;
            z-index: 100;
            padding-bottom: 1px;
            border-bottom: 2px solid #e0e0e0;
        }

        .detail-timeline-label-column {
            width: 250px;
            flex-shrink: 0;
            font-weight: 600;
            font-size: 8px;
            color: #2c3e50;
            padding-right: 15px;
        }

        .detail-timeline-grid-container {
            flex: 1;
            min-width: 800px;
            position: relative;
        }

        .detail-time-axis {
            display: flex;
            height: 15px;
            position: relative;
            border-bottom: 1px solid #ccc;
        }

        .detail-time-marker {
            flex: 1;
            text-align: center;
            font-size: 7px;
            color: #666;
            border-left: 1px solid #e0e0e0;
            padding-bottom: 5px;
        }

        .detail-time-marker:first-child {
            border-left: none;
        }

        .detail-time-marker.hour {
            font-weight: 600;
            color: #2c3e50;
        }

        .detail-race-row {
            display: flex;
            min-height: 60px;
            border-bottom: 1px solid #f0f0f0;
            transition: background-color 0.2s;
        }

        .detail-race-row:hover {
            background-color: #f8f9fa;
        }

        .detail-race-row.clash {
            background-color: #ffebee;
        }

        .detail-race-row.warning {
            background-color: #fff3e0;
        }

        .detail-race-info {
            width: 250px;
            flex-shrink: 0;
            padding: 10px 15px 10px 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .detail-race-number {
            font-size: 10px;
            font-weight: 700;
            color: #2c3e50;
        }

        .detail-race-event {
            font-size: 8px;
            font-weight: 500;
            color: #555;
        }

        .detail-race-time {
            font-size: 7px;
            color: #777;
        }

        .detail-race-status {
            font-size: 7px;
            font-weight: 600;
            margin-top: 4px;
        }

        .detail-race-status.clash {
            color: #c62828;
        }

        .detail-race-status.warning {
            color: #ef6c00;
        }

        .detail-race-status.ok {
            color: #2e7d32;
        }

        .detail-timeline-track {
            flex: 1;
            min-width: 800px;
            position: relative;
            padding: 10px 0;
        }

        .detail-timeline-grid {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            pointer-events: none;
        }

        .detail-grid-column {
            flex: 1;
            border-left: 1px solid #f5f5f5;
        }

        .detail-grid-column.hour {
            border-left: 1px solid #e8e8e8;
        }

        /* Phase bars */
        .detail-phase-container {
            position: relative;
            height: 40px;
        }

        .detail-report-bar {
            position: absolute;
            height: 8px;
            top: 4px;
            border-radius: 3px;
            background: repeating-linear-gradient(
                90deg,
                rgba(156, 39, 176, 0.5),
                rgba(156, 39, 176, 0.5) 6px,
                rgba(156, 39, 176, 0.3) 6px,
                rgba(156, 39, 176, 0.3) 12px
            );
            border: 1px solid rgba(156, 39, 176, 0.6);
            display: flex;
            align-items: center;
            padding: 0 6px;
            font-size: 9px;
            color: #6a1b9a;
            font-weight: 600;
        }

        .detail-onwater-bar {
            position: absolute;
            height: 12px;
            top: 14px;
            border-radius: 3px;
            background: linear-gradient(135deg, rgba(33, 150, 243, 0.7) 0%, rgba(33, 150, 243, 0.5) 100%);
            border: 1px solid rgba(33, 150, 243, 0.7);
            display: flex;
            align-items: center;
            padding: 0 8px;
            font-size: 10px;
            color: #0d47a1;
            font-weight: 600;
            z-index: 10;
        }

        .detail-race-bar {
            position: absolute;
            height: 20px;
            top: 10px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 10px;
            font-size: 11px;
            font-weight: 700;
            color: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            z-index: 20;
            gap: 6px;
        }

        .detail-race-bar.normal {
            background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        }

        .detail-race-bar.clash {
            background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
            animation: detail-pulse-clash 2s infinite;
        }

        .detail-race-bar.warning {
            background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
        }

        @keyframes detail-pulse-clash {
            0%, 100% {
                box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 0 0 rgba(244, 67, 54, 0.7);
            }
            50% {
                box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 0 6px rgba(244, 67, 54, 0);
            }
        }

        .detail-race-bar-time {
            font-size: 10px;
            opacity: 0.9;
        }

        .detail-recovery-bar {
            position: absolute;
            height: 8px;
            top: 28px;
            border-radius: 3px;
            background: repeating-linear-gradient(
                90deg,
                rgba(129, 199, 132, 0.5),
                rgba(129, 199, 132, 0.5) 6px,
                rgba(129, 199, 132, 0.3) 6px,
                rgba(129, 199, 132, 0.3) 12px
            );
            border: 1px solid rgba(129, 199, 132, 0.6);
            display: flex;
            align-items: center;
            padding: 0 6px;
            font-size: 9px;
            color: #2e7d32;
            font-weight: 600;
        }

        .detail-clash-indicator {
            position: absolute;
            right: -30px;
            top: 50%;
            transform: translateY(-50%);
            background-color: #f44336;
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
            white-space: nowrap;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            z-index: 30;
        }

        .detail-clash-indicator::before {
            content: '';
            position: absolute;
            left: -6px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-top: 6px solid transparent;
            border-bottom: 6px solid transparent;
            border-right: 6px solid #f44336;
        }

        .detail-legend {
            margin-top: 20px;
            padding: 15px;
            background-color: #f8f9fa;
            border-radius: 6px;
            font-size: 11px;
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }

        .detail-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .detail-legend-box {
            width: 30px;
            height: 14px;
            border-radius: 3px;
        }

        

      




     
