﻿:root {
    /* Existing Theme */
    --brand-blue: #1e73be;
    --background: #10141a;
    --surface: #19212b;
    --primary-text: #ffffff;
    --secondary-text: #aeb8c4;
    /* Shared Platform Theme */
    --page-bg: #030912;
    --panel-bg: rgba(7, 17, 28, 0.96);
    --panel-border: #22364a;
    --text: #ffffff;
    --muted: #aebdca;
    --accent: #ffbd19;
    --green: #55cc63;
    --blue: #3b8df0;
    --purple: #a65df7;
    --red: #ff575f;
    --content-width: 1780px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

header {
    padding: 20px 32px;
    background: var(--surface);
    border-bottom: 3px solid var(--brand-blue);
}

    header h1 {
        margin: 0;
        font-size: 24px;
    }

main {
    width: 100%;
    margin: 0;
}

    main h2 {
        margin-bottom: 12px;
        color: var(--brand-blue);
    }

    main p {
        color: var(--secondary-text);
    }
.profile-header {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 30px;
}

    .profile-header h2 {
        margin: 0;
        color: var(--brand-blue);
        font-size: 18px;
        text-transform: uppercase;
        letter-spacing: 2px;
    }

    .profile-header h3 {
        margin: 12px 0 8px 0;
        font-size: 36px;
    }

    .profile-header p {
        margin: 0;
        color: var(--secondary-text);
        font-size: 18px;
    }
.viewer-layout {
    position: relative;
    width: 100%;
    height: calc(100vh - 93px);
    margin: 0;
    overflow: hidden;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    background: #0d1218;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
}

.driver-panel {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 360px;
    min-height: 620px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    z-index: 2;
    transform: translateX(120%);
    transition: transform 0.35s ease;
}

.driver-panel[hidden] {
    display: none;
}

    .driver-panel.open {
        transform: translateX(0);
    }

    .driver-panel.open.collapsed {
        transform: translateX(120%);
    }


.driver-panel-close {
    position: absolute;
    top: 5px;
    right: 6px;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 5;
}

.driver-panel-collapse {
    position: absolute;
    top: 7px;
    right: 38px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #cce7ff;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.driver-panel-collapse:hover,
.driver-panel-collapse:focus-visible {
    background: rgba(39, 149, 225, .16);
    color: #ffffff;
    outline: none;
    transform: translateX(2px);
}

.driver-panel-follow-tab {
    position: absolute;
    top: 24px;
    right: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 12px;
    min-width: 164px;
    max-width: min(220px, calc(100vw - 48px));
    border: 1px solid rgba(50, 153, 226, .72);
    border-radius: 10px;
    background: rgba(8, 27, 45, .96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .34);
    color: #f4f9ff;
    cursor: pointer;
    padding: 9px 10px 9px 13px;
    text-align: left;
    z-index: 3;
}

.driver-panel-follow-tab[hidden] {
    display: none;
}

.driver-panel-follow-label {
    color: #77c7ff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.driver-panel-follow-tab strong {
    grid-column: 1;
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-panel-follow-icon {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    color: #ffbd19;
    font-size: 24px;
    line-height: 1;
}

.driver-panel-follow-tab:hover,
.driver-panel-follow-tab:focus-visible {
    border-color: #ffbd19;
    background: #0c2438;
    outline: none;
}

.driver-hover-card {
    min-width: 220px;
    padding: 8px 10px;
}

.driver-hover-name {
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.driver-hover-truck {
    font-size: 13px;
    color: #cfd8e3;
}

.driver-hover-route {
    margin-top: 4px;
    font-size: 12px;
    color: #8fbfff;
}

    .driver-panel-close:hover {
        color: var(--brand-blue);
        transform: scale(1.15);
    }

.driver-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-label {
    margin: 0 0 6px 0;
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.driver-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.driver-panel-header h2 {
    margin: 0;
    font-size: 30px;
}

.driver-twitch-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    border: 1px solid rgba(169, 112, 255, 0.76);
    border-radius: 999px;
    color: #f3eaff;
    background: linear-gradient(135deg, rgba(145, 70, 255, 0.94), rgba(93, 38, 177, 0.94));
    box-shadow: 0 0 0 0 rgba(176, 104, 255, 0.48);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 6px 10px 6px 8px;
    text-decoration: none;
    animation: driver-twitch-glow 2.2s ease-out infinite;
}

.driver-twitch-badge:hover,
.driver-twitch-badge:focus-visible {
    color: #ffffff;
    filter: brightness(1.12);
    outline: none;
}

.driver-twitch-badge:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 195, 47, 0.5);
}

.driver-twitch-badge[hidden] {
    display: none !important;
}

.driver-twitch-icon {
    width: 15px;
    height: 15px;
    fill: #ffffff;
}

.driver-twitch-glyph {
    fill: #6c32c8;
}

@keyframes driver-twitch-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(176, 104, 255, 0.38); }
    55% { box-shadow: 0 0 0 6px rgba(176, 104, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .driver-twitch-badge { animation: none; }
}

@media (max-width: 760px) {
    .driver-panel {
        top: 10px;
        right: 10px;
        width: min(360px, calc(100vw - 20px));
    }

    .driver-panel-follow-tab {
        top: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}

.driver-status {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(30, 115, 190, 0.18);
    color: #73b9f2;
    font-size: 13px;
    font-weight: 700;
}
.truck-name,
.cargo-name {
    margin: 0 0 18px 0;
    color: var(--secondary-text);
    font-size: 18px;
}

.route {
    display: grid;
    gap: 10px;
    padding: 18px 0;
    margin-bottom: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

    .route span {
        display: block;
    }

.route-stop {
    display: grid;
    gap: 4px;
}

    .route-stop strong {
        color: #ffffff;
        font-size: 18px;
        font-weight: 700;
    }

.route-arrow {
    color: var(--brand-blue);
    font-weight: 700;
    text-align: center;
    font-size: 24px;
    margin: 4px 0;
}
}

.live-details {
    display: grid;
    gap: 12px;
}

    .live-details div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .live-details span {
        color: var(--secondary-text);
    }

    .live-details strong {
        text-align: right;
    }

.section-title {
    color: #7fa8cc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 8px;
}
.driver-profile-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    margin-top: 24px;
    border: 1px solid #ffd36a;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    color: #14110a;
    background: linear-gradient(135deg, #ffcb35, #eea900);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.01em;
    padding: 0 15px;
    text-decoration: none;
    transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.driver-profile-action:hover,
.driver-profile-action:focus-visible {
    color: #14110a;
    filter: brightness(1.08);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(0, 0, 0, 0.32);
}

.driver-profile-action[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.58;
    pointer-events: none;
}

.driver-status.driving {
    background: #0f5132;
    color: #7ee787;
}

.driver-status.stopped {
    background: #5c4500;
    color: #ffd166;
}

.driver-status.engine-off {
    background: #3a3a3a;
    color: #d1d5db;
}

.driver-convoy-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin: -6px 0 20px;
    border: 1px solid rgba(248, 113, 113, 0.72);
    border-radius: 10px;
    background: rgba(127, 29, 29, 0.3);
}

.driver-convoy-status[hidden] {
    display: none;
}

.driver-convoy-status.possible {
    border-color: rgba(251, 146, 60, 0.78);
    background: rgba(120, 53, 15, 0.24);
}

.driver-convoy-status.regrouping {
    border-color: rgba(96, 165, 250, 0.78);
    background: rgba(30, 64, 175, 0.24);
}

.driver-convoy-status .section-label {
    margin-bottom: 3px;
    color: #fca5a5;
}

.driver-convoy-status.possible .section-label {
    color: #fdba74;
}

.driver-convoy-status.regrouping .section-label {
    color: #93c5fd;
}

.driver-convoy-status strong,
.driver-convoy-status span {
    display: block;
}

.driver-convoy-status strong {
    color: #fee2e2;
    font-size: 16px;
}

.driver-convoy-status #convoy-status-detail {
    margin-top: 4px;
    color: #fecaca;
    font-size: 12px;
}

.driver-convoy-status.possible #convoy-status-detail {
    color: #fed7aa;
}

.driver-convoy-status.regrouping #convoy-status-detail {
    color: #bfdbfe;
}

.convoy-marker-icon {
    color: #f87171;
    font-size: 26px;
}
.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d131d;
    border: 1px solid #243346;
    border-radius: 18px;
    min-height: 700px;
}

.map-placeholder-content {
    text-align: center;
    max-width: 500px;
}

.placeholder-truck {
    font-size: 72px;
    margin-bottom: 24px;
}

.map-placeholder-content h2 {
    color: #ffffff;
    font-size: 32px;
    margin-bottom: 12px;
}

.map-placeholder-content p {
    color: #8fa4b8;
    font-size: 18px;
    line-height: 1.6;
}

#map {
    position: absolute;
    inset: 0;
    background: #0b1420;
}

.city-label {
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 1px 1px 0 #000000;
    transform: translate(-50%, calc(-50% - 10px));
    pointer-events: none;
}

.city-label-major {
    font-size: 22px;
}

.city-label-regional {
    font-size: 16px;
}

.city-label-local {
    font-size: 12px;
}
/* ===============================
   ATS Highway Shields
   =============================== */

.highway-shield-svg {
    display: block;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: drop-shadow(0 0 2px #000000);
}

#live-map {
    position: relative;
}

#map-layer-control {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(24, 34, 45, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 14px;
}

    #map-layer-control label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

footer {
    min-height: 0;
    height: auto;
    padding: 12px 24px;
}

    footer p {
        margin: 0;
    }

main.viewer-layout {
    width: 100%;
    height: calc(100vh - 67px);
    min-height: 0;
    margin: 0;
}

#live-map {
    position: relative;
    height: 100%;
    min-height: 0;
}

.layer-section-title {
    margin-top: 12px;
    margin-bottom: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
    color: #7fa8cc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.layer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-section-header {
    padding-top: 8px;
    margin-bottom: 4px;
    border-top: 1px solid rgba(255,255,255,0.15);
    color: #7fa8cc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.layer-section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#map-style-control {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 40px);
    padding: 8px;
    border: 1px solid rgba(113, 145, 174, 0.45);
    background: rgba(13, 28, 45, 0.96);
    color: white;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    font-size: 13px;
    font-weight: 800;
    z-index: 10;
}

#map-style-control .map-style-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
}

#map-style-control .map-style-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#map-style-control .map-style-option span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #c9d8e7;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

#map-style-control .map-style-option input:checked + span {
    border-color: rgba(51, 168, 255, 0.78);
    background: rgba(30, 136, 229, 0.22);
    color: #ffffff;
}

#map-style-control .map-style-option:hover span {
    background: rgba(255, 189, 25, 0.13);
    color: #ffffff;
}

#map-style-control .map-style-option input:focus-visible + span {
    outline: 2px solid #ffbd19;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    #map-style-control {
        right: 12px;
        bottom: 12px;
        left: 12px;
        justify-content: space-between;
        gap: 2px;
        max-width: none;
        padding: 5px;
        font-size: 11px;
    }

    #map-style-control .map-style-option span {
        min-height: 30px;
        padding: 0 6px;
    }
}

/* Platform TBD City Popup */

.city-popup {
    background: #17212b;
    color: #ffffff;
    padding: 12px;
    min-width: 180px;
    font-family: Arial, sans-serif;
}

.city-popup-title {
    color: #1e88e5;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

.city-popup-subtitle {
    color: #9fb3c8;
    font-size: 12px;
    margin-top: 4px;
}

.city-popup hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 10px 0;
}

.city-popup div {
    margin-top: 6px;
}

.nearby-drivers-popup {
    min-width: 260px;
    max-width: 340px;
}

.nearby-drivers-heading {
    color: #ffbd19;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nearby-driver-list {
    display: grid;
    gap: 7px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.nearby-driver-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    align-items: baseline;
    padding: 8px 9px;
    border: 1px solid #334155;
    border-radius: 7px;
    background: #0f1d2a;
}

.nearby-driver-name {
    min-width: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nearby-driver-distance {
    color: #7dc5ff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.nearby-driver-route {
    grid-column: 1 / -1;
    overflow: hidden;
    color: #9fb3c8;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-activity-heading {
    margin-top: 16px !important;
}

.company-activity-driver {
    grid-template-columns: minmax(0, 1fr);
}

.company-activity-cargo {
    overflow: hidden;
    color: #7dc5ff;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nearby-drivers-empty,
.nearby-drivers-more {
    margin: 10px 0 0;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.45;
}

.nearby-drivers-more {
    color: #7dc5ff;
}

.maplibregl-popup-content {
    background: #17212b;
    color: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,.4);
}

.maplibregl-popup-tip {
    border-top-color: #17212b;
}

.map-recenter-driver-control {
    margin-top: 8px;
}

    .map-recenter-driver-control .map-recenter-driver-button {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(119, 173, 216, 0.36);
        border-radius: 9px;
        background: rgba(13, 28, 42, 0.96);
        color: #ecf7ff;
        cursor: pointer;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    }

        .map-recenter-driver-control .map-recenter-driver-button:hover:not(:disabled) {
            border-color: rgba(57, 172, 255, 0.9);
            background: rgba(20, 54, 79, 0.98);
            color: #ffffff;
        }

        .map-recenter-driver-control .map-recenter-driver-button:focus-visible {
            outline: 2px solid #ffbd19;
            outline-offset: 2px;
        }

        .map-recenter-driver-control .map-recenter-driver-button:disabled {
            cursor: not-allowed;
            opacity: 0.45;
        }

        .map-recenter-driver-control .map-recenter-driver-button svg {
            width: 20px;
            height: 20px;
            fill: none;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.9;
        }

/* MapLibre popup close button */
.maplibregl-popup-close-button {
    color: white;
    background: transparent;
    font-size: 22px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    line-height: 22px;
    border: none;
    cursor: pointer;
    opacity: 1;
}

    .maplibregl-popup-close-button:hover {
        color: #2196f3;
    }

/* =========================================================
   HOMEPAGE MAP PREVIEW MODE
   Applies only to /maps/preview.html
   ========================================================= */

body.map-preview-mode {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

    body.map-preview-mode > header,
    body.map-preview-mode #map-style-control,
    body.map-preview-mode #map-layer-control,
    body.map-preview-mode .map-placeholder-content,
    body.map-preview-mode .driver-panel {
        display: none !important;
    }

    body.map-preview-mode .viewer-layout,
    body.map-preview-mode #live-map,
    body.map-preview-mode #map {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.map-preview-mode .viewer-layout,
    body.map-preview-mode #live-map {
        display: block !important;
    }

    body.map-preview-mode #live-map {
        position: fixed;
        inset: 0;
    }

    body.map-preview-mode #map {
        position: absolute;
        inset: 0;
    }

/* ==========================================================
   DRIVER PORTAL LAYOUT
   ========================================================== */

.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-header {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
}

.dashboard-logo {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 48px;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

    .dashboard-nav a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        border-radius: 16px;
        color: #ffffff;
        text-decoration: none;
        font-weight: 500;
        transition: all .20s ease;
    }
        .dashboard-nav a.active {
            background: rgba(247,183,51,.12);
        }

        .dashboard-nav a i {
            color: rgba(255,255,255,.70);
            margin-right: 8px;
            width: 18px;
            text-align: center;
            transition: color .20s ease;
        }

        .dashboard-nav a.active i {
            color: #f7b733;
        }r;
      

        .dashboard-nav a:hover {
            background: rgba(255,255,255,.06);
            color: white;
        }

    .dashboard-nav a:hover i {
        color: #f7b733;
    }

.dashboard-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 36px;
    min-width: 300px;
    font-weight: 600;
}

.dashboard-layout {
    flex: 1;
    display: flex;
}

.dashboard-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 84px);
    padding: 18px 16px 20px;
    background: rgba(3, 12, 22, 0.98);
    border-right: 1px solid var(--panel-border);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: 16px;
        min-height: 48px;
        padding: 0 14px;
        border: 1px solid transparent;
        border-radius: 11px;
        color: var(--text);
        font-size: 16px;
        font-weight: 500;
        text-decoration: none;
        transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    }

        .sidebar-nav a i {
            width: 24px;
            color: #b7c0cc;
            font-size: 19px;
            text-align: center;
            transition: color .2s ease;
        }

        .sidebar-nav a:hover {
            background: rgba(255,255,255,.05);
            border-color: rgba(255,255,255,.06);
        }

            .sidebar-nav a:hover i {
                color: var(--accent);
            }

        .sidebar-nav a.active {
            background: linear-gradient( 90deg, rgba(255,189,25,.26), rgba(255,189,25,.05) );
            border-color: rgba(255,189,25,.12);
        }

            .sidebar-nav a.active i {
                color: var(--accent);
            }

.sidebar-divider {
    height: 1px;
    margin: 14px 2px;
    background: rgba(255,255,255,.10);
}

.sidebar-badge {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 7px;
    border: 1px solid var(--purple);
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-driver-card {
    margin-top: auto;
    padding: 18px;
    background: rgba(8, 23, 37, .86);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
}

.sidebar-driver-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-driver-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

    .sidebar-driver-avatar img {
        width: 60px;
        height: 60px;
        display: block;
        object-fit: cover;
        border: 2px solid var(--accent);
        border-radius: 50%;
    }

.sidebar-driver-online {
    position: absolute;
    right: 1px;
    bottom: 3px;
    width: 12px;
    height: 12px;
    background: var(--green);
    border: 2px solid #07111c;
    border-radius: 50%;
}

.sidebar-driver-identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

    .sidebar-driver-identity strong {
        color: var(--text);
        font-size: 16px;
    }

.sidebar-premium-badge {
    padding: 4px 7px;
    border: 1px solid rgba(255,189,25,.65);
    border-radius: 7px;
    color: var(--accent);
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-driver-divider {
    height: 1px;
    margin: 18px 0;
    background: rgba(255,255,255,.10);
}

.sidebar-driver-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 16px;
}

    .sidebar-driver-detail span {
        color: var(--muted);
        font-size: 13px;
    }

.sidebar-driver-detail strong {
    color: #cdd6df;
    font-size: 14px;
    font-weight: 500;
}

#speed-value.speed-caution {
    color: #ffd166;
}

#speed-value.speed-danger {
    color: #ff6b6b;
}

.sidebar-sign-out {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease;
}

    .sidebar-sign-out:hover {
        background: rgba(255,255,255,.05);
        border-color: rgba(255,189,25,.40);
    }

    .sidebar-sign-out i {
        color: #c4ccd5;
    }

.dashboard-main {
    flex: 1;
    padding: 24px;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .dashboard-logo img {
        width: 300px;
        height: auto;
        max-width: none;
        max-height: none;
        display: block;
        object-fit: contain;
    }

.dashboard-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.dashboard-logo-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

    .dashboard-logo-title span {
        color: var(--accent);
    }

.dashboard-logo-subtitle {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1px;
}

.dashboard-logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffbd19, #d89500);
    border: 2px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.dashboard-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    background-image: linear-gradient( 90deg, rgba(4,8,14,.98) 0%, rgba(4,8,14,.95) 18%, rgba(4,8,14,.75) 38%, rgba(4,8,14,.35) 58%, rgba(4,8,14,.08) 75%, rgba(4,8,14,0) 100% ), linear-gradient( 180deg, rgba(6,10,18,.18) 0%, rgba(6,10,18,.10) 60%, rgba(6,10,18,.70) 100% ), url("../images/dashboard-hero.png");
    background-size: 101%;
    background-position: 5% 70%;
    background-repeat: no-repeat;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 46px;
}

.hero-greeting h1 {
    margin: 0;
    font-size: 38px;
    font-weight: 700;
    color: var(--text);
}

.hero-greeting p {
    margin-top: 12px;
    font-size: 18px;
    color: var(--muted);
    font-style: italic;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: auto;
    padding: 18px 0 0 0;
    border-top: 1px solid rgba(255,255,255,.08);
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
}

    .hero-status span {
        white-space: nowrap;
        opacity: .95;
    }



.hero-content {
    flex: 1;
}

.hero-right {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
    z-index: 5;
}

.hero-account {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hero-notifications {
    position: relative;
    font-size: 24px;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff7a00;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-profile {
    text-align: right;
}

.hero-profile-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.hero-profile-rank {
    margin-top: 4px;
    font-size: 13px;
    color: #ffb020;
}

.hero-avatar {
    position: relative;
    width: 58px;
    height: 58px;
}

    .hero-avatar img {
        width: 58px;
        height: 58px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,.15);
        object-fit: cover;
    }

.hero-online {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #23d160;
    border: 2px solid #09111d;
}

.hero-weather {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(10,18,30,.92);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 16px 20px;
    text-align: center;
    color: white;
    backdrop-filter: blur(10px);
}

.hero-weather-temp {
    font-size: 30px;
    font-weight: 700;
}

.hero-weather-text {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.hero-weather-location {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
}

.dashboard-section {
    margin-top: 36px;
}

.dashboard-section-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.dashboard-card {
    min-height: 180px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 24px;
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    transition: .25s ease;
}

    .dashboard-card:hover {
        transform: translateY(-4px);
        border-color: var(--brand-blue);
    }

.card-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 18px;
}

.card-value {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 16px;
}

    .card-value span {
        font-size: 24px;
        color: var(--muted);
        font-weight: 500;
    }

.card-change {
    color: #55cc63;
    font-size: 16px;
    font-weight: 600;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.card-menu {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

    .card-menu:hover {
        color: var(--text);
    }

.card-chart {
    height: 70px;
    margin-top: 18px;
    border-radius: 10px;
    background: linear-gradient( to bottom, rgba(140,90,255,.12), rgba(140,90,255,.02) );
    position: relative;
    overflow: hidden;
}

    .card-chart::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 14px;
        border-top: 1px dashed rgba(255,255,255,.08);
    }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--muted);
}

    .card-footer strong {
        color: var(--accent);
        font-size: 18px;
        font-weight: 700;
    }

.goal-progress {
    height: 8px;
    margin-top: 18px;
    margin-bottom: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
}

.goal-progress-fill {
    width: 85%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient( 90deg, #ffbd19, #ff9d00 );
}

.delivery-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.delivery-stat {
    display: flex;
    flex-direction: column;
}

    .delivery-stat span {
        font-size: 12px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .08em;
    }

    .delivery-stat strong {
        margin-top: 6px;
        font-size: 22px;
        font-weight: 700;
        color: var(--text);
    }

.delivery-destination {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 10px;
}

.delivery-status {
    margin-top: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 16px;
}

.mini-chart {
    margin-top: 22px;
    height: 82px;
    border-radius: 10px;
    background: linear-gradient( to top, rgba(59,130,246,.18), rgba(59,130,246,.06) );
    border: 1px solid rgba(255,255,255,.05);
}

.chart-label {
    margin-top: 12px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 2px;
    color: #7d8ca5;
}

.chart-bars {
    height: 82px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
}

    .chart-bars span {
        flex: 1;
        border-radius: 4px 4px 0 0;
        background: linear-gradient( to top, #3b82f6, #60a5fa );
        opacity: .9;
    }

/* ===========================
   Truck Health Widget
=========================== */

.health-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 28px;
}

.health-item {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.health-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
}

.health-item strong {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.health-good {
    color: #38d26e !important;
}

/* ===========================
   Earnings Widget
=========================== */

.earnings-main {
    margin-top: 24px;
}

.earnings-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.earnings-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.earnings-change {
    display: block;
    margin-top: 14px;
    color: #38d26e;
    font-size: 18px;
    font-weight: 600;
}

.earnings-divider {
    margin: 28px 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

.earnings-stats {
    display: flex;
    justify-content: space-between;
}

    .earnings-stats span {
        display: block;
        font-size: 12px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .08em;
        margin-bottom: 8px;
    }

    .earnings-stats strong {
        font-size: 24px;
        color: var(--text);
    }


/* Notification */

.header-notifications {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    color: white;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff8a00;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile */

.header-profile {
    text-align: right;
}

.header-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.header-profile-arrow {
    display: none;
}

.header-profile-rank {
    margin-top: 2px;
    font-size: 12px;
    color: #f7b733;
}

/* Real account data replaces static page scaffolding after the signed-in API
   request finishes. This prevents sample dashboard content from flashing. */
.driver-page-main {
    position: relative;
}

.driver-page-loading {
    display: none;
}

.driver-page-main[data-content-state="loading"] > :not(.driver-page-loading),
.driver-page-main[data-content-state="error"] > :not(.driver-page-loading) {
    visibility: hidden;
}

.driver-page-main[data-content-state="loading"] .driver-page-loading,
.driver-page-main[data-content-state="error"] .driver-page-loading {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    min-height: 360px;
    align-content: center;
    justify-items: center;
    gap: 9px;
    color: #9ecdee;
    text-align: center;
}

.driver-page-main[data-content-state="loading"] .driver-page-loading i,
.driver-page-main[data-content-state="error"] .driver-page-loading i {
    color: #f7b733;
    font-size: 28px;
}

.driver-page-main[data-content-state="error"] .driver-page-loading i {
    color: #ff7c7c;
}

.driver-page-loading strong {
    color: #ffffff;
    font-size: 15px;
}

.driver-page-loading span {
    max-width: 300px;
    color: #93adbf;
    font-size: 12px;
    line-height: 1.5;
}

/* Avatar */

.header-avatar {
    position: relative;
    width: 56px;
    height: 56px;
}

    .header-avatar img {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255,255,255,.15);
    }

.header-online {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22d36b;
    border: 2px solid #0b1320;
}

/* ==========================================================
   RECENT ACTIVITY WIDGET
   ========================================================== */

.dashboard-lower-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.recent-activity-card {
    width: 100%;
}

.recent-activity-card {
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.recent-activity-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .recent-activity-header h2 {
        margin: 0;
        color: var(--accent);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .recent-activity-header a {
        padding: 7px 13px;
        background: rgba(255,255,255,.04);
        border: 1px solid var(--panel-border);
        border-radius: 8px;
        color: var(--text);
        font-size: 13px;
        text-decoration: none;
        transition: background-color .2s ease, border-color .2s ease;
    }

        .recent-activity-header a:hover {
            background: rgba(255,255,255,.08);
            border-color: rgba(255,189,25,.45);
        }

.recent-activity-list {
    padding: 0 18px;
}

.activity-item {
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    font-size: 16px;
}

    .activity-icon.delivery {
        background: rgba(166,93,247,.22);
        border-color: rgba(166,93,247,.45);
        color: #d7b3ff;
    }

    .activity-icon.milestone {
        background: rgba(255,189,25,.20);
        border-color: rgba(255,189,25,.45);
        color: var(--accent);
    }

    .activity-icon.fuel {
        background: rgba(85,204,99,.18);
        border-color: rgba(85,204,99,.40);
        color: #85e990;
    }

    .activity-icon.border-crossing {
        background: rgba(59,141,240,.20);
        border-color: rgba(59,141,240,.42);
        color: #8dc1ff;
    }

.activity-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .activity-content strong {
        color: var(--text);
        font-size: 15px;
        font-weight: 600;
    }

    .activity-content span {
        overflow: hidden;
        color: var(--muted);
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.activity-item time {
    align-self: start;
    padding-top: 18px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ==========================================================
   DASHBOARD LIVE MAP WIDGET
   ========================================================== */

.dashboard-map-card {
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.dashboard-map-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .dashboard-map-header h2 {
        margin: 0;
        color: var(--accent);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .dashboard-map-header a {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,.04);
        border: 1px solid var(--panel-border);
        border-radius: 8px;
        color: var(--muted);
        text-decoration: none;
        transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    }

        .dashboard-map-header a:hover {
            background: rgba(255,255,255,.08);
            border-color: rgba(255,189,25,.45);
            color: var(--accent);
        }

.dashboard-map-preview {
    position: relative;
    height: 288px;
    overflow: hidden;
    background: #050d16;
}

    .dashboard-map-preview iframe {
        width: 100%;
        height: 100%;
        display: block;
        border: 0;
        pointer-events: none;
    }

.dashboard-map-open {
    position: absolute;
    left: 16px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(3,9,18,.92);
    border: 1px solid rgba(255,189,25,.45);
    border-radius: 7px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background-color .2s ease, border-color .2s ease;
}

    .dashboard-map-open:hover {
        background: rgba(255,189,25,.12);
        border-color: var(--accent);
    }

/* ==========================================================
   DASHBOARD CONTENT AND RIGHT COLUMN
   ========================================================== */

.dashboard-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 24px;
}

.dashboard-content-primary {
    min-width: 0;
}

.dashboard-content-sidebar {
    min-width: 0;
    margin-top: 36px;
}

/* ==========================================================
   CLIENT STATUS WIDGET
   ========================================================== */

.client-status-card {
    overflow: hidden;
    padding: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.client-status-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .client-status-header h2 {
        margin: 0;
        color: var(--text);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

.client-connection-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #dfe7ee;
    font-size: 14px;
}

.client-status-dot {
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(85,204,99,.55);
}

.client-device-image {
    height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 4px;
}

    .client-device-image img {
        width: 100%;
        max-width: 260px;
        max-height: 166px;
        display: block;
        object-fit: contain;
    }

.client-version {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

    .client-version > div {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .client-version strong {
        color: var(--text);
        font-size: 15px;
        font-weight: 600;
    }

    .client-version > div span {
        color: var(--muted);
        font-size: 12px;
    }

.client-up-to-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #35df73;
    font-size: 12px;
    white-space: nowrap;
}

.client-download-button {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 16px;
    background: linear-gradient(135deg, #ffbd19, #e89b00);
    border: 1px solid #ffbd19;
    border-radius: 7px;
    color: #101010;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(255,189,25,.14);
    transition: transform .2s ease, filter .2s ease;
}

    .client-download-button:hover {
        transform: translateY(-1px);
        filter: brightness(1.06);
    }

.client-changelog-link {
    display: block;
    margin-top: 13px;
    color: var(--accent);
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

    .client-changelog-link:hover {
        text-decoration: underline;
    }

/* ==========================================================
   NEXT ACHIEVEMENT WIDGET
   ========================================================== */

.next-achievement-card {
    margin-top: 14px;
    padding: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.next-achievement-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .next-achievement-header i {
        color: var(--accent);
        font-size: 17px;
    }

    .next-achievement-header h2 {
        margin: 0;
        color: var(--accent);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

.next-achievement-content {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 18px 0;
}

.achievement-badge {
    position: relative;
    width: 94px;
    height: 106px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient( 145deg, #f7d68b, #b67a22 45%, #654116 );
    clip-path: polygon( 50% 0%, 91% 23%, 91% 70%, 50% 100%, 9% 70%, 9% 23% );
    filter: drop-shadow(0 7px 12px rgba(0,0,0,.32));
}

    .achievement-badge::before {
        position: absolute;
        inset: 5px;
        background: linear-gradient( 160deg, #18202a, #080d13 70% );
        clip-path: inherit;
        content: "";
    }

    .achievement-badge span,
    .achievement-badge i {
        position: relative;
        z-index: 1;
    }

    .achievement-badge span {
        color: #ffffff;
        font-size: 28px;
        font-weight: 700;
        line-height: 1;
    }

    .achievement-badge i {
        margin-top: 8px;
        color: var(--accent);
        font-size: 18px;
    }

.achievement-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .achievement-details strong {
        color: var(--text);
        font-size: 18px;
    }

    .achievement-details span {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
    }

.achievement-progress {
    height: 7px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
}

.achievement-progress-fill {
    width: 68.3%;
    height: 100%;
    background: linear-gradient( 90deg, #e99a00, #ffbd19 );
    border-radius: inherit;
}

.achievement-progress-value {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 13px;
}

    .achievement-progress-value strong {
        color: var(--text);
        font-weight: 600;
    }

/* ==========================================================
   QUICK LINKS WIDGET
   ========================================================== */

.quick-links-card {
    margin-top: 14px;
    padding: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

    .quick-links-card h2 {
        margin: 0;
        padding-bottom: 13px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        color: var(--accent);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

.quick-links-list {
    display: flex;
    flex-direction: column;
    padding-top: 8px;
}

    .quick-links-list a {
        min-height: 34px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: #62aaff;
        font-size: 13px;
        text-decoration: none;
        transition: color .2s ease, transform .2s ease;
    }

        .quick-links-list a:hover {
            color: var(--accent);
            transform: translateX(2px);
        }

        .quick-links-list a i {
            color: #c4cdd6;
            font-size: 11px;
        }

/* ==========================================================
   COMMUNITY NEWS WIDGET
   ========================================================== */

.community-news-card {
    margin-top: 14px;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
}

.community-news-header {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .community-news-header i {
        color: var(--accent);
        font-size: 16px;
    }

    .community-news-header h2 {
        margin: 0;
        color: var(--accent);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

.community-news-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.community-news-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
}

    .community-news-item + .community-news-item {
        border-left: 1px solid rgba(255,255,255,.08);
    }

.community-news-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    font-size: 17px;
}

    .community-news-icon.drivers {
        background: rgba(166,93,247,.20);
        border-color: rgba(166,93,247,.42);
        color: #c99aff;
    }

    .community-news-icon.milestone {
        background: rgba(255,189,25,.18);
        border-color: rgba(255,189,25,.42);
        color: var(--accent);
    }

    .community-news-icon.event {
        background: rgba(85,204,99,.17);
        border-color: rgba(85,204,99,.40);
        color: #69df78;
    }

    .community-news-icon.feature {
        background: rgba(59,141,240,.20);
        border-color: rgba(59,141,240,.42);
        color: #79b7ff;
    }

.community-news-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .community-news-content strong {
        overflow: hidden;
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .community-news-content span {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
    }

    .community-news-content small {
        margin-top: auto;
        color: #7f8f9e;
        font-size: 10px;
    }

    .community-news-content .community-news-live {
        color: var(--green);
    }

    .community-news-content .community-news-event-time {
        color: var(--green);
    }

/* ==========================================================
   DASHBOARD WIDGET PICKER
   ========================================================== */

.widget-picker {
    position: fixed;
    z-index: 1000;
    width: 240px;
    overflow: hidden;
    padding: 8px;
    background: rgba(7,17,28,.98);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0,0,0,.48);
    backdrop-filter: blur(12px);
}

    .widget-picker[hidden] {
        display: none;
    }

.widget-picker-title {
    padding: 8px 10px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.widget-picker-option {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 11px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

    .widget-picker-option:hover {
        background: rgba(255,189,25,.10);
        border-color: rgba(255,189,25,.24);
        color: var(--accent);
    }

    .widget-picker-option i {
        color: var(--accent);
        font-size: 12px;
    }
/* =========================================================
   DRIVER PORTAL DASHBOARD QA CORRECTIONS
   Added August 7, 2026
   ========================================================= */

/* Keep the driver card directly beneath the navigation. */
.dashboard-sidebar .sidebar-driver-card {
    margin-top: 24px;
}

/* Remove the separator line that crossed the hero artwork. */
.dashboard-hero .hero-status {
    border-top: 0;
}

/* Bring the dashboard widgets in line with the tighter portal pages. */
.dashboard-section {
    margin-top: 26px;
}

.dashboard-section-title {
    margin-bottom: 15px;
}

.dashboard-card-grid {
    gap: 16px;
}

.dashboard-card {
    min-height: 0;
    padding: 18px;
    border-radius: 13px;
    font-size: 18px;
}

.dashboard-card .card-header {
    margin-bottom: 12px;
}

.dashboard-card .card-header .card-title {
    margin-bottom: 0;
}

.dashboard-card .card-title {
    font-size: 13px;
}

.dashboard-card .card-value {
    margin-bottom: 11px;
    font-size: 48px;
}

.dashboard-card .card-value span {
    font-size: 21px;
}

.dashboard-card .card-change,
.dashboard-card .fuel-change {
    font-size: 14px;
}

.dashboard-card .card-chart {
    height: 56px;
    margin-top: 13px;
}

.dashboard-card .goal-progress {
    margin-top: 13px;
    margin-bottom: 10px;
}

.dashboard-card .card-footer {
    margin-top: 11px;
    font-size: 13px;
}

.dashboard-card .card-footer strong {
    font-size: 16px;
}

.dashboard-card .delivery-destination {
    margin-top: 5px;
    font-size: 29px;
}

.dashboard-card .delivery-status {
    margin-top: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.dashboard-card .delivery-footer {
    margin-top: 13px;
    padding-top: 13px;
}

.dashboard-card .delivery-stat strong {
    margin-top: 4px;
    font-size: 20px;
}

.dashboard-card .mini-chart,
.dashboard-card .chart-bars {
    height: 68px;
}

.dashboard-card .mini-chart {
    margin-top: 15px;
}

.dashboard-card .chart-label {
    margin-top: 9px;
}

.dashboard-card .health-grid {
    gap: 12px;
    margin-top: 16px;
}

.dashboard-card .health-item {
    padding: 13px;
}

.dashboard-card .health-item strong {
    font-size: 24px;
}

.dashboard-card .earnings-main {
    margin-top: 14px;
}

.dashboard-card .earnings-value {
    font-size: 37px;
}

.dashboard-card .earnings-change {
    margin-top: 10px;
    font-size: 15px;
}

.dashboard-card .earnings-divider {
    margin: 18px 0;
}

.dashboard-card .earnings-stats strong {
    font-size: 21px;
}

.last-trip-route {
    margin-top: 5px;
    overflow: hidden;
    color: var(--text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.last-trip-cargo {
    min-height: 20px;
    margin-top: 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.last-trip-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.last-trip-stats > div {
    min-width: 0;
}

.last-trip-stats span {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.last-trip-stats strong {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.last-trip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.last-trip-footer > strong {
    color: #55cc63;
    font-size: 15px;
}

.last-trip-footer a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.last-trip-footer a:hover {
    color: #ffffff;
}

.dashboard-main > .dashboard-caps-signature {
    width: 100%;
    grid-column: 1 / -1;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    justify-self: stretch;
    text-align: left;
}

    .dashboard-main > .dashboard-caps-signature > div:last-child {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

.dashboard-caps-signature strong,
.dashboard-caps-signature small {
    display: block;
}

    .dashboard-caps-signature strong span {
        color: #ffb000;
    }

/* Prevent Admin navigation from appearing before role permissions load. */
.admin-portal-page:not(.admin-sidebar-ready)
.admin-sidebar-navigation {
    visibility: hidden;
    pointer-events: none;
}

/* ==========================================================
   DASHBOARD COMMUNITY NEWS - DISCORD INVITATION
   ========================================================== */

.community-news-card .community-news-content {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
}

.community-news-card .community-news-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    background: rgba(88, 101, 242, .18);
    border: 1px solid rgba(88, 101, 242, .55);
    color: #aeb5ff;
    font-size: 22px;
}

.community-news-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .community-news-copy strong {
        color: var(--text);
        font-size: 15px;
    }

    .community-news-copy span {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.45;
    }

.community-news-discord-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    color: #ffffff;
    background: #5865f2;
    border: 1px solid #7b85ff;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s ease, background-color .2s ease;
}

    .community-news-discord-link:hover {
        background: #6d78ff;
        transform: translateY(-1px);
    }

@media (max-width: 760px) {
    .community-news-card .community-news-content {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .community-news-discord-link {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* ==========================================================
   LIVE TELEMETRY PRESENCE INDICATORS
   ========================================================== */

.header-online,
.sidebar-driver-online {
    background: #64748b;
}

    .header-online.is-online,
    .sidebar-driver-online.is-online {
        background: var(--green);
    }

/* ==========================================================
   DASHBOARD ACHIEVEMENTS - ALPHA STATE
   ========================================================== */

.next-achievement-card > h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

    .next-achievement-card > h2 i {
        color: var(--accent);
        font-size: 17px;
    }

.next-achievement-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

    .next-achievement-copy strong {
        color: var(--text);
        font-size: 15px;
        line-height: 1.35;
    }

    .next-achievement-copy span {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.5;
    }

    .next-achievement-copy small {
        color: #d9a337;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .04em;
        line-height: 1.4;
        text-transform: uppercase;
    }

.next-achievement-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    color: #16120a;
    background: var(--accent);
    border: 1px solid #ffc84c;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, filter .2s ease;
}

    .next-achievement-link:hover {
        color: #16120a;
        filter: brightness(1.06);
        transform: translateY(-1px);
    }

/* ==========================================================
   DASHBOARD TRUCK HEALTH SCORECARD
   ========================================================== */

#dashboard-truck-health-percent.truck-health-excellent {
    color: #35df73;
}

#dashboard-truck-health-percent.truck-health-good {
    color: #ffb400;
}

#dashboard-truck-health-percent.truck-health-attention {
    color: #ff5d68;
}

#dashboard-truck-health-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 15px !important;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

    #dashboard-truck-health-status.truck-health-score-excellent {
        border: 1px solid rgba(53, 223, 115, 0.45);
        background: rgba(53, 223, 115, 0.14);
        color: #35df73;
    }

    #dashboard-truck-health-status.truck-health-score-good {
        border: 1px solid rgba(255, 180, 0, 0.45);
        background: rgba(255, 180, 0, 0.14);
        color: #ffb400;
    }

    #dashboard-truck-health-status.truck-health-score-attention {
        border: 1px solid rgba(255, 93, 104, 0.5);
        background: rgba(255, 93, 104, 0.14);
        color: #ff5d68;
    }

.fuel-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.fuel-snapshot-card {
    min-height: 72px;
    padding: 13px;
    border: 1px solid rgba(120, 163, 198, 0.18);
    border-radius: 10px;
    background: rgba(10, 27, 42, 0.62);
    text-align: center;
}

    .fuel-snapshot-card span {
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .fuel-snapshot-card strong {
        display: block;
        margin-top: 8px;
        color: white;
        font-size: 20px;
        font-weight: 800;
    }

.header-notifications.active {
    color: var(--accent);
}

    .header-notifications.active i {
        color: var(--accent);
    }

/* ==========================================================
   INBOX ACTIVE HEADER STATE
   ========================================================== */

html[data-portal-page="inbox"] .header-notifications,
html[data-portal-page="inbox"] .header-notifications i {
    color: var(--accent) !important;
}

html[data-portal-page="inbox"] .header-notifications {
    background: rgba(255, 189, 25, 0.10);
    border-radius: 12px;
    padding: 10px 13px;
}

html[data-portal-page="inbox"] .dashboard-sidebar .sidebar-nav a[href="inbox.html"] {
    background: linear-gradient( 90deg, rgba(255,189,25,.26), rgba(255,189,25,.05) ) !important;
    border-color: rgba(255,189,25,.12) !important;
}

    html[data-portal-page="inbox"] .dashboard-sidebar .sidebar-nav a[href="inbox.html"] i {
        color: var(--accent) !important;
    }

/* ==========================================================
   LOWER SIDEBAR ACTIVE STATES
   ========================================================== */

html[data-portal-page="inbox"] .dashboard-sidebar .sidebar-nav a[href="inbox.html"],
html[data-portal-page="achievements"] .dashboard-sidebar .sidebar-nav a[href="achievements.html"],
html[data-portal-page="support"] .dashboard-sidebar .sidebar-nav a[href="support.html"],
html[data-portal-page="settings"] .dashboard-sidebar .sidebar-nav a[href="settings.html"] {
    background: linear-gradient( 90deg, rgba(255,189,25,.26), rgba(255,189,25,.05) ) !important;
    border-color: rgba(255,189,25,.12) !important;
    color: #ffffff !important;
}

    html[data-portal-page="inbox"] .dashboard-sidebar .sidebar-nav a[href="inbox.html"] i,
    html[data-portal-page="achievements"] .dashboard-sidebar .sidebar-nav a[href="achievements.html"] i,
    html[data-portal-page="support"] .dashboard-sidebar .sidebar-nav a[href="support.html"] i,
    html[data-portal-page="settings"] .dashboard-sidebar .sidebar-nav a[href="settings.html"] i {
        color: var(--accent) !important;
    }

/* ==========================================================
   LIVE MAP LAYER CONTROL COLLAPSE
   ========================================================== */

#map-layer-control {
    min-width: 210px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 14px 34px rgba(0,0,0,0.35);
}

.map-layer-toggle {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.map-layer-toggle-icon {
    color: var(--accent);
}

.map-layer-toggle-text {
    margin-left: auto;
    color: #ffffff;
}

.map-layer-control-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#map-layer-control.collapsed {
    min-width: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(7, 17, 28, 0.96);
}

    #map-layer-control.collapsed .map-layer-toggle {
        width: 48px;
        height: 48px;
        justify-content: center;
    }

    #map-layer-control.collapsed .map-layer-toggle-text,
    #map-layer-control.collapsed .map-layer-control-body {
        display: none;
    }

/* ==========================================================
   PLATFORM-WIDE ANNOUNCEMENTS
   ========================================================== */

.platform-announcements {
    display: grid;
    gap: 8px;
    max-width: 1600px;
    margin: 12px auto 0;
    padding: 0 20px;
}

.platform-announcement {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid #21679b;
    border-left-width: 4px;
    border-radius: 7px;
    background: #061a2a;
    color: #dcecf9;
    padding: 10px 14px;
}

.platform-announcement > i { margin-top: 2px; color: #54c3ff; }
.platform-announcement div { display: grid; gap: 3px; }
.platform-announcement strong { color: #f5f8fb; font-size: 13px; }
.platform-announcement span { color: #b7cede; font-size: 12px; line-height: 1.4; white-space: pre-line; }
.platform-announcement-amber { border-color: #c99014; background: #201807; }.platform-announcement-amber > i { color: #ffc63e; }
.platform-announcement-green { border-color: #2c9464; background: #071d16; }.platform-announcement-green > i { color: #66e6a2; }
.platform-announcement-red { border-color: #b25059; background: #251217; }.platform-announcement-red > i { color: #ff9098; }
.platform-announcement-purple { border-color: #7955ad; background: #171127; }.platform-announcement-purple > i { color: #cfabff; }

/* Driver Portal notices sit above the sidebar/content grid, not within it. */
.dashboard-page > .platform-announcements {
    max-width: none;
    margin: 12px 16px 0;
    padding: 0;
}

@media (max-width: 700px) { .platform-announcements { padding: 0 10px; } }
