/* iRacing Dashboard Custom Dark Sports Theme */
:root {
    --ir-bg-main: #0b0f17;
    --ir-card-bg: #121924;
    --ir-card-border: #1e293b;
    --ir-header-bg: #16202e;
    --ir-blue: #00b4d8;
    --ir-cyan: #38bdf8;
    --ir-green: #22c55e;
    --ir-red: #ef4444;
    --ir-yellow: #facc15;
    --ir-orange: #f97316;
    --ir-gray-label: #94a3b8;
    --ir-row-odd: #101722;
    --ir-row-even: #131c28;
    --ir-row-hover: #1b2636;
}

body.ir-body {
    background-color: var(--ir-bg-main);
    color: #f1f5f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.dashboard-wrapper {
    max-width: 1720px;
    margin: 0 auto;
}

/* Header bar (Fixo / Sticky) */
.ir-top-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(15, 21, 32, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #1a2536;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.ir-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ir-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #1e3a8a, #dc2626);
    border-radius: 4px;
    font-weight: 800;
    font-style: italic;
    color: #fff;
    font-size: 16px;
    letter-spacing: -1px;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.ir-title-text {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.ir-title-sub {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 400;
}

.ir-btn-action {
    background: #131d2b;
    border: 1px solid #2d3e56;
    color: #e2e8f0;
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ir-btn-action:hover {
    background: #1e2c40;
    border-color: var(--ir-cyan);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.ir-btn-sync {
    border-color: #0284c7;
    color: #38bdf8;
}

.ir-btn-sync:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(2, 132, 199, 0.4);
}

/* Loading animation for Sync Buttons */
.ir-btn-sync.is-loading,
.btn.js-sync-btn.is-loading,
.btn-sync-loading {
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.9 !important;
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.5) !important;
    animation: ir-pulse-glow 1.4s ease-in-out infinite !important;
    transition: all 0.25s ease-in-out;
}

.ir-btn-sync.is-loading .sync-icon,
.btn.js-sync-btn.is-loading .sync-icon,
.btn-sync-loading .sync-icon,
.ir-spin {
    display: inline-block !important;
    animation: ir-spin-fast 0.85s linear infinite !important;
}

@keyframes ir-spin-fast {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes ir-pulse-glow {
    0% {
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
        border-color: #0284c7;
    }
    50% {
        box-shadow: 0 0 20px rgba(56, 189, 248, 0.75);
        border-color: #38bdf8;
    }
    100% {
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
        border-color: #0284c7;
    }
}

/* Category & Season Bar */
.category-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-pill {
    background: #111823;
    border: 1px solid #223043;
    color: #94a3b8;
    padding: 6px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.tab-pill:hover {
    background: #182333;
    color: #ffffff;
    border-color: #38bdf8;
}

.tab-pill.active {
    background: #142438;
    border: 1px solid #0284c7;
    color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.season-info-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
}

.season-sync-btn {
    background: #111823;
    border: 1px solid #0284c7;
    color: #38bdf8;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.season-sync-btn:hover,
.season-sync-btn:focus {
    background: #0c2b42;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.season-select-btn {
    background: #111823;
    border: 1px solid #2b394e;
    color: #e2e8f0;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.season-select-btn:hover,
.season-select-btn:focus,
.season-select-btn[aria-expanded="true"] {
    background: #182538;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.season-goals-btn {
    background: #111823;
    border: 1px solid #d97706;
    color: #fbbf24;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.season-goals-btn:hover,
.season-goals-btn:focus {
    background: #251b08;
    border-color: #f59e0b;
    color: #fef08a;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.season-tag {
    color: var(--ir-yellow);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.rollover-tag {
    color: var(--ir-yellow);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* KPI Cards */
.ir-kpi-card {
    background: var(--ir-card-bg);
    border: 1px solid var(--ir-card-border);
    border-radius: 8px;
    padding: 14px 18px;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ir-card-header-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #e2e8f0;
    border-bottom: 1px solid #1a2536;
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Typography for stats */
.metric-label {
    font-size: 0.82rem;
    color: var(--ir-gray-label);
    margin-bottom: 2px;
}

.metric-value-huge-blue {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: var(--ir-cyan);
    line-height: 1.1;
}

.metric-value-huge-white {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.metric-value-huge-green {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--ir-green);
    line-height: 1.1;
}

.metric-value-huge-red {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--ir-red);
    line-height: 1.1;
}

.metric-value-huge-yellow {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--ir-yellow);
    line-height: 1.1;
}

/* Pill rows for Averages Card */
.avg-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.avg-label {
    font-size: 0.95rem;
    color: #cbd5e1;
    font-weight: 500;
}

.avg-pill {
    padding: 4px 14px;
    border-radius: 4px;
    font-family: 'Chakra Petch', 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
}

.avg-pill-sof {
    background: #11364f;
    color: var(--ir-cyan);
    border: 1px solid #1a5175;
}

.avg-pill-gain {
    background: #143823;
    color: var(--ir-green);
    border: 1px solid #1e5e38;
}

.avg-pill-loss {
    background: #471b1e;
    color: var(--ir-red);
    border: 1px solid #6b252a;
}

.avg-pill-neutral {
    background: #1e2838;
    color: #ffffff;
    border: 1px solid #2d3b50;
}

.avg-pill-ir-delta {
    background: #471b1e;
    color: var(--ir-red);
    border: 1px solid #6b252a;
}

.avg-pill-sr-delta {
    background: #471b1e;
    color: var(--ir-red);
    border: 1px solid #6b252a;
}

.avg-pill-pos {
    background: #1e2838;
    color: #ffffff;
    border: 1px solid #2d3b50;
}

/* Regra Média Posição:
   p1 a p7 = fundo verde
   p8 a p16 = fundo amarelo
   p17 pra cima = fundo vermelho */
.avg-pill-pos-green {
    background: #143823;
    color: var(--ir-green);
    border: 1px solid #1e5e38;
}

.avg-pill-pos-yellow {
    background: #4a3800;
    color: var(--ir-yellow);
    border: 1px solid #855f00;
}

.avg-pill-pos-red {
    background: #471b1e;
    color: var(--ir-red);
    border: 1px solid #6b252a;
}

/* Section Box / Tables */
.ir-section-box {
    background: var(--ir-card-bg);
    border: 1px solid var(--ir-card-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ir-section-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-bottom: 12px;
}

/* Dark Spreadsheet Table */
.ir-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ir-table th {
    background: #162130;
    color: #94a3b8;
    font-weight: 600;
    padding: 9px 12px;
    text-align: left;
    border-top: 1px solid #202d40;
    border-bottom: 1px solid #202d40;
}

.ir-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #182230;
    vertical-align: middle;
}

.ir-table tbody tr:nth-child(odd) {
    background-color: var(--ir-row-odd);
}

.ir-table tbody tr:nth-child(even) {
    background-color: var(--ir-row-even);
}

.ir-table tbody tr:hover {
    background-color: var(--ir-row-hover);
}

.text-gain {
    color: var(--ir-green) !important;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.text-loss {
    color: var(--ir-red) !important;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.text-neutral {
    color: #ffffff !important;
    font-family: 'JetBrains Mono', monospace;
}

.link-race {
    color: var(--ir-cyan);
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.15s ease;
    display: inline-block;
}

.link-race:hover {
    transform: scale(1.2);
    color: #ffffff;
}

/* Status in Weekly Table */
.status-success {
    color: var(--ir-green);
    font-weight: 600;
}

.status-positive {
    color: var(--ir-green);
    font-weight: 600;
}

.status-danger {
    color: var(--ir-red);
    font-weight: 600;
}

.status-open {
    color: #ffffff;
    font-size: 0.85rem;
}

/* Weekly Table Status Icons & Badges */
.weekly-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    vertical-align: middle;
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.weekly-status-badge:hover,
.weekly-status-x:hover {
    transform: scale(1.15);
}

.weekly-status-checked {
    background-color: var(--ir-green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

.weekly-status-plus {
    background-color: var(--ir-green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

.weekly-status-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ir-red);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    cursor: default;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
    transition: transform 0.15s ease;
}

/* Benchmark Badges */
.badge-excellent {
    background-color: #1e3a8a; /* Azul escuro */
    color: #ffffff !important;   /* Letras brancas */
    border: 1px solid #3b82f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 0 10px rgba(30, 58, 138, 0.6);
}

.badge-great {
    background: #14532d;
    color: #86efac;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-good {
    background: #1e3a8a;
    color: #93c5fd;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-regular {
    background: #713f12;
    color: #fde047;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-bad {
    background: #7f1d1d;
    color: #fca5a5;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-current {
    background: #0369a1;
    color: #e0f2fe;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Benchmark Table Sorting and Row Interactivity */
.benchmark-th-sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.benchmark-th-sortable:hover {
    color: #ffffff !important;
    background-color: #1a293e !important;
}

.benchmark-th-sortable .sort-icon {
    font-size: 0.72rem;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.benchmark-th-sortable:hover .sort-icon {
    opacity: 1;
    color: #ffffff !important;
}

.benchmark-th-sortable.sorted-asc,
.benchmark-th-sortable.sorted-desc {
    color: var(--ir-cyan) !important;
}

.benchmark-th-sortable.sorted-asc .sort-icon,
.benchmark-th-sortable.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--ir-cyan) !important;
}

.benchmark-clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.benchmark-clickable-row:hover {
    background-color: rgba(56, 189, 248, 0.12) !important;
}

.benchmark-season-link {
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.15s ease;
}

.benchmark-clickable-row:hover .benchmark-season-link {
    color: var(--ir-cyan) !important;
}

#seasonBenchmarksTable th,
#seasonBenchmarksTable td {
    white-space: nowrap;
    vertical-align: middle;
}

#seasonBenchmarksTable .badge-great,
#seasonBenchmarksTable .badge-good,
#seasonBenchmarksTable .badge-regular,
#seasonBenchmarksTable .badge-bad,
#seasonBenchmarksTable .badge-current,
#seasonBenchmarksTable .badge-excellent {
    display: inline-block;
    white-space: nowrap;
}

/* Modals */
.modal-content {
    background-color: #121924;
    border: 1px solid #223043;
    color: #f8fafc;
}

.modal-header, .modal-footer {
    border-color: #1e293b;
}

.form-control, .form-select {
    background-color: #0b0f17;
    border: 1px solid #223043;
    color: #f8fafc;
}

.form-control:focus, .form-select:focus {
    background-color: #0e141e;
    border-color: var(--ir-cyan);
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
}

/* iRacing Official Portal Cards: Participation Credits & MPR */
.ir-portal-card {
    background: #141c2b;
    border: 1px solid #1e2d42;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ir-portal-header {
    background: #1a2538;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #23354d;
}

.ir-portal-header-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.ir-btn-learn-more {
    background: #0f766e;
    color: #ccfbf1;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ir-btn-learn-more:hover {
    background: #14b8a6;
    color: #ffffff;
}

.ir-portal-body {
    padding: 14px 16px;
}

.ir-portal-group-header {
    background: #243248;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 6px;
}

.ir-portal-group-header:first-child {
    margin-top: 0;
}

.ir-portal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    font-size: 0.86rem;
    border-bottom: 1px solid #1a2638;
}

.ir-portal-row:last-child {
    border-bottom: none;
}

.ir-portal-row:hover {
    background: #192336;
}

.mpr-block {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #1c2a3e;
}

.mpr-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.mpr-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.mpr-pill-class-a {
    background: rgba(14, 116, 244, 0.18);
    color: #60a5fa;
    border: 1px solid #2563eb;
}

.mpr-pill-class-b {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid #16a34a;
}

.mpr-pill-rookie {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid #dc2626;
}

.mpr-msg-success {
    color: #4ade80;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
}

.mpr-msg-danger {
    color: #f87171;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
}

.mpr-sub-info {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 2px;
}

/* ==========================================================================
   Mobile & Responsive Layout Optimizations
   ========================================================================== */

/* Tablet & Mobile Screens (<= 991px) */
@media (max-width: 991px) {
    .dashboard-wrapper main {
        padding: 8px 12px;
    }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .ir-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }

    .ir-logo-title {
        justify-content: flex-start;
    }

    .ir-title-text {
        font-size: 1.1rem;
    }

    .ir-top-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .category-nav-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-bottom: 2px;
        scrollbar-width: thin;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }

    .category-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .category-tabs::-webkit-scrollbar-thumb {
        background: #2b394e;
        border-radius: 4px;
    }

    .tab-pill {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .season-info-bar {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .season-select-btn {
        font-size: 0.85rem;
        padding: 6px 10px;
        max-width: calc(100% - 90px);
    }

    .season-select-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .season-goals-btn {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .rollover-tag {
        font-size: 0.8rem;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .ir-table {
        min-width: 580px;
    }
}

/* Extra Small Mobile Devices (e.g. iPhone SE, 375px - 576px) */
@media (max-width: 576px) {
    body.ir-body {
        font-size: 0.88rem;
    }

    .dashboard-wrapper main {
        padding: 4px 6px !important;
    }

    .ir-kpi-card {
        padding: 12px 14px;
    }

    .ir-card-header-title {
        font-size: 0.82rem;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .metric-value-huge-blue,
    .metric-value-huge-white,
    .metric-value-huge-green,
    .metric-value-huge-red,
    .metric-value-huge-yellow {
        font-size: 1.6rem !important;
    }

    .metric-label {
        font-size: 0.74rem;
    }

    .ir-kpi-card .col-3 [style*="font-size: 1.35rem"],
    .ir-kpi-card .metric-value-huge-white[style*="font-size: 1.35rem"],
    .ir-kpi-card .metric-value-huge-green[style*="font-size: 1.35rem"],
    .ir-kpi-card .metric-value-huge-red[style*="font-size: 1.35rem"] {
        font-size: 1.05rem !important;
    }

    .ir-portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ir-portal-row {
        font-size: 0.82rem;
        padding: 6px 10px;
    }

    .ir-portal-group-header {
        font-size: 0.82rem;
        padding: 6px 10px;
    }

    .avg-label {
        font-size: 0.85rem;
    }

    .avg-value-pill {
        font-size: 0.82rem;
        padding: 2px 10px;
    }

    .modal-dialog {
        margin: 0.35rem;
    }

    .modal-content {
        border-radius: 8px;
    }

    #goalsCategoryTabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    #goalsCategoryTabs .nav-link {
        white-space: nowrap;
        font-size: 0.78rem !important;
        padding: 5px 12px !important;
    }
}

/* ========================================================
   Filtros da Listagem de Corridas (Histórico de Corridas)
   ======================================================== */
.race-filter-bar {
    background: #0d1522;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease;
}

.race-filter-bar:hover {
    border-color: #2e3e55;
}

.filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 3px;
    display: block;
    letter-spacing: 0.5px;
}

.ir-filter-select {
    background-color: #121c2d;
    border: 1px solid #243447;
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 500;
    border-radius: 5px;
    padding: 4px 22px 4px 8px;
    width: 100%;
    transition: all 0.2s ease;
    cursor: pointer;
    background-position: right 6px center;
}

.ir-filter-select:focus {
    background-color: #16243a;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
    color: #ffffff;
    outline: none;
}

.ir-filter-select option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 6px;
}

.ir-filter-select.is-active {
    border-color: #38bdf8;
    background-color: #0c2b4a;
    color: #38bdf8;
    font-weight: 600;
}

.btn-filter-clear {
    background: #162234;
    border: 1px solid #2a3a50;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-filter-clear:hover {
    background: #1e2e46;
    border-color: #38bdf8;
    color: #f1f5f9;
}

.btn-filter-clear:active {
    transform: scale(0.97);
}
