body {
    background-color: #f5f7fa;
    padding-top: 0px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    width: 100%;
    padding-top: 15px;
}
.header {
    text-align: center;
    margin-bottom: 15px;
}

.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-title {
    /*font-size: 1.5rem;*/
    color: #343a40;
}

.card-event-date{
    height: 135px;
}

.card-text {
    color: #6c757d;
}

.card-event-title{
    height: 85px
}
.card-event
{
    height: 100px;
}

.event-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #f7672b;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 10px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 4;
    overflow: hidden;
    background-color: #f0f0f0;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

}
 table.t1{
     margin: 1em auto;
     border-collapse: collapse;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
 }
 .t1 th, .t1 td{
     padding: 4px 8px;
 }

 .t1 thead th {
     background-color: #f7672b;
     color: #ffffff;
     text-transform: lowercase;
     text-align: left;
     font-size: 15px;
 }

.t1 tbody tr:nth-child(odd) {
    background: #dbe5f0;
}
.t1 tbody th, .t1 tbody tr:nth-child(even) td {
    border-right: 1px solid #95b3d7;
    border-left: 1px solid #95b3d7;
}
.t1 tbody th, .t1 tbody tr:nth-child(odd) td {
    border-right: 1px solid #95b3d7;
    border-left: 1px solid #95b3d7;
}

.t1 tfoot th {
background: #4f81bd;
text-align: left;
font-weight: normal;
font-size: 10px;
color: #fff;
}

.btn-lg
{
    font-size: 2.0rem;
}

.header {
    margin-bottom: 1.5rem;
}

.race-card {
    border-radius: 14px;
    overflow: hidden;
}

.race-card .card-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.race-card .btn {
    white-space: normal;
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-brand img {
        width: 26px;
        height: 26px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .race-card .btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .race-card .card-title {
        font-size: 1.15rem;
    }
}

.startlist-table {
    min-width: 760px;
}

.flag-icon {
    width: 22px;
    height: auto;
    margin-right: 2px;
    vertical-align: middle;
}

/* START BADGE */
.start-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.start-idle {
    background: #535353;
}

.start-future {
    background: #dc3545;
}

.start-soon {
    background: #fd7e14;
}

.start-past {
    background: #198754;
}

@media (max-width: 575.98px) {

    .table-responsive {
        overflow-x: visible;
    }

    .startlist-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 0.5rem;
    }

    .startlist-table thead {
        display: none;
    }

    .startlist-table tbody {
        display: block;
    }

    /* MOBILE CARD */
    .startlist-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "start bib"
            "rider rider"
            "team team"
            "nat nat";

        gap: 0.3rem 0.75rem;

        padding: 0.75rem;

        border: 1px solid #dee2e6;
        border-radius: 10px;

        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    /* ODD / EVEN CARD COLORS */
    .startlist-table.table-striped > tbody > tr:nth-of-type(odd) {
        --bs-table-accent-bg: transparent !important;
        background-color: #ffffff !important;
    }

    .startlist-table.table-striped > tbody > tr:nth-of-type(even) {
        --bs-table-accent-bg: transparent !important;
        background-color: #f1f3f5 !important;
    }

    /* RESET TD */
    .startlist-table td {
        display: block;
        width: auto;

        padding: 0;
        border: 0;

        background: transparent !important;
        box-shadow: none !important;
    }

    .startlist-table td::before {
        content: none;
    }

    /* START TIME */
    .startlist-table td.start-badge {
        grid-area: start;

    }


    /* BIB */
    .startlist-table td[data-label="Bib"] {
        grid-area: bib;

        display: flex;
        align-items: center;
        justify-content: flex-end;

        font-size: 1.25rem;
        font-weight: 800;

        color: #0d6efd;

        white-space: nowrap;
    }

    /* RIDER */
    .startlist-table td[data-label="Rider"] {
        grid-area: rider;

        font-size: 1.05rem;
        font-weight: 700;
        line-height: 1.2;
    }

    /* TEAM */
    .startlist-table td[data-label="Team"] {
        grid-area: team;

        font-size: 0.9rem;
        color: #6c757d;
    }

    /* NATIONALITY */
    .startlist-table td[data-label="Nat."] {
        grid-area: nat;

        display: flex;
        align-items: center;

        font-size: 0.9rem;
        color: #495057;
    }

    /* FLAG */
    .flag-icon {
        width: 20px;
        height: auto;
        margin-right: 0.4rem;
    }
}

.event-list-card {
    border-radius: 12px;
    overflow: hidden;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.event-meta i {
    margin-right: 0.25rem;
}

.event-description {
    color: #495057;
}

.event-action {
    min-width: 170px;
}

@media (max-width: 575.98px) {
    .event-list-card .card-body {
        padding: 0.9rem;
    }

    .event-title {
        font-size: 1.1rem;
        line-height: 1.25;
    }

    .event-meta {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.9rem;
    }

    .event-description {
        font-size: 0.9rem;
    }

    .event-action {
        min-width: 100%;
    }

    .event-action .btn {
        padding: 0.7rem 1rem;
        font-size: 1rem;
    }
}

.result-table {
    width: 100%;
}

.result-table th,
.result-table td {
    vertical-align: middle;
}

@media (max-width: 575.98px) {

    .result-table {
        border-collapse: separate;
        border-spacing: 0 0.5rem;
    }

    .result-table thead,
    .result-table tfoot {
        display: none;
    }

    .result-table tbody {
        display: block;
    }

    .result-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "rank bib"
            "rider rider"
            "nat nat"
            "result gap";

        gap: 0.3rem 0.75rem;

        padding: 0.75rem;
        border: 1px solid #dee2e6;
        border-radius: 10px;

        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .result-table.table-striped > tbody > tr:nth-of-type(odd) {
        --bs-table-accent-bg: transparent !important;
        background-color: #ffffff !important;
    }

    .result-table.table-striped > tbody > tr:nth-of-type(even) {
        --bs-table-accent-bg: transparent !important;
        background-color: #f1f3f5 !important;
    }

    .result-table td {
        display: block;
        width: auto;
        padding: 0;
        border: 0;
        background: transparent !important;
        box-shadow: none !important;
    }

    .result-table td[data-label="Rank"] {
        grid-area: rank;
        font-weight: 800;
        font-size: 1.15rem;
        color: #0d6efd;
    }

    .result-table td[data-label="Bib"] {
        grid-area: bib;
        font-weight: 800;
        font-size: 1.15rem;
        text-align: right;
        white-space: nowrap;
    }

    .result-table td[data-label="Rider"] {
        grid-area: rider;
        width: 100%;
        margin-top: 0.15rem;
        font-weight: 700;
        font-size: 1.05rem;
        line-height: 1.2;
    }

    /*.result-table td[data-label="Team"] {*/
    /*    grid-area: team;*/
    /*    font-size: 0.9rem;*/
    /*    color: #6c757d;*/
    /*}*/

    .result-table td[data-label="Result"] {
        grid-area: result;
        margin-top: 0.25rem;
        font-size: 1.05rem;
        font-weight: 800;
        color: #198754;
    }

    .result-table td[data-label="Nat."] {
        grid-area: nat;

        display: flex;
        align-items: center;

        font-size: 0.9rem;
        color: #495057;
    }

    .result-table td[data-label="Nat."]::before {
        content: none !important;
    }

    .result-table td:not([data-label="Rank"]):not([data-label="Bib"]):not([data-label="Rider"]):not([data-label="Team"]):not([data-label="Result"]) {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        font-size: 0.9rem;
        color: #495057;
    }

    .result-table td:not([data-label="Rank"]):not([data-label="Bib"]):not([data-label="Rider"]):not([data-label="Team"]):not([data-label="Result"])::before {
        content: attr(data-label);
        font-weight: 700;
        color: #212529;
    }

    .result-table td[data-label="Gap"] {
        grid-area: gap;

        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-width: 80px;
    }

    .result-table td[data-label="Gap"]::before {
        content: none !important;
    }

    .dropdown {
        margin-bottom: 1rem;
    }

    .dropdown .btn {
        width: 100%;
        text-align: left;
    }

    .rider-name {
        display: flex;
        align-items: center;
        gap: 4px;

        font-size: 1.05rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .team-name {
        margin-top: 2px;

        font-size: 0.85rem;
        color: #6c757d;

        line-height: 1.15;
    }
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 42px;
    height: 42px;

    padding: 0.25rem 0.6rem;

    border-radius: 999px;

    background: #0d6efd;
    color: #fff;

    font-weight: 800;
    font-size: 1rem;

    line-height: 1;
}

/* podium colors */
.rank-badge.rank-1 {
    background: #d4af37;
    color: #000;
}

.rank-badge.rank-2 {
    background: #c0c0c0;
    color: #000;
}

.rank-badge.rank-3 {
    background: #cd7f32;
    color: #fff;
}

.split-result {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.split-time {
    white-space: nowrap;
}

.split-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 22px;
    height: 22px;

    padding: 0 0.35rem;

    border-radius: 10px;

    font-size: 0.72rem;
    font-weight: 800;

    line-height: 1;

    background: #4c4c4e;
    color: #fff;
}

/* podium colors */
.split-rank-1 {
    background: #d4af37;
    color: #000;
}

.split-rank-2 {
    background: #c0c0c0;
    color: #000;
}

.split-rank-3 {
    background: #cd7f32;
    color: #fff;
}

.event-header {
    width: 100%;
}

.event-page-title {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.event-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.event-action-bar .btn {
    min-width: 180px;
}

@media (max-width: 575.98px) {

    .event-page-title {
        font-size: 1.8rem;
    }

    .event-action-bar {
        flex-direction: column;
    }

    .event-action-bar .btn {
        width: 100%;
        min-width: 100%;
    }
}

.event-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.3rem 0.7rem;

    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 700;

    white-space: nowrap;
}

/* FUTURE */
.event-status-future {
    background: #0d6efd;
    color: #fff;
}

/* TODAY */
.event-status-today {
    background: #198754;
    color: #fff;
}

/* PAST */
.event-status-past {
    background: #6c757d;
    color: #fff;
}

@media (max-width: 575.98px) {

    .event-status-badge {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }
}
.scroll-top-btn {
    position: fixed !important;

    left: auto !important;
    right: 20px !important;
    bottom: 20px !important;

    width: 52px !important;
    height: 52px !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: #0d6efd;
    color: #fff;

    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);

    z-index: 99999;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 575.98px) {
    .scroll-top-btn {
        left: auto !important;
        right: 12px !important;
        bottom: 12px !important;

        width: 48px !important;
        height: 48px !important;

        display: flex !important;
        z-index: 99999;
    }
}

.communique-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

.communique-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 42px;
    padding: 0.25rem 0.6rem;

    border-radius: 999px;

    background: #0d6efd;
    color: #fff;

    font-weight: 800;
    font-size: 0.9rem;
}

.communique-type {
    font-weight: 600;
}

.communique-document {
    font-weight: 600;
}

.communique-actions {
    white-space: nowrap;
}

.communique-actions .btn {
    margin-right: 0.25rem;
}

@media (max-width: 575.98px) {

    .communique-table-wrapper {
        overflow-x: visible;
        border-radius: 0;
    }

    .communique-table {
        border-collapse: separate;
        border-spacing: 0 0.5rem;
    }

    .communique-table thead {
        display: none;
    }

    .communique-table tbody {
        display: block;
    }

    .communique-table tr {
        display: grid;

        grid-template-columns: 1fr auto;
        grid-template-areas:
            "document number"
            "type number"
            "publication publication"
            "actions actions";

        gap: 0.25rem 0.75rem;

        padding: 0.75rem;

        border: 1px solid #dee2e6;
        border-radius: 10px;

        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .communique-table.table-striped > tbody > tr:nth-of-type(odd) {
        --bs-table-accent-bg: transparent !important;
        background-color: #ffffff !important;
    }

    .communique-table.table-striped > tbody > tr:nth-of-type(even) {
        --bs-table-accent-bg: transparent !important;
        background-color: #f1f3f5 !important;
    }

    .communique-table td {
        display: block;
        width: auto;

        padding: 0;
        border: 0;

        background: transparent !important;
        box-shadow: none !important;
    }

    .communique-table td::before {
        content: none;
    }

    .communique-table td[data-label="Comm. Nr."] {
        grid-area: number;
        text-align: right;
    }

    .communique-table td[data-label="Type"] {
        grid-area: type;
        color: #6c757d;
        font-size: 0.9rem;
    }

    .communique-table td[data-label="Document"] {
        grid-area: document;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .communique-table td[data-label="Publicatie"] {
        grid-area: publication;
        font-size: 0.85rem;
        color: #495057;
    }

    .communique-table td[data-label="Publicatie"]::before {
        content: "Publicatie: ";
        font-weight: 700;
    }

    .communique-table td[data-label="Actie"] {
        grid-area: actions;

        display: flex;
        gap: 0.4rem;

        margin-top: 0.5rem;
    }

    .communique-table td[data-label="Actie"] .btn {
        flex: 1;
        margin-right: 0;

        padding: 0.55rem 0.75rem;
        font-size: 0.95rem;
    }
}

.gap-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 64px;

    padding: 0.25rem 0.6rem;
    border-radius: 999px;

    background: #212529;
    color: #fff;

    font-size: 0.85rem;
    font-weight: 800;

    white-space: nowrap;
}

.rider-name {
    font-weight: 700;
    line-height: 1.2;
}

.team-name {
    font-size: 0.80rem;
    color: #6c757d;
    line-height: 1.1;
    margin-top: 2px;
}

.view-tabs-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.view-tabs {
    display: flex;
    overflow-x: auto;
    gap: .5rem;

    padding: 0 2.4rem .6rem 0;

    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}

.view-tabs a {
    flex: 0 0 auto;

    padding: .5rem 1rem;
    border-radius: 999px;

    text-decoration: none;
    white-space: nowrap;

    color: #0d6efd;
    background: #fff;
    border: 1px solid #0d6efd;

    scroll-snap-align: start;
}

.view-tabs a.active {
    background: #0d6efd;
    color: #fff;
}

/* right fade + arrow */
.view-tabs-wrapper::after {
    content: "›";
    position: absolute;

    top: 0;
    right: 0;

    width: 2.4rem;
    height: calc(100% - .6rem);

    display: flex;
    align-items: center;
    justify-content: flex-end;

    padding-right: .25rem;

    font-size: 2rem;
    font-weight: 700;

    color: #0d6efd;

    background: linear-gradient(
            to right,
            rgba(255,255,255,0),
            rgba(255,255,255,1) 65%
    );

    pointer-events: none;
}

@media (min-width: 768px) {
    .view-tabs-wrapper::after {
        display: none;
    }

    .view-tabs {
        padding-right: 0;
        scrollbar-width: none;
    }

    .view-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* Desktop */
.event-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.25rem;
}

.race-title {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

/* Tablet */
@media (max-width: 768px) {

    .event-title {
        font-size: 1.75rem;
    }

    .race-title {
        font-size: 1.35rem;
    }
}

/* Mobile */
@media (max-width: 575.98px) {

    .event-title {
        font-size: 1.3rem;
        line-height: 1.2;
        margin-bottom: 0.2rem;
    }

    .race-title {
        font-size: 1.05rem;
        line-height: 1.2;
        margin-bottom: 0.35rem;
        color: #6c757d;
    }

    #lastUpdateTime {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
}

/* Narrow fixed columns */
.result-table .col-rank,
.result-table td[data-label="Rank"] {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.result-table .col-bib,
.result-table td[data-label="Bib"] {
    width: 70px;
    min-width: 70px;
    text-align: center;
}

.result-table .col-nat,
.result-table td[data-label="Nat."] {
    width: 55px;
    min-width: 55px;
    text-align: center;
}

.result-table .col-gap,
.result-table td[data-label="Gap"] {
    width: 85px;
    min-width: 85px;
    text-align: center;
}

.result-table .col-split {
    width: 95px;
    min-width: 95px;
    text-align: center;
}

.result-table th,
.result-table td {
    padding: 0.55rem 0.75rem;
}

.result-table .col-split,
.result-table td.split-column {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.result-table th,
.result-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.result-table td[data-label="Rider"] {
    white-space: normal;
}


.split-toggle-btn {
    display: none;
}

@media (max-width: 575.98px) {
    .split-toggle-btn {
        display: inline-flex;
    }
}

@media (max-width: 575.98px) {

    .rider-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
    }

    .split-toggle-btn {
        flex: 0 0 auto;

        width: 34px;
        height: 34px;

        border: 0;
        border-radius: 999px;

        background: #0d6efd;
        color: #fff;

        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .result-table tr:not(.splits-open) .split-cell {
        display: none !important;
    }

    .result-table tr.splits-open .split-cell {
        display: flex !important;
        justify-content: space-between;
        gap: 1rem;

        grid-column: 1 / -1;

        padding-top: 0.25rem;
        font-size: 0.9rem;
        color: #495057;
    }

    .result-table tr.splits-open .split-cell::before {
        content: attr(data-label);
        font-weight: 700;
        color: #212529;
    }

    .result-table tr.splits-open .split-toggle-btn i {
        transform: rotate(180deg);
    }

    .result-table tr:not(.splits-open) .split-cell {
        display: none !important;
    }

    .result-table tr.splits-open .split-cell {
        display: flex !important;
        justify-content: space-between;
        grid-column: 1 / -1;
    }
}

.sensor-card {
    border-left: 5px solid #0d6efd;
}

.sensor-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.sensor-label {
    font-size: .8rem;
    color: #6c757d;
}

.chart-box {
    height: 260px;
}

@media (max-width: 576px) {
    .sensor-value {
        font-size: 1.1rem;
    }

    .chart-box {
        height: 220px;
    }
}

.chart-box {
    height: 420px;
}

@media (max-width: 576px) {
    .chart-box {
        height: 320px;
    }
}