/* ===================================================================
   Running Dashboard - Main Stylesheet
   =================================================================== */

/* ===================================================================
   Base & Typography
   =================================================================== */

body {
    font-family: var(--font-family-base);
    background-color: #f3f6f4;
    color: var(--color-text-dark);
    line-height: 1.55;
}

.running-app-container {
    max-width: 1480px;
    margin: 0 auto;
    padding-top: 2rem;
    padding-bottom: 3.5rem;
}

h3 {
    font-weight: 650;
}

/* ===================================================================
   Hero Section
   =================================================================== */
.running-hero-section {
    background: linear-gradient(120deg, #173b35 0%, #245d50 58%, #347263 100%);
    color: #fff;
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
}

.running-hero-section h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: .5rem;
    color: #fff;
    letter-spacing: -0.035em;
}

.running-hero-section .subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================================================
   Dashboard Components
   =================================================================== */

.stats-card {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    height: 100%;
    box-shadow: var(--box-shadow-sm);
    transition: transform var(--transition-speed-fast) var(--transition-ease), box-shadow var(--transition-speed-fast) var(--transition-ease);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.stats-card .card-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: .75rem;
    letter-spacing: .01em;
}

.stats-highlight {
    font-size: 2rem;
    font-weight: 500;
    color: var(--color-primary);
}

.stats-unit {
    font-size: 1rem;
    color: var(--color-secondary);
    font-weight: 400;
}

.app-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.app-summary-item {
    background-color: #fff;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    text-align: center;
}

.app-summary-label {
    font-size: 0.85rem;
    color: var(--color-secondary);
    margin-bottom: 0.25rem;
}

.app-summary-value {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Filter Card Styles */
.filter-card {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    box-shadow: var(--box-shadow-sm);
}

.filter-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.filter-card .filter-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.app-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: .5rem;
    border: 1px solid var(--color-border);
}

.form-label-sm {
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-secondary);
    margin-bottom: .25rem;
    display: block;
}

.dashboard-section-header {
    text-align: left;
    margin: 2.75rem 0 1.15rem;
}
.dashboard-section-header h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--color-text-dark);
    letter-spacing: -.025em;
}
.dashboard-section-header p {
    font-size: .95rem;
    color: var(--color-secondary);
    max-width: 720px;
    margin: 0;
}

/* ===================================================================
   Activity Table
   =================================================================== */
.activity-table {
    border-collapse: collapse;
    min-width: 800px;
    margin-bottom: 0;
}

.table-responsive {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: #fff;
}

.activity-table thead th {
    background-color: #f5f8f6;
    font-weight: 600;
    color: var(--color-text-dark);
    text-transform: none;
    font-size: .78rem;
    letter-spacing: .025em;
    border-bottom: 2px solid var(--color-border);
    padding: .9rem .75rem;
    white-space: nowrap;
    border-top: 0;
}

.activity-table th, .activity-table td {
    padding: .75rem;
    text-align: left;
    vertical-align: middle;
    border-top: 1px solid var(--color-border);
}

.activity-date__day {
    color: var(--color-text-dark);
    font-weight: 600;
    white-space: nowrap;
}

.activity-date {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    white-space: nowrap;
}

.activity-date__relative {
    color: #52665f;
    font-size: .75rem;
    white-space: nowrap;
}

.activity-table th[data-key="select"],
.activity-table td:first-child {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    padding-right: .35rem;
    padding-left: .6rem;
    white-space: nowrap;
}

.activity-location {
    display: block;
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-pace {
    white-space: nowrap;
}

.activity-row-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .25rem .3rem;
    font-size: .75rem;
    white-space: nowrap;
}

.activity-row-actions {
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.activity-row-actions > .btn {
    flex: 0 0 auto;
}

.activity-table .activity-type-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35em .6em;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.activity-table .activity-type-badge--trail {
    color: #1b5e20;
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

.activity-table .activity-type-badge--virtual {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.activity-table .activity-type-badge--walk {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.activity-table .activity-type-badge--default {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #9ec5fe;
}

.activity-table tbody tr:first-child td {
    border-top: 0;
}

.activity-table tbody tr:hover {
    background-color: rgba(23, 107, 91, 0.055);
}

.activity-table th[data-key] {
    cursor: pointer;
    user-select: none;
}

.activity-table th[data-key] i {
    margin-left: 5px;
    color: #ccc;
    transition: transform 0.2s, color 0.2s;
}

.activity-table th[data-key].asc i,
.activity-table th[data-key].desc i {
    color: var(--color-primary);
}

.activity-table th[data-key].desc i {
    transform: rotate(180deg);
}

/* Responsive Table */
@media (max-width: 991px) {
    .activity-table, .activity-table tbody, .activity-table tr, .activity-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .activity-table thead {
        display: none;
    }
    .activity-table tr {
        background: #fff;
        margin-bottom: 0.75rem;
        border-radius: .5rem;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--color-border);
    }
    .activity-table td {
        padding: 0.6rem 1rem;
        text-align: right;
        padding-left: 40%;
        position: relative;
        border-top: 1px solid #f1f1f1;
        font-size: 0.9rem;
    }
    .activity-table td:first-child {
        border-top: 0;
    }
    .activity-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 35%;
        text-align: left;
        font-weight: 600;
        color: var(--color-secondary);
        font-size: 0.8em;
        text-transform: uppercase;
    }
}


/* ===================================================================
   Detail View
   =================================================================== */
.detail-view-wrap {
    background: #fff;
    padding: 2rem;
    border-radius: .5rem;
    border: 1px solid var(--color-border);
}

.detail-title {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.detail-meta {
    font-size: 1rem;
    color: var(--color-secondary);
    margin-bottom: 2rem;
}

.detail-meta a {
    color: var(--color-secondary);
    text-decoration: none;
}
.detail-meta a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.detail-widget {
    margin-top: 2.5rem;
}

.detail-widget-title {
    font-size: 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: .75rem;
    margin-bottom: 1.5rem;
}

.activity-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.activity-photo-gallery img {
    width: 100%;
    height: auto;
    border-radius: .5rem;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-item {
    background: var(--light-gray);
    padding: .75rem 1rem;
    border-radius: .5rem;
    border: 1px solid #e9ecef;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-transform: uppercase;
    margin-bottom: .25rem;
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 500;
}

.analysis-points {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
    list-style-type: '✓ ';
}
.analysis-points li {
    padding-left: .5rem;
    margin-bottom: .5rem;
}

.analysis-recommendation {
    background: #e9f7fd;
    border-left: 4px solid #0dcaf0;
    padding: 1rem;
    border-radius: .25rem;
}

/* ===================================================================
   Compare Panel
   =================================================================== */
.compare-panel {
    background: var(--light-gray);
    border: 1px solid var(--color-border);
    border-radius: .5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none; /* Initially hidden */
}

.compareDeepWrap {
    background: #fff;
    padding: 1.5rem;
    border-radius: .5rem;
    border: 1px solid var(--color-border);
    margin-top: 1.5rem;
    box-shadow: var(--box-shadow-sm);
}

.compareMetricBreakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.compareInsightsWrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.compare-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.compare-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--color-secondary);
}

.compare-mode-group {
    flex-shrink: 0;
    display: inline-flex;
    border: 1px solid var(--color-primary);
    border-radius: .5rem;
    overflow: hidden;
}
.compare-mode-btn {
    border: none;
    background: transparent;
    color: var(--color-primary);
    padding: .5rem 1rem;
    cursor: pointer;
}
.compare-mode-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.run-map-container {
    height: 450px;
    width: 100%;
    border: 1px solid var(--color-border);
    background-color: #f8f9fa;
    border-radius: .5rem;
    box-shadow: var(--box-shadow-sm);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.compare-item {
    background: #fff;
    padding: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: .5rem;
    box-shadow: var(--box-shadow-sm);
    font-size: 0.88rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
}
.compare-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}
.compare-item.is-base {
    border-color: #2868b8;
    background-color: #f8fafd;
    box-shadow: 0 0 0 1px #2868b8;
}
.compare-item .muted {
    color: #495057;
    font-size: 0.78rem;
}

.compare-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}
.compare-controls select {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #1e293b;
}

.compare-insights {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.compare-insight-card {
    flex: 1 1 180px;
    background: #f8fafc;
    padding: 0.75rem 0.85rem;
    border-radius: .5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.compare-insight-card strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
    margin-bottom: .25rem;
}

.compare-insight-card div {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-insight-card .muted {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2868b8;
}

.compareMatrixWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
}

.compare-matrix {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.compare-matrix th, .compare-matrix td {
    padding: .65rem .85rem;
    text-align: left;
    border: 1px solid var(--color-border);
    vertical-align: middle;
}
.compare-matrix thead th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #cbd5e1;
}
.compare-matrix th.is-base-col,
.compare-matrix td.is-base-col {
    background-color: #f0f6ff !important;
    border-left: 2px solid #2868b8;
    border-right: 2px solid #2868b8;
}
.compare-matrix .is-winner {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    font-weight: 600;
}
.compare-matrix .is-loser {
    background-color: #f8d7da !important;
    color: #842029 !important;
}
.compare-matrix .muted {
    font-size: 0.75rem;
    color: #495057;
    font-weight: 400;
    display: block;
}

.compare-delta-pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-family: var(--font-family-mono, monospace);
    font-weight: 600;
    margin-top: 0.2rem;
}
.compare-delta-pill.delta-better {
    background-color: #d1e7dd;
    color: #0f5132;
}
.compare-delta-pill.delta-worse {
    background-color: #f8d7da;
    color: #842029;
}
.compare-delta-pill.delta-neutral {
    background-color: #e9ecef;
    color: #495057;
}

.compare-deltas {
    margin-top: 1.25rem;
    font-size: 0.88rem;
}
.compare-delta-row {
    display: flex;
    justify-content: space-between;
    padding: .5rem;
    border-bottom: 1px solid var(--color-border);
}
.compare-delta-row:last-child {
    border-bottom: none;
}
.compare-delta-row span:first-child {
    font-weight: 500;
}

/* Deep Compare Lab Styles */
.compare-deep-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}
@media (min-width: 992px) {
    .compare-deep-grid {
        grid-template-columns: 1.35fr 1fr;
    }
}

.compare-deep-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: var(--box-shadow-sm);
}

.compare-deep-card h4,
.compare-deep-card strong.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.compare-radar-wrap {
    position: relative;
    height: 320px;
    width: 100%;
    margin: 0.75rem 0;
}

.compare-metric-breakdown {
    margin-top: 1.25rem;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}
.compare-metric-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0;
}
.compare-metric-table th,
.compare-metric-table td {
    padding: 0.5rem 0.65rem;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}
.compare-metric-table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}
.compare-metric-table td.is-winner {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    font-weight: 600;
}
.compare-metric-table .muted {
    font-size: 0.72rem;
    color: #495057;
}

.compare-mini-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
    margin-top: 1.25rem;
}
.compare-mini-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.5rem;
}
.compare-mini-card strong {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    display: block;
    margin-bottom: 0.25rem;
}
.compare-mini-wrap {
    position: relative;
    height: 75px;
    width: 100%;
}

.compare-ai-insights {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.75rem;
}
.compare-ai-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2868b8;
}
.compare-ai-item.border-success {
    border-left-color: #198754 !important;
}
.compare-ai-item.border-warning {
    border-left-color: #fd7e14 !important;
}
.compare-ai-item.border-danger {
    border-left-color: #dc3545 !important;
}
.compare-ai-item.border-info {
    border-left-color: #0dcaf0 !important;
}
.compare-ai-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.compare-ai-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    margin-bottom: 0.2rem;
}
.compare-ai-body {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}


/* ===================================================================
   Comments Section
   =================================================================== */
.comments-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.comment-form-wrap {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: .5rem;
    margin-bottom: 2rem;
}

.comments-list .comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}
.comments-list .comment-item:last-child {
    border-bottom: none;
}

.comment-meta {
    font-size: 0.875rem;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.comment-body {
    line-height: 1.6;
}

.comment-actions {
    margin-top: .5rem;
}

/* ===================================================================


/* ===================================================================
   Stats Page
   =================================================================== */
.stats-card .list-group-item {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.stats-card .card-header {
    background-color: #f8f9fa;
    font-size: 0.9rem;
}

.stats-note {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: .25rem;
}

.chart-container.chart-narrow {
    max-width: 450px;
    margin: 0 auto;
    height: 300px;
}
/* A simple, responsive grid for your dashboard cards */
.dashboard-grid {
    display: grid;
    /* On larger screens, create a flexible grid that fits as many 350px cards as possible */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* A clear, high-contrast focus style for keyboard navigation */
:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(0, 95, 204, 0.3);
}

/* On screens smaller than 768px (tablets and phones) */
@media (max-width: 768px) {
    .dashboard-grid {
        /* Switch to a single column layout */
        grid-template-columns: 1fr;
    }
}

/* Wrapper for tables to make them horizontally scrollable on small screens */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-sub-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(220, 230, 226, 0.7);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(12px);
    margin-bottom: 1.5rem;
}

.app-sub-nav .container {
    max-width: 1480px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.app-sub-nav nav,
.app-sub-nav .d-flex {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.app-sub-nav .sub-nav-link {
    flex: 0 0 auto;
    color: #495057;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.app-sub-nav .sub-nav-link:hover {
    color: #2868b8;
    background-color: #eef4fc;
}

.app-sub-nav .sub-nav-link.active,
.app-sub-nav .sub-nav-link[aria-current="page"] {
    color: #ffffff !important;
    background-color: #2868b8 !important;
    box-shadow: 0 2px 6px rgba(40, 104, 184, 0.35);
}

/* Sub-nav Pill Groups (Language & Unit switchers) */
.app-sub-nav .btn-group {
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dee2e6;
    padding: 2px;
}

.app-sub-nav .btn-group .btn {
    border: none !important;
    border-radius: 999px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 0.65rem !important;
    line-height: 1.25 !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.app-sub-nav .btn-group .btn.btn-outline-secondary {
    color: #64748b !important;
    background-color: transparent !important;
}

.app-sub-nav .btn-group .btn.btn-outline-secondary:hover {
    color: #0f172a !important;
    background-color: #e2e8f0 !important;
}

.app-sub-nav .btn-group .btn.btn-primary {
    color: #ffffff !important;
    background-color: #2868b8 !important;
    box-shadow: 0 1px 3px rgba(40, 104, 184, 0.35) !important;
}

.app-sub-nav a.sub-nav-logout,
.app-sub-nav a.ms-auto {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.app-sub-nav a.sub-nav-logout:hover,
.app-sub-nav a.ms-auto:hover {
    color: #dc3545;
    background-color: #fdf2f2;
    border-color: #f5c2c7;
}

.app-sub-nav .sub-nav-user {
    font-size: 0.83rem;
    padding: 0.3rem 0.75rem;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
}

.app-sub-nav .sub-nav-user-icon {
    font-size: 0.95rem;
    color: #2868b8;
}

.app-sub-nav .sub-nav-user-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-right: 0.25rem;
}

.app-sub-nav .sub-nav-user-name {
    font-weight: 700;
    color: #0f172a;
}

.running-page-title {
    margin: .2rem 0 1.6rem;
    color: var(--color-text-dark);
    font-size: clamp(1.8rem, 3.3vw, 2.45rem);
    font-weight: 750;
    letter-spacing: -.045em;
}

.dashboard-page {
    width: 100%;
}

.dashboard-section-header--compact {
    margin-top: 0;
}

.dashboard-section-header--feed {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
}

.dashboard-section-header--feed p {
    padding-bottom: .55rem;
}

.viewer-mode-note {
    display: inline-flex;
    align-items: center;
    margin: -.6rem 0 1.2rem;
    padding: .35rem .7rem;
    border: 1px solid #c8ddd5;
    border-radius: 999px;
    background: #edf6f1;
    color: #356d59;
    font-size: .8rem;
    font-weight: 650;
}

.summary-stat-card {
    min-height: 138px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background: #fff;
    box-shadow: var(--box-shadow-sm);
    transition: transform var(--transition-speed-fast), box-shadow var(--transition-speed-fast);
}

.summary-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.summary-stat-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1.2rem 1.3rem;
}

.summary-stat-card .card-subtitle {
    margin-bottom: .55rem;
    color: #64766f;
    font-size: .82rem;
    font-weight: 650;
}

.summary-stat-card .card-text {
    margin: 0;
    color: var(--color-text-dark);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.summary-stat-card .card-text span {
    color: #63756e;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.summary-stat-unit {
    margin-top: .35rem;
    color: #83918c;
    font-size: .75rem;
}

.summary-stat-card--primary {
    border-color: #176b5b;
    background: linear-gradient(145deg, #1b6758, #174d43);
}

.summary-stat-card--primary .card-subtitle,
.summary-stat-card--primary .card-text,
.summary-stat-card--primary .card-text span,
.summary-stat-card--primary .summary-stat-unit {
    color: #fff;
}

.summary-stat-card--primary .summary-stat-unit {
    color: rgba(255, 255, 255, .72);
}

.summary-stat-card--compact {
    min-height: 108px;
}

.summary-stat-card--compact .card-body {
    padding: .9rem 1rem;
}

.summary-stat-card--compact .card-subtitle {
    margin-bottom: .4rem;
}

.summary-stat-card--compact .card-text {
    font-size: 1.55rem;
}

.running-app-container .card:not(.summary-stat-card) {
    border-color: var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
}

.running-app-container .card-header {
    border-bottom-color: var(--color-border);
    background: #f7faf8;
    color: #334a43;
}

.running-app-container .filter-card {
    box-shadow: var(--box-shadow-sm);
}

.running-app-container .form-control,
.running-app-container .form-select {
    min-height: 42px;
    border-color: #d4e0db;
    border-radius: var(--border-radius-sm);
}

.running-app-container .form-control:focus,
.running-app-container .form-select:focus {
    border-color: #5b9a86;
    box-shadow: 0 0 0 .2rem rgba(23, 107, 91, .14);
}

.running-app-container .btn {
    border-radius: .6rem;
    font-weight: 600;
}

.running-app-container .btn-primary {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
}

.running-app-container .btn-primary:hover {
    border-color: #105647;
    background-color: #105647;
}

.running-app-container .nav-pills .nav-link {
    border-radius: 999px;
    color: #52665f;
    font-size: .875rem;
    font-weight: 600;
}

.running-app-container .nav-pills .nav-link.active {
    background-color: var(--color-primary);
    color: #fff;
}

.running-app-container .table {
    --bs-table-striped-bg: #f7faf8;
}

.running-app-container .list-group-item {
    border-color: #e7eeeb;
}

.chart-container {
    position: relative;
    padding: .5rem;
    border: 1px solid #e7eeeb;
    border-radius: var(--border-radius-md);
    background: #fff;
}

.chart-container.chart-narrow {
    padding: .25rem;
}

:focus-visible {
    outline-color: #176b5b;
    box-shadow: 0 0 0 4px rgba(23, 107, 91, .18);
}

@media (max-width: 767.98px) {
    .running-app-container {
        padding-top: 1.35rem;
        padding-bottom: 2rem;
    }

    .running-page-title {
        margin-bottom: 1.2rem;
    }

    .summary-stat-card {
        min-height: 118px;
    }

    .summary-stat-card .card-body {
        padding: .95rem;
    }

    .dashboard-section-header {
        margin: 2rem 0 1rem;
    }

    .dashboard-section-header--compact {
        margin-top: 0;
    }

    .dashboard-section-header--feed {
        display: block;
        margin-top: 2.3rem;
    }

    .dashboard-section-header--feed p {
        padding: 0;
    }

    .filter-card {
        padding: .9rem;
    }

    .running-app-container .nav-pills {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
    }

    .running-app-container .nav-pills .nav-link {
        white-space: nowrap;
    }

    .activity-table td {
        padding-left: 38%;
    }

    .activity-table td:first-child {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .activity-location {
        max-width: 58%;
        margin-left: auto;
    }
}

/* ==========================================================================
   Accessible High-Contrast Classes (WCAG 2.1 AA & AAA Compliant)
   ========================================================================== */

.badge-contrast-primary {
    color: #ffffff !important;
    background-color: #084298 !important;
}

.badge-contrast-secondary {
    color: #ffffff !important;
    background-color: #495057 !important;
}

.badge-contrast-success {
    color: #ffffff !important;
    background-color: #146c43 !important;
}

.badge-contrast-danger {
    color: #ffffff !important;
    background-color: #b02a37 !important;
}

.badge-contrast-warning {
    color: #ffffff !important;
    background-color: #7a5200 !important;
}

.badge-contrast-info {
    color: #ffffff !important;
    background-color: #0369a1 !important;
}

.badge-contrast-navy {
    color: #ffffff !important;
    background-color: #0b3d82 !important;
}

/* Accessible High-Contrast Badge Overrides (Prevents White-on-White or Low-Contrast Text) */
.badge.bg-primary,
.badge-primary {
    background-color: #0b3d82 !important;
    color: #ffffff !important;
}
.badge.bg-primary.bg-opacity-10,
.badge.bg-primary.bg-opacity-20,
.badge.bg-primary-subtle,
.badge-tint-primary {
    background-color: #e0edff !important;
    color: #0b3d82 !important; /* 8.8:1 contrast */
    border: 1px solid #b6d4fe !important;
}

.badge.bg-info,
.badge-info {
    background-color: #0369a1 !important;
    color: #ffffff !important;
}
.badge.bg-info.bg-opacity-10,
.badge.bg-info.bg-opacity-20,
.badge.bg-info-subtle,
.badge-tint-info {
    background-color: #e0f2fe !important;
    color: #0369a1 !important; /* 7.2:1 contrast */
    border: 1px solid #bae6fd !important;
}

.badge.bg-success,
.badge-success {
    background-color: #15803d !important;
    color: #ffffff !important;
}
.badge.bg-success.bg-opacity-10,
.badge.bg-success.bg-opacity-20,
.badge.bg-success-subtle,
.badge-tint-success {
    background-color: #dcfce7 !important;
    color: #15803d !important; /* 5.6:1 contrast */
    border: 1px solid #bbf7d0 !important;
}

.badge.bg-warning,
.badge-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
}
.badge.bg-warning.bg-opacity-10,
.badge.bg-warning.bg-opacity-20,
.badge.bg-warning-subtle,
.badge-tint-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important; /* 6.8:1 contrast */
    border: 1px solid #fde68a !important;
}

.badge.bg-danger,
.badge-danger {
    background-color: #b91c1c !important;
    color: #ffffff !important;
}
.badge.bg-danger.bg-opacity-10,
.badge.bg-danger.bg-opacity-20,
.badge.bg-danger-subtle,
.badge-tint-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important; /* 5.8:1 contrast */
    border: 1px solid #fecaca !important;
}

.badge.bg-secondary,
.badge-secondary {
    background-color: #475569 !important;
    color: #ffffff !important;
}
.badge.bg-secondary.bg-opacity-10,
.badge.bg-secondary.bg-opacity-20,
.badge.bg-secondary-subtle {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

.badge.bg-light {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}
.badge.bg-light.text-primary {
    color: #0b3d82 !important; /* Deep navy text on light badge */
}
.badge.bg-light.text-secondary {
    color: #475569 !important;
}
.badge.bg-light.text-muted {
    color: #596169 !important;
}

/* --------------------------------------------------------------------------
   Training Workload vs Autonomic Readiness 2x2 Matrix Component Styles
   -------------------------------------------------------------------------- */

.matrix-viewport {
    position: relative;
    height: 315px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.matrix-grid-container {
    position: absolute;
    top: 16px;
    left: 56px;
    right: 18px;
    bottom: 38px;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fafafa;
}

/* Quadrant Styles */
.matrix-quadrant {
    position: absolute;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.matrix-q-top-left {
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(14, 165, 233, 0.14) 100%);
    border-right: 1.5px dashed #cbd5e1;
    border-bottom: 1.5px dashed #cbd5e1;
}

.matrix-q-top-right {
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.06) 0%, rgba(22, 163, 74, 0.16) 100%);
    border-bottom: 1.5px dashed #cbd5e1;
}

.matrix-q-bottom-left {
    bottom: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.05) 0%, rgba(100, 116, 139, 0.12) 100%);
    border-right: 1.5px dashed #cbd5e1;
}

.matrix-q-bottom-right {
    bottom: 0;
    right: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.06) 0%, rgba(220, 38, 38, 0.15) 100%);
}

.matrix-quadrant.is-active {
    box-shadow: inset 0 0 0 2px #0b3d82;
    z-index: 2;
}
.matrix-quadrant.is-active::after {
    content: "CURRENT STATE";
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 800;
    font-family: var(--bs-font-monospace);
    color: #0b3d82;
    background: rgba(255, 255, 255, 0.95);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(11, 61, 130, 0.35);
    letter-spacing: 0.5px;
}

/* Quadrant Pill Badges */
.matrix-q-label {
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 4px;
    padding: 3px 8px;
    width: fit-content;
}

/* Axes Labels */
.matrix-axis-y {
    position: absolute;
    top: 16px;
    left: 8px;
    bottom: 38px;
    width: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.7rem;
    font-family: var(--bs-font-monospace);
    color: #475569;
    font-weight: 700;
    padding-right: 4px;
}

.matrix-axis-x {
    position: absolute;
    left: 56px;
    right: 18px;
    bottom: 8px;
    height: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    font-family: var(--bs-font-monospace);
    color: #64748b;
    font-weight: 600;
}
.matrix-axis-x-title {
    font-weight: 700;
    color: #1e293b;
}

/* Precision Athlete Radar Pin */
@keyframes matrixPulseRing {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }
    70% {
        transform: scale(2.4);
        opacity: 0;
    }
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}
.matrix-pin-beacon {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0b3d82;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 61, 130, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.68rem;
    cursor: default;
    transition: left 0.4s ease, bottom 0.4s ease;
}
.matrix-pin-beacon::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(11, 61, 130, 0.5);
    animation: matrixPulseRing 2.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    z-index: -1;
}
.matrix-pin-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff !important;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--bs-font-monospace);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 25;
}
.matrix-pin-tooltip.pin-tip-bottom {
    top: calc(100% + 8px);
    bottom: auto;
}
.matrix-pin-tooltip.pin-tip-right {
    left: 0;
    transform: none;
}
.matrix-pin-tooltip.pin-tip-left {
    left: auto;
    right: 0;
    transform: none;
}
.matrix-pin-tooltip::after {
    content: "";
    position: absolute;
    border: 4px solid transparent;
}
.matrix-pin-tooltip:not(.pin-tip-bottom)::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #0f172a;
}
.matrix-pin-tooltip.pin-tip-bottom::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #0f172a;
}
.matrix-pin-tooltip.pin-tip-right::after {
    left: 12px;
    transform: none;
}
.matrix-pin-tooltip.pin-tip-left::after {
    left: auto;
    right: 12px;
    transform: none;
}

/* Sweet Spot Shaded Load Corridor & Trajectory History Dots */
.matrix-sweet-spot-corridor {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(22, 163, 74, 0.04);
    border-left: 1.5px dashed rgba(22, 163, 74, 0.35);
    border-right: 1.5px dashed rgba(22, 163, 74, 0.35);
    pointer-events: none;
    z-index: 1;
}
.sweet-spot-badge-tag {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    font-weight: 700;
    color: #15803d;
    background: rgba(255, 255, 255, 0.95);
    padding: 1px 6px;
    border-radius: 9999px;
    border: 1px solid rgba(22, 163, 74, 0.3);
    white-space: nowrap;
    letter-spacing: 0.3px;
    z-index: 3;
}
.matrix-trajectory-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #64748b;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    z-index: 12;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
    cursor: pointer;
}
.matrix-trajectory-dot:hover {
    transform: scale(1.6);
    opacity: 1;
    background: #0b3d82;
    z-index: 22;
}

/* Diagnostic & Action Cards in Matrix */
.matrix-action-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.15rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.matrix-meter-bar {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}
.matrix-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* High-Contrast WCAG 2.1 AA Overrides for Enhanced Readability */
.running-hero-section .text-white-50,
.hero-card-dark .text-white-50,
.training-hero-entrance .text-white-50,
.recovery-hero-entrance .text-white-50 {
    color: rgba(255, 255, 255, 0.88) !important;
}

.text-hero-muted {
    color: rgba(255, 255, 255, 0.88) !important;
}

.text-hero-subtle {
    color: rgba(255, 255, 255, 0.78) !important;
}

/* Hero Entrance Badges & Metric Cards (WCAG AAA Contrast on Dark Blue / Navy Gradients) */
.hero-badge-lead {
    background-color: #ffffff !important;
    color: #0b3d82 !important; /* Rich deep navy on white: 11.2:1 contrast */
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.85rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    border: 1px solid #ffffff !important;
    display: inline-flex;
    align-items: center;
}
.hero-badge-lead i {
    font-size: 0.85rem;
}

.hero-badge-pill {
    background: rgba(13, 35, 58, 0.88) !important; /* Deep dark backdrop */
    color: #ffffff !important; /* 15.5:1 contrast */
    font-weight: 600 !important;
    font-size: 0.76rem !important;
    padding: 0.38rem 0.8rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important; /* Crisp high-definition outline */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
    display: inline-flex;
    align-items: center;
    backdrop-filter: blur(8px);
}
.hero-badge-pill i.badge-icon-success,
.hero-badge-pill i.text-success {
    color: #4ade80 !important; /* Bright accessible mint green on dark */
}
.hero-badge-pill i.badge-icon-info,
.hero-badge-pill i.text-info {
    color: #38bdf8 !important; /* Bright accessible sky blue on dark */
}
.hero-badge-pill i.badge-icon-warning,
.hero-badge-pill i.text-warning {
    color: #fcd34d !important; /* Bright accessible gold on dark */
}
.hero-badge-pill i.badge-icon-calendar {
    color: #93c5fd !important; /* Light blue on dark */
}

.hero-metric-box {
    background: rgba(10, 27, 47, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 0.75rem !important;
    padding: 0.9rem 1.15rem !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}
.hero-metric-label {
    color: #e2e8f0 !important; /* Light slate - 9:1 contrast */
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-metric-subtext {
    color: #cbd5e1 !important; /* 8:1 contrast */
    font-size: 0.74rem;
}

/* Accessible Text Color Adjustments for Light Backgrounds */
.text-danger {
    color: #b02a37 !important; /* 5.2:1 on #fff */
}

.text-warning {
    color: #856404 !important; /* 5.3:1 on #fff */
}

.text-success {
    color: #0f6848 !important; /* 4.6:1 on #fff */
}

.text-muted {
    color: #596169 !important; /* 5.8:1 on #fff */
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===================================================================
   Modern Running UX & Interaction Enhancements
   =================================================================== */

/* Floating Scroll to Top Button */
#scrollToTop {
    display: none !important;
}
.scroll-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2868b8;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(40, 104, 184, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
}
.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top-btn:hover {
    background: #1c4d8c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(40, 104, 184, 0.5);
}
.scroll-to-top-btn:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 2px;
}

/* Activity Filter Toolbar */
.activity-filter-toolbar {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    transition: box-shadow var(--transition-speed-fast) ease;
}
.activity-filter-toolbar:hover {
    box-shadow: var(--box-shadow-sm);
}

.search-input-styled {
    border-radius: 999px !important;
    padding-left: 2.6rem !important;
    padding-right: 2.5rem !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    font-size: 0.92rem;
}
.search-input-styled:focus {
    background-color: #ffffff;
    border-color: #2868b8 !important;
    box-shadow: 0 0 0 0.25rem rgba(40, 104, 184, 0.15) !important;
}

/* Active Filter Chips */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: #eef4fc;
    color: #2868b8;
    border: 1px solid #c7dcfa;
    border-radius: 999px;
    transition: all 0.15s ease;
}
.active-filter-chip:hover {
    background: #e2edfb;
    border-color: #b2cefa;
}
.active-filter-chip button.chip-remove {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #2868b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.15s ease;
}
.active-filter-chip button.chip-remove:hover {
    color: #dc3545;
}

/* Clickable Table Rows with Micro-Interactions */
.activity-table tbody tr.activity-table-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.activity-table tbody tr.activity-table-row:hover {
    background-color: #f1f6fd !important;
}
.activity-table tbody tr.activity-table-row td a.link-dark:hover {
    color: #2868b8 !important;
}

/* Integrated Page & Detail Sticky Quick Nav */
.page-quick-nav-container {
    position: sticky;
    top: 53px;
    z-index: 70;
    margin-top: -0.25rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    background: transparent;
}
.page-quick-nav,
.detail-quick-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.page-quick-nav::-webkit-scrollbar,
.detail-quick-nav::-webkit-scrollbar {
    display: none;
}
.quick-nav-lead {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0 0.5rem;
    white-space: nowrap;
    user-select: none;
}
.quick-nav-pill,
.detail-nav-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    line-height: 1.35;
}
.quick-nav-pill:hover,
.detail-nav-pill:hover {
    color: #2868b8;
    background: #eef4fc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(40, 104, 184, 0.1);
}
.quick-nav-pill.active,
.detail-nav-pill.active {
    background: #2868b8 !important;
    border-color: #2868b8 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(40, 104, 184, 0.35);
}
.quick-nav-pill:focus-visible,
.detail-nav-pill:focus-visible {
    outline: 2px solid #2868b8;
    outline-offset: 2px;
}
#stats-overview,
#stats-milestones,
#stats-fitness,
#stats-trends,
#stats-volume,
#section-overview,
#section-map,
#section-charts,
#section-efforts,
#section-splits,
#section-analysis {
    scroll-margin-top: 115px;
}

/* Mile Splits Pace Delta Badges */
.split-pace-delta {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.35rem;
    font-family: monospace;
    letter-spacing: -0.02em;
}
.split-pace-delta--faster {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #a3cfbb;
}
.split-pace-delta--slower {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
}
.split-pace-delta--even {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* Smooth Horizontal Mobile Sub-Nav */
@media (max-width: 767.98px) {
    .app-sub-nav .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .app-sub-nav .d-flex {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
    }
    .app-sub-nav .d-flex::-webkit-scrollbar {
        display: none;
    }
    .page-quick-nav,
    .detail-quick-nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .page-quick-nav::-webkit-scrollbar,
    .detail-quick-nav::-webkit-scrollbar {
        display: none;
    }
    .page-quick-nav .quick-nav-pill,
    .detail-quick-nav .detail-nav-pill {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media print {
    header, footer, nav, .app-sub-nav, .skip-link, .btn, .btn-group, #raceSelectorForm, .modal {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt !important;
    }
    .running-app-container, .main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .table {
        width: 100% !important;
        font-size: 9pt !important;
    }
    .badge {
        border: 1px solid #666 !important;
        color: #000 !important;
        background: transparent !important;
    }
}

