:root {
    --bg: #0b1220;
    --bg-soft: #121a2b;
    --panel: #172033;
    --panel-2: #1d2940;
    --border: #2a3650;
    --text: #e8eefc;
    --text-soft: #9eb0d1;
    --accent: #5ea1ff;
    --accent-hover: #7ab3ff;
    --success: #35c58a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

    --sidebar-width: 250px;
    --topbar-height: 72px;
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0d1526 0%, #10192d 100%);
    border-right: 1px solid var(--border);
    padding: 22px 18px;
    flex-shrink: 0;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.sidebar__logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #7a5cff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: var(--shadow);
}

.sidebar__title {
    font-size: 18px;
    font-weight: 700;
}

.sidebar__subtitle {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 3px;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__link {
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-soft);
    transition: 0.2s ease;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.main-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    padding: 0 28px;
}

.topbar__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.topbar__subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.content {
    padding: 24px 28px 28px;
}

/* ===== STATS / CARDS ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow);
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

/* ===== PANELS ===== */

.panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel--map {
    overflow: visible;
}

.panel--narrow {
    max-width: 900px;
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.panel__title {
    margin: 0;
    font-size: 18px;
}

.panel__subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.panel__body {
    padding: 20px;
}

.panel__body--map {
    overflow: visible;
}

/* ===== BUTTONS ===== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    transition: 0.2s ease;
    border: none;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-hover);
}

.button--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    background: #7FB77E;
}

.button--ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    background: #6FAF4F;
}

.button--small {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12px;
}

.button--danger {
    background: #b94242;
    color: #fff;
    border: none;
}

.button--danger:hover {
    background: #cf4d4d;
}

/* ===== TABLES ===== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table thead th {
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== ACTIVITY TITLES ===== */

.activity-title {
    font-weight: 600;
    color: var(--text);
}

.activity-title a {
    color: inherit;
    text-decoration: none;
}

.activity-title a:hover {
    text-decoration: underline;
}

.activity-file {
    color: var(--text-soft);
    font-size: 12px;
    margin-top: 4px;
}

.muted {
    color: var(--text-soft);
}

/* ===== EMPTY STATES ===== */

.empty-state {
    padding: 40px 24px;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state__text {
    color: var(--text-soft);
    max-width: 560px;
    line-height: 1.55;
}

/* ===== FORMS ===== */

.form-grid {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0f1728;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 161, 255, 0.15);
}

.form-input::placeholder {
    color: #6f82a7;
}

.form-input--file {
    padding: 10px 14px;
    min-height: auto;
}

.form-help {
    font-size: 12px;
    color: var(--text-soft);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.form-select {
    min-width: 120px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f1728;
    color: var(--text);
    outline: none;
}

/* ===== ALERTS ===== */

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
}

.alert--error {
    background: rgba(255, 90, 90, 0.10);
    border-color: rgba(255, 90, 90, 0.25);
}

.alert--success {
    background: rgba(53, 197, 138, 0.10);
    border-color: rgba(53, 197, 138, 0.25);
}

.alert__title {
    font-weight: 700;
    margin-bottom: 8px;
}

.alert__list {
    margin: 0;
    padding-left: 18px;
}

.upload-summary {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
}

/* ===== ANALYSIS ===== */

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.analysis-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.analysis-card__label {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-card__value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

/* ===== ACTIVITY DETAIL ===== */

.activity-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
}

.activity-main,
.activity-side {
    display: grid;
    gap: 20px;
    align-content: start;
}

.stats-grid--detail {
    margin-bottom: 0;
}

.map-box {
    width: 100%;
    height: 560px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0f1728;
}

.meta-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.meta-list__row {
    display: grid;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.meta-list__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meta-list__row dt {
    color: var(--text-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-list__row dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    line-height: 1.4;
}

/* ===== CHARTS ===== */

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-wrapper--large {
    height: 320px;
}

.chart-box {
    width: 100%;
    height: 100%;
}

/* ===== SEARCH / PAGINATION ===== */

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f1728;
    color: var(--text);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.pagination-info {
    color: var(--text-soft);
    font-size: 13px;
}

/* ===== STATS PAGE ===== */

.stats-page {
    display: grid;
    gap: 20px;
}

.stats-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.year-selector-form {
    display: flex;
    align-items: end;
    gap: 10px;
}

/* ===== RECORDS ===== */

.records-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}

.record-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.record-card__label {
    font-size: 12px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.record-card__value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 10px;
}

.record-card__title a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.record-card__title a:hover {
    text-decoration: underline;
}

.record-card__empty {
    color: var(--text-soft);
}

/* ===== GLOBAL MAP ===== */

.map-shell,
.map-debug-wrapper {
    width: 100%;
    display: block;
    min-width: 0;
}

.global-map-box {
    width: 100%;
    height: 700px;
    min-height: 700px;
    display: block;
    position: relative;
    background: #0f1728;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.map-filters {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.map-filters .form-row {
    min-width: 180px;
}

.map-filters__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-summary__badge {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.filter-info,
.debug-date {
    color: var(--text-soft);
    font-size: 13px;
}

.debug-date {
    margin-top: 4px;
    font-size: 11px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .records-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 1180px) {
    .activity-layout {
        grid-template-columns: 1fr;
    }

    .activity-side {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .stats-two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .analysis-grid {
        grid-template-columns: 1fr 1fr;
    }

    .activity-side {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 18px;
    }

    .map-box {
        height: 420px;
    }

    .global-map-box {
        height: 480px;
        min-height: 480px;
    }
}

@media (max-width: 700px) {
    .records-grid {
        grid-template-columns: 1fr;
    }
}

.split-speed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.split-speed--neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
}

.split-speed--fast {
    background: rgba(53, 197, 138, 0.18);
    color: #8ef0be;
    border-color: rgba(53, 197, 138, 0.35);
}

.split-speed--mid {
    background: rgba(94, 161, 255, 0.18);
    color: #9bc4ff;
    border-color: rgba(94, 161, 255, 0.35);
}

.split-speed--slow {
    background: rgba(255, 179, 71, 0.18);
    color: #ffd08a;
    border-color: rgba(255, 179, 71, 0.35);
}

.split-speed--very-slow {
    background: rgba(255, 107, 107, 0.18);
    color: #ff9b9b;
    border-color: rgba(255, 107, 107, 0.35);
}

.input-inline {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    width: 100%;
    padding: 4px 6px;
    border-radius: 6px;
}

.input-inline:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.03);
}

.inline-title-editor {
    position: relative;
    width: 100%;
}

.inline-title-editor__display {
    display: inline-block;
    width: 100%;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: text;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}

.inline-title-editor__display:hover,
.inline-title-editor__display:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    outline: none;
}

.inline-title-editor__input {
    display: none;
    width: 100%;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: #0f1728;
    color: var(--text);
    outline: none;
}

.inline-title-editor.is-editing .inline-title-editor__display {
    display: none;
}

.inline-title-editor.is-editing .inline-title-editor__input {
    display: block;
}

.split-speed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.split-speed--neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
}

.split-speed--fast {
    background: rgba(53, 197, 138, 0.18);
    color: #8ef0be;
    border-color: rgba(53, 197, 138, 0.35);
}

.split-speed--mid {
    background: rgba(94, 161, 255, 0.18);
    color: #9bc4ff;
    border-color: rgba(94, 161, 255, 0.35);
}

.split-speed--slow {
    background: rgba(255, 179, 71, 0.18);
    color: #ffd08a;
    border-color: rgba(255, 179, 71, 0.35);
}

.split-speed--very-slow {
    background: rgba(255, 107, 107, 0.18);
    color: #ff9b9b;
    border-color: rgba(255, 107, 107, 0.35);
}

.inline-title-editor {
    position: relative;
    width: 100%;
}

.inline-title-editor__display {
    display: inline-block;
    width: 100%;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: text;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.inline-title-editor__display:hover,
.inline-title-editor__display:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    outline: none;
}

.inline-title-editor__input {
    display: none;
    width: 100%;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: #0f1728;
    color: var(--text);
    outline: none;
}

.inline-title-editor.is-editing .inline-title-editor__display {
    display: none;
}

.inline-title-editor.is-editing .inline-title-editor__input {
    display: block;
}

.panel--inner {
    margin-bottom: 0;
}

.route-row--best {
    background: rgba(53, 197, 138, 0.08);
}

.route-row--worst {
    background: rgba(255, 107, 107, 0.08);
}

/* =========================================================
   PATCH DESKTOP PREMIUM
   À placer tout en bas de app.css
   ========================================================= */

:root {
    --sidebar-width: 270px;
    --topbar-height: 64px;
    --radius: 14px;
    --radius-sm: 10px;
}

/* Base générale */
html, body {
    font-size: 13px;
}

body {
    letter-spacing: 0.01em;
}

.app-shell {
    min-height: 100vh;
}

.main-content {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.03), transparent 28%),
        var(--bg);
}

/* Sidebar plus desktop */
.sidebar {
    padding: 18px 14px;
    background: linear-gradient(180deg, #0b1324 0%, #0f182a 100%);
}

.sidebar__brand {
    margin-bottom: 22px;
    padding: 4px 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar__logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 13px;
}

.sidebar__title {
    font-size: 16px;
}

.sidebar__subtitle {
    font-size: 11px;
}

.sidebar__nav {
    gap: 6px;
}

.sidebar__link {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: rgba(255,255,255,0.07);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* Topbar plus compacte */
.topbar {
    height: var(--topbar-height);
    padding: 0 22px;
    background: rgba(11, 18, 32, 0.92);
}

.topbar__title {
    font-size: 22px;
    font-weight: 700;
}

.topbar__subtitle {
    font-size: 12px;
    margin-top: 2px;
}

.content {
    padding: 18px 22px 22px;
}

/* Stats : plus desktop, plus denses */
.stats-grid {
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 14px 15px 13px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.stat-card__label {
    font-size: 11px;
    margin-bottom: 8px;
    letter-spacing: 0.07em;
}

.stat-card__value {
    font-size: 24px;
    font-weight: 700;
}

/* Panels plus “logiciel” */

/* Tableaux : plus compacts */
.data-table th,
.data-table td {
    padding: 10px 12px;
}

.data-table thead th {
    font-size: 11px;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

/* Boutons plus desktop */
.button {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.button--small {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 11px;
}

/* Champs/formulaires plus serrés */
.form-grid {
    gap: 14px;
}

.form-row {
    gap: 6px;
}

.form-label {
    font-size: 12px;
}

.form-input,
.form-select {
    min-height: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.form-input--file {
    padding: 8px 12px;
    height: auto;
}

.form-help {
    font-size: 11px;
}

.form-actions {
    gap: 10px;
}

/* Panneaux activité / route */
.activity-layout {
    gap: 16px;
}

.activity-main,
.activity-side {
    gap: 16px;
}

.meta-list {
    gap: 10px;
}

.meta-list__row {
    padding-bottom: 10px;
}

.meta-list__row dt {
    font-size: 11px;
}

.meta-list__row dd {
    font-size: 13px;
}

/* Graphes et cartes */
.map-box {
    height: 520px;
    border-radius: 12px;
}

.global-map-box {
    height: 620px;
    min-height: 620px;
    border-radius: 12px;
}

.chart-wrapper {
    height: 230px;
}

.chart-wrapper--large {
    height: 290px;
}

/* Badges / records / splits */
.map-summary__badge,
.split-speed-badge {
    font-size: 11px;
    font-weight: 700;
}

.record-card {
    padding: 14px;
    border-radius: 12px;
}

.record-card__label {
    font-size: 11px;
    margin-bottom: 8px;
}

.record-card__value {
    font-size: 22px;
}

/* Titre éditable */
.inline-title-editor__display,
.inline-title-editor__input {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 13px;
}

.inline-title-editor__edit-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

/* États vides plus sobres */
.empty-state {
    padding: 28px 20px;
}

.empty-state__title {
    font-size: 16px;
    margin-bottom: 6px;
}

.empty-state__text {
    font-size: 13px;
    line-height: 1.5;
}

/* Vue très desktop sur grands écrans */
@media (min-width: 1400px) {
    .content {
        padding: 20px 26px 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(180px, 1fr));
    }

    .activity-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

.split-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.split-badge--neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
}

.split-badge--slow,
.split-badge--low {
    background: rgba(255, 107, 107, 0.18);
    color: #ff9b9b;
    border-color: rgba(255, 107, 107, 0.35);
}

.split-badge--mid,
.split-badge--flat {
    background: rgba(94, 161, 255, 0.18);
    color: #9bc4ff;
    border-color: rgba(94, 161, 255, 0.35);
}

.split-badge--fast,
.split-badge--high,
.split-badge--up {
    background: rgba(53, 197, 138, 0.18);
    color: #8ef0be;
    border-color: rgba(53, 197, 138, 0.35);
}

.split-badge--very-fast,
.split-badge--very-high,
.split-badge--steep {
    background: rgba(241, 196, 15, 0.18);
    color: #ffe08a;
    border-color: rgba(241, 196, 15, 0.35);
}

.split-badge--down {
    background: rgba(52, 152, 219, 0.18);
    color: #8fd3ff;
    border-color: rgba(52, 152, 219, 0.35);
}

.speed-zones {
    display: grid;
    gap: 14px;
}

.speed-zone {
    display: grid;
    gap: 8px;
}

.speed-zone__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.speed-zone__left,
.speed-zone__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.speed-zone__label {
    font-weight: 700;
    min-width: 28px;
}

.speed-zone__range {
    color: var(--text-soft);
    font-size: 13px;
}

.speed-zone__percent {
    color: var(--text-soft);
    font-weight: 600;
}

.speed-zone__time {
    font-weight: 700;
    min-width: 78px;
    text-align: right;
}

.speed-zone__bar {
    width: 100%;
    height: 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.speed-zone__fill {
    height: 100%;
    border-radius: 999px;
}

.speed-zone--z1 { background: #2f80ed; }
.speed-zone--z2 { background: #27ae60; }
.speed-zone--z3 { background: #f2c94c; }
.speed-zone--z4 { background: #f2994a; }
.speed-zone--z5 { background: #eb5757; }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.mini-stat__label {
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mini-stat__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* ===== TRAINING EFFECT ===== */

.training-box {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    padding: 16px;
}

.training-box__header {
    margin-bottom: 14px;
}

.training-box__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.training-box__subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-soft);
}

.training-box__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.training-metric {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.training-metric__label {
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.training-metric__value {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    color: var(--text);
}

.training-metric__status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.training-metric__bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.training-metric__fill {
    height: 100%;
    border-radius: 999px;
}

.training-metric__fill--aerobic {
    background: linear-gradient(90deg, #2f80ed 0%, #27ae60 45%, #f2c94c 100%);
}

.training-metric__fill--anaerobic {
    background: linear-gradient(90deg, #f2994a 0%, #eb5757 100%);
}

.training-box__summary {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .training-box__grid {
        grid-template-columns: 1fr;
    }
}

.delta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.delta--good {
    color: #177245;
    background: rgba(23, 114, 69, 0.14);
    border: 1px solid rgba(23, 114, 69, 0.22);
}

.delta--bad {
    color: #b42318;
    background: rgba(180, 35, 24, 0.12);
    border: 1px solid rgba(180, 35, 24, 0.20);
}

.delta--neutral {
    color: #475467;
    background: rgba(71, 84, 103, 0.10);
    border: 1px solid rgba(71, 84, 103, 0.16);
}

.route-row--best td {
    background: rgba(23, 114, 69, 0.06);
}

.route-row--worst td {
    background: rgba(180, 35, 24, 0.05);
}

.route-row--best td:first-child {
    box-shadow: inset 3px 0 0 #177245;
}

.route-row--worst td:first-child {
    box-shadow: inset 3px 0 0 #b42318;
}

.table-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}

.table-badge--success {
    color: #177245;
    background: rgba(23, 114, 69, 0.12);
    border: 1px solid rgba(23, 114, 69, 0.20);
}

.route-summary-text {
    font-size: 14px;
    line-height: 1.6;
}

.split-delta {
    display: inline-block;
    min-width: 72px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
}

.split-delta--good {
    color: #177245;
    background: rgba(23, 114, 69, 0.14);
    border: 1px solid rgba(23, 114, 69, 0.22);
}

.split-delta--bad {
    color: #b42318;
    background: rgba(180, 35, 24, 0.12);
    border: 1px solid rgba(180, 35, 24, 0.20);
}