/* =========================================================
   MARKER NORTH - STATISTICS PAGE
   ========================================================= */

:root {
    --statistics-bg: #020b14;
    --statistics-panel: #071522;
    --statistics-panel-light: #0b1b2a;
    --statistics-border: #20384d;
    --statistics-border-soft: rgba(120, 163, 198, 0.18);
    --statistics-text: #f7f9fc;
    --statistics-muted: #9db3c7;
    --statistics-gold: #ffb400;
    --statistics-green: #42d567;
    --statistics-blue: #36a2ff;
    --statistics-purple: #a35cff;
    --statistics-red: #ff5d68;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--statistics-bg);
    color: var(--statistics-text);
}

/* =========================================================
   MAIN PAGE
   ========================================================= */

.statistics-main {
    min-width: 0;
    padding: 22px 24px 28px;
    background: radial-gradient( circle at 73% 10%, rgba(26, 87, 139, 0.11), transparent 34% ), var(--statistics-bg);
}

/* =========================================================
   PAGE HEADER AND CONTROLS
   ========================================================= */

.statistics-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 14px;
    padding: 0 !important;
    min-height: auto !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

    .statistics-page-header h1 {
        margin: 0;
        color: var(--statistics-text);
        font-size: 30px;
        line-height: 1.15;
        letter-spacing: -0.5px;
    }

    .statistics-page-header p {
        margin: 5px 0 0;
        color: var(--statistics-muted);
        font-size: 14px;
        font-style: italic;
    }

.statistics-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.statistics-period-filter {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--statistics-border);
    border-radius: 6px;
    background: var(--statistics-panel);
}

    .statistics-period-filter button {
        min-width: 78px;
        min-height: 38px;
        padding: 0 13px;
        border: 0;
        border-right: 1px solid var(--statistics-border);
        background: transparent;
        color: var(--statistics-muted);
        font-family: inherit;
        font-size: 11px;
        cursor: pointer;
    }

        .statistics-period-filter button:last-child {
            border-right: 0;
        }

        .statistics-period-filter button:hover {
            color: white;
            background: rgba(255, 255, 255, 0.03);
        }

        .statistics-period-filter button.active {
            background: rgba(255, 180, 0, 0.12);
            color: var(--statistics-gold);
            box-shadow: inset 0 0 0 1px var(--statistics-gold);
        }

.statistics-game-filter {
    position: relative;
    min-width: 180px;
}

    .statistics-game-filter select {
        width: 100%;
        height: 40px;
        padding: 0 36px 0 14px;
        border: 1px solid var(--statistics-border);
        border-radius: 6px;
        outline: 0;
        appearance: none;
        background: var(--statistics-panel);
        color: var(--statistics-text);
        font-family: inherit;
        font-size: 11px;
        cursor: pointer;
    }

    .statistics-game-filter i {
        position: absolute;
        top: 50%;
        right: 13px;
        color: var(--statistics-muted);
        font-size: 10px;
        pointer-events: none;
        transform: translateY(-50%);
    }

.statistics-export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 19px;
    border: 1px solid var(--statistics-gold);
    border-radius: 6px;
    background: rgba(255, 180, 0, 0.05);
    color: var(--statistics-gold);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

    .statistics-export-button:hover {
        background: rgba(255, 180, 0, 0.13);
    }

/* =========================================================
   SUMMARY CARDS
   ========================================================= */

.statistics-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.statistics-summary-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    min-height: 105px;
    padding: 14px 15px;
    border: 1px solid var(--statistics-border);
    border-radius: 7px;
    background: linear-gradient( 145deg, rgba(10, 28, 43, 0.98), rgba(6, 20, 32, 0.98) );
    box-shadow: 0 9px 23px rgba(0, 0, 0, 0.13), inset 0 1px rgba(255, 255, 255, 0.015);
}

.statistics-summary-icon {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    flex: 0 0 49px;
    border-radius: 50%;
    font-size: 22px;
}

    .statistics-summary-icon.miles {
        background: rgba(54, 162, 255, 0.14);
        color: var(--statistics-blue);
    }

    .statistics-summary-icon.deliveries {
        background: rgba(163, 92, 255, 0.14);
        color: var(--statistics-purple);
    }

    .statistics-summary-icon.time {
        background: rgba(54, 162, 255, 0.12);
        color: #72bdff;
    }

    .statistics-summary-icon.revenue {
        background: rgba(255, 180, 0, 0.14);
        color: var(--statistics-gold);
    }

    .statistics-summary-icon.fuel {
        background: rgba(66, 213, 103, 0.14);
        color: var(--statistics-green);
    }

    .statistics-summary-icon.on-time {
        background: rgba(54, 162, 255, 0.14);
        color: var(--statistics-blue);
    }

.statistics-summary-card > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.statistics-summary-card span {
    overflow: hidden;
    color: var(--statistics-muted);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.statistics-summary-card strong {
    margin-top: 3px;
    color: white;
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
}

    .statistics-summary-card strong em {
        color: #c8d5df;
        font-size: 11px;
        font-style: normal;
    }

.positive-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 7px;
    color: var(--statistics-green) !important;
    font-size: 8px !important;
    font-style: normal;
    white-space: nowrap;
}

    .positive-change i {
        font-size: 7px;
    }

/* =========================================================
   SHARED PANELS
   ========================================================= */

.statistics-panel {
    min-width: 0;
    border: 1px solid var(--statistics-border);
    border-radius: 7px;
    background: linear-gradient( 145deg, rgba(10, 27, 42, 0.98), rgba(5, 18, 29, 0.98) );
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.015);
}

.statistics-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

    .statistics-panel-heading h2 {
        margin: 0;
        color: white;
        font-size: 15px;
        line-height: 1.2;
    }

/* =========================================================
   PRIMARY ANALYTICS GRID
   ========================================================= */

.statistics-analytics-grid {
    display: grid;
    grid-template-columns: minmax(460px, 1.55fr) minmax(300px, 0.95fr) minmax(350px, 1.15fr);
    gap: 10px;
    margin-bottom: 10px;
}

.miles-chart-panel,
.delivery-performance-panel,
.fuel-chart-panel {
    min-height: 275px;
    padding: 15px 16px;
}

/* =========================================================
   MILES CHART
   ========================================================= */

.chart-primary-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

    .chart-primary-value > strong {
        color: white;
        font-size: 24px;
    }

    .chart-primary-value > span {
        color: #c4d1dc;
        font-size: 11px;
    }

    .chart-primary-value .positive-change {
        margin: 0 0 0 5px;
        font-size: 10px !important;
    }

    .chart-primary-value > em {
        color: var(--statistics-muted);
        font-size: 8px;
        font-style: normal;
    }

.chart-period-select {
    position: relative;
    min-width: 92px;
}

    .chart-period-select select {
        width: 100%;
        height: 30px;
        padding: 0 28px 0 10px;
        border: 1px solid var(--statistics-border);
        border-radius: 4px;
        outline: 0;
        appearance: none;
        background: var(--statistics-panel-light);
        color: #c5d2dd;
        font-family: inherit;
        font-size: 9px;
    }

    .chart-period-select i {
        position: absolute;
        top: 50%;
        right: 9px;
        color: var(--statistics-muted);
        font-size: 8px;
        pointer-events: none;
        transform: translateY(-50%);
    }

.miles-chart {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    height: 190px;
    margin-top: 10px;
}

.chart-y-axis {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-direction: column;
    padding-bottom: 22px;
    color: var(--statistics-muted);
    font-size: 8px;
}

.chart-plot {
    position: relative;
    min-width: 0;
    padding-bottom: 22px;
}

.chart-grid-lines {
    position: absolute;
    inset: 0 0 22px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

    .chart-grid-lines span {
        width: 100%;
        border-top: 1px dashed rgba(130, 164, 191, 0.16);
    }

.chart-plot svg {
    position: absolute;
    inset: 0 0 22px;
    width: 100%;
    height: calc(100% - 22px);
    overflow: visible;
}

.miles-area {
    fill: url("#milesArea");
}

.miles-line {
    fill: none;
    stroke: var(--statistics-gold);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(255, 180, 0, 0.38));
}

.miles-chart-points circle {
    fill: white;
    stroke: var(--statistics-gold);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.chart-x-axis {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    color: var(--statistics-muted);
    font-size: 7px;
}

/* =========================================================
   DELIVERY PERFORMANCE
   ========================================================= */

.delivery-performance-content {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    align-items: center;
    gap: 15px;
    min-height: 185px;
    margin-top: 5px;
}

.delivery-score-ring {
    display: grid;
    place-items: center;
    width: 137px;
    height: 137px;
    border-radius: 50%;
    background: radial-gradient( circle, var(--statistics-panel) 57%, transparent 58% ), conic-gradient( var(--statistics-blue) 0deg 338deg, #173249 338deg 360deg );
    box-shadow: 0 0 17px rgba(54, 162, 255, 0.13), inset 0 0 12px rgba(0, 0, 0, 0.28);
}

    .delivery-score-ring > div {
        display: flex;
        align-items: center;
        flex-direction: column;
    }

    .delivery-score-ring strong {
        color: white;
        font-size: 38px;
        line-height: 1;
    }

    .delivery-score-ring span {
        margin-top: 6px;
        color: #d1dde6;
        font-size: 12px;
    }

.delivery-grade-breakdown {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.grade-breakdown-row {
    display: grid;
    grid-template-columns: 58px minmax(50px, 1fr) 24px 29px;
    align-items: center;
    gap: 7px;
}

    .grade-breakdown-row > span {
        font-size: 11px;
        font-weight: 800;
    }

    .grade-breakdown-row > div {
        height: 4px;
        overflow: hidden;
        border-radius: 5px;
        background: #172b3b;
    }

        .grade-breakdown-row > div span {
            display: block;
            height: 100%;
            border-radius: inherit;
        }

    .grade-breakdown-row strong {
        color: white;
        font-size: 10px;
        text-align: right;
    }

    .grade-breakdown-row small {
        color: var(--statistics-muted);
        font-size: 8px;
        text-align: right;
    }

.grade-a-plus > span {
    color: #65b6ff;
}

.grade-a-plus > div span {
    background: #36a2ff;
}

.grade-a > span {
    color: #51d7f0;
}

.grade-a > div span {
    background: #51d7f0;
}

.grade-b > span {
    color: var(--statistics-gold);
}

.grade-b > div span {
    background: var(--statistics-gold);
}

.grade-c > span {
    color: var(--statistics-red);
    font-size: 8px;
}

.grade-c > div span {
    background: var(--statistics-red);
}

.driver-percentile {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--statistics-border-soft);
    color: var(--statistics-gold);
}

    .driver-percentile i {
        font-size: 13px;
    }

    .driver-percentile span {
        color: #c6d4df;
        font-size: 9px;
    }

    .driver-percentile small {
        margin-left: auto;
        color: #71899d;
        font-size: 7px;
        font-style: italic;
    }

/* =========================================================
   FUEL EFFICIENCY
   ========================================================= */

.fuel-chart-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 9px;
}

    .fuel-chart-summary > div {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .fuel-chart-summary span {
        color: var(--statistics-muted);
        font-size: 8px;
    }

    .fuel-chart-summary strong {
        margin-top: 3px;
        color: #69b9ff;
        font-size: 15px;
    }

        .fuel-chart-summary strong small {
            font-size: 8px;
        }

    .fuel-chart-summary .positive-value {
        color: var(--statistics-green);
    }

    .fuel-chart-summary .marker-north-average {
        color: var(--statistics-gold);
    }

.fuel-chart {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 5px;
    height: 137px;
    margin-top: 10px;
}

.fuel-y-axis {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-direction: column;
    padding-bottom: 18px;
    color: var(--statistics-muted);
    font-size: 7px;
}

.fuel-chart-plot {
    position: relative;
    min-width: 0;
    padding-bottom: 18px;
}

.fuel-grid-lines {
    position: absolute;
    inset: 0 0 18px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

    .fuel-grid-lines span {
        border-top: 1px dashed rgba(130, 164, 191, 0.16);
    }

.fuel-chart-plot svg {
    position: absolute;
    inset: 0 0 18px;
    width: 100%;
    height: calc(100% - 18px);
    overflow: visible;
}

.fuel-efficiency-line {
    fill: none;
    stroke: var(--statistics-blue);
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(54, 162, 255, 0.4));
}

.fuel-chart-points circle {
    fill: #dff1ff;
    stroke: var(--statistics-blue);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.fuel-best-line,
.fuel-platform-line {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 2;
    height: 1px;
    pointer-events: none;
}

.fuel-best-line {
    top: 23%;
    background: repeating-linear-gradient( 90deg, var(--statistics-green) 0, var(--statistics-green) 6px, transparent 6px, transparent 11px );
}

.fuel-platform-line {
    top: 57%;
    background: repeating-linear-gradient( 90deg, rgba(255, 180, 0, 0.82) 0, rgba(255, 180, 0, 0.82) 3px, transparent 3px, transparent 8px );
}

.fuel-x-axis {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    color: var(--statistics-muted);
    font-size: 7px;
}

.fuel-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--statistics-border-soft);
    color: var(--statistics-muted);
    font-size: 7px;
}

    .fuel-chart-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .fuel-chart-legend i {
        display: inline-block;
        width: 18px;
        height: 2px;
    }

        .fuel-chart-legend i.average {
            background: var(--statistics-blue);
        }

        .fuel-chart-legend i.best {
            background: repeating-linear-gradient( 90deg, var(--statistics-green) 0, var(--statistics-green) 5px, transparent 5px, transparent 8px );
        }

        .fuel-chart-legend i.platform {
            background: repeating-linear-gradient( 90deg, var(--statistics-gold) 0, var(--statistics-gold) 3px, transparent 3px, transparent 6px );
        }

/* =========================================================
   LOWER GRID
   ========================================================= */

.statistics-lower-grid {
    display: grid;
    grid-template-columns: minmax(450px, 1.8fr) minmax(205px, 0.7fr) minmax(205px, 0.7fr) minmax(280px, 1fr);
    gap: 10px;
}

.where-you-drive-panel,
.personal-records-panel,
.driver-favorites-panel,
.activity-streak-panel {
    min-height: 275px;
    padding: 15px 16px;
}

/* =========================================================
   WHERE YOU DRIVE
   ========================================================= */

.heading-with-info {
    display: flex;
    align-items: center;
    gap: 7px;
}

    .heading-with-info button {
        padding: 0;
        border: 0;
        background: transparent;
        color: #7ea0bc;
        font-size: 11px;
        cursor: pointer;
    }

.where-you-drive-content {
    display: grid;
    grid-template-columns: minmax(250px, 1.35fr) minmax(185px, 0.8fr);
    gap: 18px;
    height: 225px;
    margin-top: 9px;
}

.statistics-map {
    min-width: 0;
    overflow: hidden;
    border-radius: 5px;
    background: radial-gradient( circle at 42% 52%, rgba(54, 162, 255, 0.1), transparent 46% ), #081725;
}

    .statistics-map svg {
        width: 100%;
        height: 100%;
    }

.state-shape {
    fill: rgba(42, 77, 103, 0.28);
    stroke: rgba(111, 148, 177, 0.52);
    stroke-width: 1.5;
}

    .state-shape.california {
        fill: rgba(255, 180, 0, 0.27);
    }

    .state-shape.nevada {
        fill: rgba(54, 162, 255, 0.2);
    }

    .state-shape.utah {
        fill: rgba(54, 162, 255, 0.4);
    }

    .state-shape.wyoming {
        fill: rgba(255, 180, 0, 0.36);
    }

    .state-shape.colorado {
        fill: rgba(255, 180, 0, 0.22);
    }

    .state-shape.arizona {
        fill: rgba(54, 162, 255, 0.14);
    }

    .state-shape.featured {
        stroke: rgba(255, 180, 0, 0.78);
        stroke-width: 2;
    }

.statistics-map text {
    fill: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    text-anchor: middle;
}

    .statistics-map text:nth-of-type(even) {
        fill: #c5d2dc;
        font-size: 8px;
        font-weight: 500;
    }

.most-driven-states {
    padding-left: 16px;
    border-left: 1px solid var(--statistics-border-soft);
}

    .most-driven-states h3 {
        margin: 0 0 17px;
        color: #c7d4df;
        font-size: 12px;
    }

    .most-driven-states ol {
        display: flex;
        flex-direction: column;
        gap: 18px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .most-driven-states li {
        display: grid;
        grid-template-columns: 27px minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

.state-rank {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 1px solid var(--statistics-blue);
    border-radius: 50%;
    color: #99d4ff;
    font-size: 9px;
    font-weight: 800;
}

.most-driven-states li:first-child .state-rank {
    border-color: var(--statistics-gold);
    color: var(--statistics-gold);
}

.most-driven-states li > div {
    min-width: 0;
}

.most-driven-states strong {
    color: white;
    font-size: 9px;
}

.state-progress {
    height: 3px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 5px;
    background: #172b3b;
}

    .state-progress span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--statistics-blue);
    }

.most-driven-states li:first-child .state-progress span {
    background: var(--statistics-gold);
}

.most-driven-states em {
    color: #acd8fa;
    font-size: 8px;
    font-style: normal;
}

.most-driven-states li:first-child em {
    color: var(--statistics-gold);
}

/* =========================================================
   PERSONAL RECORDS
   ========================================================= */

.personal-records-list {
    display: flex;
    flex-direction: column;
    margin-top: 11px;
}

.personal-record-item {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    border-bottom: 1px solid var(--statistics-border-soft);
}

    .personal-record-item:last-child {
        border-bottom: 0;
    }

    .personal-record-item > i {
        display: grid;
        place-items: center;
        width: 31px;
        height: 31px;
        border-radius: 50%;
        background: rgba(54, 162, 255, 0.12);
        color: var(--statistics-blue);
        font-size: 14px;
    }

    .personal-record-item:nth-child(2) > i {
        background: rgba(66, 213, 103, 0.12);
        color: var(--statistics-green);
    }

    .personal-record-item:nth-child(3) > i {
        background: rgba(255, 180, 0, 0.12);
        color: var(--statistics-gold);
    }

    .personal-record-item:nth-child(4) > i {
        background: rgba(163, 92, 255, 0.12);
        color: var(--statistics-purple);
    }

    .personal-record-item span {
        color: var(--statistics-muted);
        font-size: 8px;
    }

    .personal-record-item strong {
        color: white;
        font-size: 9px;
        white-space: nowrap;
    }

/* =========================================================
   DRIVER FAVORITES
   ========================================================= */

.driver-favorites-list {
    display: flex;
    flex-direction: column;
    margin-top: 11px;
}

.driver-favorite-item {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 50px;
    border-bottom: 1px solid var(--statistics-border-soft);
}

    .driver-favorite-item:last-child {
        border-bottom: 0;
    }

.favorite-icon {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 6px;
    font-size: 14px;
}

    .favorite-icon.truck {
        background: rgba(54, 162, 255, 0.14);
        color: var(--statistics-blue);
    }

    .favorite-icon.cargo {
        background: rgba(163, 92, 255, 0.14);
        color: var(--statistics-purple);
    }

    .favorite-icon.city {
        background: rgba(255, 180, 0, 0.14);
        color: var(--statistics-gold);
    }

    .favorite-icon.route {
        background: rgba(54, 162, 255, 0.14);
        color: #78c4ff;
    }

.driver-favorite-item > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.driver-favorite-item span {
    color: var(--statistics-muted);
    font-size: 8px;
}

.driver-favorite-item strong {
    overflow: hidden;
    margin-top: 3px;
    color: #78c4ff;
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.driver-favorite-item:nth-child(2) strong {
    color: #bd83ff;
}

.driver-favorite-item:nth-child(3) strong {
    color: var(--statistics-gold);
}

/* =========================================================
   ACTIVITY STREAK
   ========================================================= */

.activity-streak-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 11px;
}

    .activity-streak-heading > i {
        color: var(--statistics-gold);
        font-size: 25px;
        filter: drop-shadow(0 0 6px rgba(255, 180, 0, 0.3));
    }

    .activity-streak-heading > div {
        display: flex;
        flex-direction: column;
    }

    .activity-streak-heading strong {
        color: var(--statistics-gold);
        font-size: 13px;
    }

    .activity-streak-heading span {
        margin-top: 2px;
        color: var(--statistics-muted);
        font-size: 8px;
    }

.activity-calendar {
    margin-top: 11px;
}

.calendar-months {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding-left: 29px;
    color: var(--statistics-muted);
    font-size: 7px;
}

.calendar-body {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 5px;
    margin-top: 5px;
}

.calendar-days {
    display: grid;
    grid-template-rows: repeat(7, 11px);
    gap: 3px;
    color: var(--statistics-muted);
    font-size: 6px;
}

    .calendar-days span {
        display: flex;
        align-items: center;
    }

.calendar-heatmap {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(6, 11px);
    grid-auto-columns: 11px;
    justify-content: space-between;
    gap: 3px;
    min-width: 0;
}

    .calendar-heatmap span,
    .activity-calendar-legend i {
        display: block;
        border-radius: 2px;
        background: #132536;
    }

        .calendar-heatmap span.low,
        .activity-calendar-legend i.low {
            background: #245fa2;
        }

        .calendar-heatmap span.medium,
        .activity-calendar-legend i.medium {
            background: #398bf0;
        }

        .calendar-heatmap span.high,
        .activity-calendar-legend i.high {
            background: var(--statistics-gold);
        }

.activity-calendar-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 11px;
    color: var(--statistics-muted);
    font-size: 6px;
}

    .activity-calendar-legend span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .activity-calendar-legend i {
        width: 10px;
        height: 10px;
    }

/* =========================================================
   CAPS SIGNATURE
   ========================================================= */

.statistics-caps-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    padding: 18px 20px 2px;
    text-align: center;
}

.statistics-caps-icon {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid rgba(54, 162, 255, 0.55);
    border-radius: 50%;
    color: var(--statistics-blue);
    font-size: 14px;
}

.statistics-caps-signature > div:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 9px;
}

.statistics-caps-signature strong {
    color: white;
    font-size: 11px;
}

    .statistics-caps-signature strong span {
        color: var(--statistics-gold);
        letter-spacing: 0.7px;
    }

.statistics-caps-signature small {
    color: var(--statistics-muted);
    font-size: 9px;
    font-style: italic;
}

/* =========================================================
   SHARED PAGE FIXES
   ========================================================= */

.dashboard-page .dashboard-logo img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
}

.dashboard-page .header-avatar img,
.dashboard-page .sidebar-driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}

    .dashboard-sidebar .sidebar-driver-card {
        margin-top: 34px;
    }

    .dashboard-sidebar .sidebar-sign-out {
        margin-top: 14px;
    }

/* =========================================================
   LOWER STATISTICS POLISH
   ========================================================= */

/* Improve Personal Records readability */

.personal-record-item span {
    color: #b8c8d5;
    font-size: 10px;
}

.personal-record-item strong {
    color: white;
    font-size: 11px;
}

/* Improve Driver Favorites readability */

.driver-favorite-item span {
    color: #b8c8d5;
    font-size: 9px;
}

.driver-favorite-item strong {
    margin-top: 4px;
    font-size: 11px;
}

/* Add historical map texture behind the state shapes */

.statistics-map {
    position: relative;
    isolation: isolate;
    background: radial-gradient( circle at 70% 34%, rgba(255, 180, 0, 0.11), transparent 24% ), radial-gradient( circle at 35% 70%, rgba(54, 162, 255, 0.12), transparent 34% ), linear-gradient( 35deg, transparent 48%, rgba(72, 107, 134, 0.18) 49%, rgba(72, 107, 134, 0.18) 50%, transparent 51% ), linear-gradient( 145deg, transparent 48%, rgba(72, 107, 134, 0.13) 49%, rgba(72, 107, 134, 0.13) 50%, transparent 51% ), #081725;
    background-size: auto, auto, 82px 65px, 110px 78px, auto;
}

    .statistics-map::before {
        position: absolute;
        inset: 0;
        z-index: 0;
        content: "";
        pointer-events: none;
        opacity: 0.32;
        background: repeating-radial-gradient( ellipse at 38% 58%, transparent 0, transparent 18px, rgba(102, 137, 164, 0.18) 19px, transparent 20px );
    }

    .statistics-map svg {
        position: relative;
        z-index: 1;
    }

/* Give the activity calendar its own visual surface */

.activity-streak-panel {
    background: radial-gradient( circle at 80% 35%, rgba(255, 180, 0, 0.07), transparent 38% ), linear-gradient( 145deg, rgba(10, 27, 42, 0.98), rgba(5, 18, 29, 0.98) );
}

.activity-calendar {
    padding: 9px 9px 8px;
    border: 1px solid rgba(120, 163, 198, 0.12);
    border-radius: 5px;
    background: rgba(2, 12, 21, 0.34);
}

.calendar-heatmap span {
    box-shadow: inset 0 0 0 1px rgba(118, 151, 177, 0.08);
}

/* =========================================================
   ANALYTICS TEXT READABILITY
   ========================================================= */

/* Delivery Performance */

.grade-breakdown-row {
    grid-template-columns: 68px minmax(55px, 1fr) 28px 34px;
    gap: 8px;
}

    .grade-breakdown-row > span {
        font-size: 13px;
    }

    .grade-breakdown-row.grade-c > span {
        font-size: 9px;
    }

    .grade-breakdown-row strong {
        font-size: 12px;
    }

    .grade-breakdown-row small {
        font-size: 9px;
    }

.driver-percentile span {
    font-size: 10px;
}

.driver-percentile small {
    font-size: 8px;
}

/* Fuel Efficiency summary */

.fuel-chart-summary span {
    font-size: 10px;
}

.fuel-chart-summary strong {
    margin-top: 4px;
    font-size: 17px;
}

    .fuel-chart-summary strong small {
        font-size: 9px;
    }

/* Fuel chart axes */

.fuel-y-axis,
.fuel-x-axis {
    font-size: 8px;
}

/* Fuel chart legend */

.fuel-chart-legend {
    gap: 15px;
    font-size: 8px;
}

    .fuel-chart-legend i {
        width: 21px;
    }

/* Give the chart labels slightly more room */

.fuel-chart {
    margin-top: 12px;
}

.fuel-chart-legend {
    margin-top: 9px;
}

/* =========================================================
   COMPARISON AND ACTIVITY READABILITY
   ========================================================= */

/* Career summary comparisons */

.statistics-summary-card .positive-change {
    margin-top: 8px;
    font-size: 9px !important;
    font-weight: 600;
}

    .statistics-summary-card .positive-change i {
        font-size: 8px;
    }

/* Miles Driven chart comparison */

.chart-primary-value .positive-change {
    font-size: 10px !important;
}

.chart-primary-value > em {
    font-size: 9px;
}

/* Activity Streak heading */

.activity-streak-heading strong {
    font-size: 14px;
}

.activity-streak-heading span {
    font-size: 9px;
}

/* Calendar month and day labels */

.calendar-months {
    font-size: 8px;
    font-weight: 600;
}

.calendar-days {
    font-size: 7px;
}

/* Activity legend */

.activity-calendar-legend {
    gap: 12px;
    font-size: 8px;
}

    .activity-calendar-legend i {
        width: 11px;
        height: 11px;
    }

/* =========================================================
   RESPONSIVE LAYOUT
   ========================================================= */

@media (max-width: 1600px) {

    .statistics-main {
        padding-right: 17px;
        padding-left: 17px;
    }

    .statistics-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .statistics-analytics-grid {
        grid-template-columns: minmax(430px, 1.4fr) minmax(300px, 1fr);
    }

    .fuel-chart-panel {
        grid-column: 1 / -1;
    }

    .statistics-lower-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .where-you-drive-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1200px) {

    .statistics-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .statistics-controls {
        justify-content: flex-start;
        width: 100%;
    }

    .statistics-analytics-grid {
        grid-template-columns: 1fr;
    }

    .fuel-chart-panel {
        grid-column: auto;
    }
}

@media (max-width: 900px) {

    .statistics-main {
        padding: 18px 14px 26px;
    }

    .statistics-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statistics-lower-grid {
        grid-template-columns: 1fr;
    }

    .where-you-drive-panel {
        grid-column: auto;
    }

    .where-you-drive-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .statistics-map {
        min-height: 240px;
    }

    .most-driven-states {
        padding: 15px 0 0;
        border-top: 1px solid var(--statistics-border-soft);
        border-left: 0;
    }
}

@media (max-width: 700px) {

    .statistics-page-header h1 {
        font-size: 26px;
    }

    .statistics-period-filter {
        width: 100%;
    }

        .statistics-period-filter button {
            min-width: 0;
            flex: 1;
        }

    .statistics-game-filter,
    .statistics-export-button {
        width: 100%;
    }

    .statistics-summary-grid {
        grid-template-columns: 1fr;
    }

    .delivery-performance-content {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .delivery-grade-breakdown {
        width: 100%;
    }

    .fuel-chart-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    .statistics-main {
        padding-right: 10px;
        padding-left: 10px;
    }

    .statistics-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .statistics-period-filter {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

        .statistics-period-filter button {
            border-bottom: 1px solid var(--statistics-border);
        }

    .miles-chart-panel,
    .delivery-performance-panel,
    .fuel-chart-panel,
    .where-you-drive-panel,
    .personal-records-panel,
    .driver-favorites-panel,
    .activity-streak-panel {
        padding-right: 12px;
        padding-left: 12px;
    }

    .statistics-caps-signature {
        flex-direction: column;
    }
}

/* =========================================================
   LIVE STATISTICS DATA PATCH
   ========================================================= */

.statistics-map-summary {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 220px;
    padding: 20px;
    text-align: center;
}

    .statistics-map-summary i {
        display: grid;
        place-items: center;
        width: 54px;
        height: 54px;
        margin-bottom: 12px;
        border-radius: 50%;
        background: rgba(255, 180, 0, 0.12);
        color: var(--statistics-gold);
        font-size: 24px;
    }

    .statistics-map-summary strong {
        color: white;
        font-size: 16px;
    }

    .statistics-map-summary span {
        max-width: 320px;
        margin-top: 7px;
        color: var(--statistics-muted);
        font-size: 11px;
        line-height: 1.45;
    }

.statistics-game-filter select {
    color-scheme: dark;
}

    .statistics-game-filter select option {
        background: #06111d;
        color: white;
    }

        .statistics-game-filter select option:checked {
            background: #12324b;
            color: var(--statistics-gold);
        }
