@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-0: #f6f3e8;
    --bg-1: #fffdf6;
    --ink-0: #15261c;
    --ink-1: #335445;
    --accent-0: #2d6a4f;
    --accent-1: #d97706;
    --line-soft: rgba(21, 38, 28, 0.12);
    --line-strong: rgba(21, 38, 28, 0.22);
    --panel-cream: #fcfaf2;
    --shadow-soft: 0 18px 44px rgba(21, 38, 28, 0.08);
    --radius-lg: 18px;
    --radius-md: 14px;
}

.dashboard-shell {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(circle at 6% 8%, rgba(217, 119, 6, 0.14), transparent 35%),
        radial-gradient(circle at 88% 15%, rgba(45, 106, 79, 0.18), transparent 32%),
        linear-gradient(165deg, var(--bg-0), var(--bg-1));
    overflow: hidden;
    padding-bottom: 24px;
}

.hero-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(0.3px);
    pointer-events: none;
}

.hero-orb-left {
    width: 220px;
    height: 220px;
    top: -70px;
    left: -95px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.28), rgba(217, 119, 6, 0));
}

.hero-orb-right {
    width: 280px;
    height: 280px;
    top: -95px;
    right: -130px;
    background: radial-gradient(circle, rgba(45, 106, 79, 0.25), rgba(45, 106, 79, 0));
}

.hero-card {
    position: relative;
    z-index: 2;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px 26px;
    animation: reveal 560ms ease-out;
}

.eyebrow {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.73rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent-1);
    margin-bottom: 8px;
    font-weight: 700;
}

.dashboard-title {
    font-family: "Fraunces", serif;
    font-size: clamp(1.7rem, 3.1vw, 2.6rem);
    color: var(--ink-0);
    line-height: 1.13;
    margin: 0 0 8px;
}

.dashboard-subtitle {
    color: var(--ink-1);
    max-width: 72ch;
    margin: 0;
    font-size: 0.98rem;
    font-family: "Space Grotesk", sans-serif;
}

.kpi-card,
.filter-card,
.viz-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
}

.kpi-card {
    padding: 14px 16px;
    animation: lift-in 500ms ease-out;
}

.kpi-title {
    font-size: 0.8rem;
    color: var(--ink-1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: "Space Grotesk", sans-serif;
}

.kpi-value {
    font-family: "Fraunces", serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--ink-0);
}

.kpi-subtitle {
    margin-top: 6px;
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink-1);
    font-size: 0.82rem;
}

.filter-card {
    height: 100%;
    padding: 18px 16px;
    animation: reveal 620ms ease-out;
}

.sidebar-filter-card {
    position: sticky;
    top: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 234, 0.95));
}

.top-filter-card {
    padding: 20px 20px 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 234, 0.92));
}

.filter-grid {
    align-items: end;
}

.filter-grid > div {
    background: var(--panel-cream);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px 12px 12px;
    min-height: 104px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.filter-grid > div:hover {
    border-color: var(--line-strong);
    box-shadow: 0 10px 24px rgba(21, 38, 28, 0.08);
    transform: translateY(-1px);
}

.panel-title {
    font-family: "Fraunces", serif;
    font-size: 1.18rem;
    color: var(--ink-0);
    margin-bottom: 12px;
}

.bike-toggle-wrap {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
}

.bike-toggle .form-check-label {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    color: var(--ink-0);
}

.bike-toggle .form-check-input {
    cursor: pointer;
}

.control-label {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink-1);
    margin-top: 2px;
    margin-bottom: 10px;
}

.custom-dropdown .Select-control,
.custom-dropdown .Select-menu-outer,
.custom-dropdown .Select-menu {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
}

.custom-dropdown .Select-control {
    min-height: 42px;
    background: #fff;
    box-shadow: none;
}

.custom-dropdown .Select-placeholder,
.custom-dropdown .Select-value-label,
.custom-dropdown .Select-input > input {
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink-0);
}

.custom-dropdown.is-focused .Select-control,
.custom-dropdown .Select-control:hover {
    border-color: var(--accent-0);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.clear-btn {
    background: linear-gradient(135deg, #315d49, #264737);
    color: #fff;
    border: none;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 12px;
}

.filter-clear-btn {
    min-height: 48px;
    margin-top: auto;
}

#year-range-slider,
#hour-range-slider {
    margin-top: 2px;
}

.sidebar-filter-card .custom-dropdown {
    margin-bottom: 0;
}

#year-range-slider .rc-slider-rail,
#hour-range-slider .rc-slider-rail,
#filter-year-range .rc-slider-rail,
#filter-hour-range .rc-slider-rail {
    height: 7px;
    border-radius: 99px;
    background: #dfe7df;
}

#year-range-slider .rc-slider-track,
#hour-range-slider .rc-slider-track,
#filter-year-range .rc-slider-track,
#filter-hour-range .rc-slider-track {
    height: 7px;
    border-radius: 99px;
    background: linear-gradient(90deg, #2d6a4f, #4c8e8a);
}

#year-range-slider .rc-slider-handle,
#hour-range-slider .rc-slider-handle,
#filter-year-range .rc-slider-handle,
#filter-hour-range .rc-slider-handle {
    width: 18px;
    height: 18px;
    margin-top: -5px;
    background: #fff;
    border: 3px solid #2d6a4f;
    box-shadow: 0 2px 8px rgba(21, 38, 28, 0.2);
    opacity: 1;
}

#year-range-slider .rc-slider-handle:focus,
#hour-range-slider .rc-slider-handle:focus,
#filter-year-range .rc-slider-handle:focus,
#filter-hour-range .rc-slider-handle:focus {
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.18), 0 2px 8px rgba(21, 38, 28, 0.2);
}

#year-range-slider .rc-slider-mark-text,
#hour-range-slider .rc-slider-mark-text,
#filter-year-range .rc-slider-mark-text,
#filter-hour-range .rc-slider-mark-text {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    color: #476959;
}

.clear-btn:hover,
.clear-btn:focus {
    background: linear-gradient(135deg, #386a53, #2c5140);
    color: #fff;
}

.viz-card {
    padding: 8px 8px 2px;
    animation: reveal 700ms ease-out;
}

.map-mode-note {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--ink-1);
    padding: 4px 8px 8px;
}

.map-card .modebar {
    right: 10px !important;
    top: 10px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--line-soft) !important;
    border-radius: 10px !important;
    padding: 4px !important;
    box-shadow: 0 10px 18px rgba(21, 38, 28, 0.12) !important;
}

.map-card .modebar-btn {
    border-radius: 7px !important;
}

.map-card .modebar-btn:hover {
    background: rgba(45, 106, 79, 0.12) !important;
}

.map-card {
    min-height: 800px;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lift-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991.98px) {
    .dashboard-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .kpi-value {
        font-size: 1.65rem;
    }

    .map-card {
        min-height: auto;
    }

    .filter-clear-btn {
        min-height: 40px;
    }

    .filter-grid > div {
        min-height: auto;
    }

    .sidebar-filter-card {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .hero-card {
        padding: 18px;
    }

    .dashboard-title {
        font-size: 1.55rem;
    }

    .kpi-card,
    .filter-card,
    .viz-card {
        border-radius: 12px;
    }
}

.app-root {
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(circle at 5% 10%, rgba(45, 106, 79, 0.12), transparent 28%),
        radial-gradient(circle at 90% 15%, rgba(217, 119, 6, 0.12), transparent 26%),
        linear-gradient(170deg, #f6f3e8, #fffdf6);
}

.app-title {
    font-family: "Fraunces", serif;
    color: #15261c;
    margin-bottom: 4px;
}

.app-subtitle {
    font-family: "Space Grotesk", sans-serif;
    color: #335445;
    margin-bottom: 16px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.kpi-trend {
    font-family: "Fraunces", serif;
    font-weight: 600;
}

.kpi-trend-up {
    color: #B95A4A;
}

.kpi-trend-down {
    color: #2D6A4F;
}

.kpi-trend-flat {
    color: var(--ink-1);
}

@media (max-width: 1100px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

.shell {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    gap: 16px;
    align-items: start;
}

.sidebar,
.panel,
.chart-card {
    border: 1px solid rgba(21, 38, 28, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 34px rgba(21, 38, 28, 0.08);
}

.sidebar {
    padding: 16px;
    position: sticky;
    top: 12px;
}

.bike-only-wrap {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(45, 106, 79, 0.28);
    border-radius: 10px;
    background: rgba(45, 106, 79, 0.07);
}

.bike-only-toggle label {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #15261c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.bike-only-toggle input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #2d6a4f;
    cursor: pointer;
}

.filter-details {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(45, 106, 79, 0.25);
}

.filter-section-summary {
    cursor: pointer;
    list-style: none;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: #5b7869;
    padding: 2px 0 6px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-section-summary::-webkit-details-marker {
    display: none;
}

.filter-section-summary::before {
    content: "+";
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 12px;
    text-align: center;
    border: 1px solid rgba(45, 106, 79, 0.45);
    border-radius: 4px;
    font-size: 0.9rem;
    color: #2d6a4f;
    font-weight: 700;
}

.filter-details[open] .filter-section-summary::before {
    content: "–";
}

.checklist-stack label,
.checklist-stack input {
    cursor: pointer;
}

.checklist-stack input[type="checkbox"] {
    margin-right: 4px;
    accent-color: #2d6a4f;
}

.severity-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.severity-checklist label {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    margin: 0;
    padding: 2px 4px;
}

.sidebar .control-label {
    display: block;
    margin-top: 14px;
    margin-bottom: 8px;
}

.content-area {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.chart-stack {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
}

.chart-stack .chart-panel {
    height: auto;
    min-height: 0;
    max-height: none;
}

.panel {
    padding: 12px;
}

.map-mode-label,
.map-hover-label {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.84rem;
    color: #335445;
}

.map-hover-label {
    margin-top: 8px;
}

.checklist-stack label {
    display: block;
    margin-bottom: 4px;
    font-family: "Space Grotesk", sans-serif;
}

.clear-button {
    margin-top: 12px;
    width: 100%;
    border: 0;
    background: linear-gradient(135deg, #315d49, #264737);
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.chart-panel {
    height: 340px;
    min-height: 340px;
    max-height: 340px;
    overflow: hidden;
    border: 1px solid rgba(21, 38, 28, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 34px rgba(21, 38, 28, 0.08);
}

.chart-card {
    height: 100%;
}

.chart-panel .js-plotly-plot,
.chart-panel .plot-container,
.chart-panel .svg-container {
    height: 100% !important;
}

@media (max-width: 1280px) {
    .content-area {
        grid-template-columns: 1fr;
    }

    .chart-stack {
        grid-template-rows: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-stack .chart-panel {
        min-height: 320px;
    }
}

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

    .sidebar {
        position: static;
    }

    .chart-stack {
        grid-template-columns: 1fr;
    }
}
