.insights-handle,
.insights-handle:hover,
.insights-handle:focus,
.insights-handle:active {
    background: #050505;
    color: #fff;
}
.map-wrapper {
    height: 93vh;
    position: relative;
}

.map-wrapper--form {
    height: 50vh;
    min-height: 240px;
}
.body {
    height: 100%;
}
.dropdown-content li span:hover {
    background-color: #f1f1f1;
    color: rgb(61, 61, 61);
}
.dropdown-content li a:hover {
    background-color: #f1f1f1;
    color: rgb(61, 61, 61);
}
.dropdown-content li>a, .dropdown-content li>span {
    color: rgb(194, 194, 194);
}

.dropdown-content {
    background-color: #030202;
    padding: 10px 0 15px 15px;
}

.dropdown-content li > a  {
    color: #cfcfcf;
}

:root {
    --insights-width: min(340px, 85vw);
    --insights-slide-duration: 320ms;
    --insights-slide-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.insights-sidenav {
    background: #0c0c0c;
    color: #f4f4f4;
    width: var(--insights-width);
    padding-bottom: 2rem;
    box-shadow: -12px 0 35px rgba(0, 0, 0, 0.45);
    position: fixed;
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    transform: translateX(calc(100% + 1.5rem));
    transition: transform var(--insights-slide-duration) var(--insights-slide-ease);
    z-index: 1400;
}

.sidenav li>a {
    color: #f4f4f4d5;
}

.insights-handle {
    position: fixed;
    right: 0.5rem;
    top: 50vh;
    transform: translateY(-50%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    z-index: 1500;
    padding: 0 1rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
    transition: right var(--insights-slide-duration) var(--insights-slide-ease);
}

body.insights-open .insights-handle {
    right: calc(var(--insights-width) - 2rem);
}

.map-info-fab ul li {
    margin-bottom: 0.5rem;
}

/* Keep handle indicator simple */
.insights-handle i {
    pointer-events: none;
    transform: rotate(180deg);
    transition: transform var(--insights-slide-duration) var(--insights-slide-ease);
}

body.insights-open .insights-handle i {
    transform: rotate(0deg);
}

/* insights styles defined later */

.insights-sidenav .panel-section {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.insights-brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.insights-brand i {
    color: #70a5f5;
}

.brand-title {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.65);
}

.insights-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.insights-brand-logo--desktop {
    margin-left: 1rem;
}

.insights-brand-logo--mobile {
    margin-left: 0.6rem;
}

.section-label {
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    line-height: 1;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: rgba(231, 231, 231, 0.945);
}

.section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.insights-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insights-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    padding: 0.25rem 0.75rem;
    min-width: 36px;
    width: 100%;
    text-align: left;
    gap: 0.5rem;
}

.insights-collapse-toggle:focus-visible {
    outline: 2px solid rgba(230, 255, 75, 0.6);
    outline-offset: 4px;
}

.insights-collapse-icon {
    transition: transform 0.2s ease;
}

.insights-collapse-toggle[aria-expanded="true"] .insights-collapse-icon {
    transform: rotate(180deg);
}

.insights-collapse {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        max-height 240ms var(--insights-slide-ease),
        opacity 200ms ease,
        transform 200ms ease,
        padding 200ms ease;
}

.insights-collapse.is-open {
    max-height: 960px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 0.35rem;
}

.panel-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: none;
    background: transparent;
}

.panel-link-list.is-open {
    padding-bottom: 0.1rem;
}

.panel-link-list.collection {
    border: none;
    background: transparent;
    box-shadow: none;
}

.panel-link-list.collection .collection-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0;
}

.panel-link-list.collection .collection-item:last-child {
    border-bottom: none;
}

.insights-nav-link a {
    display: block;
    padding: 0.6rem 0.9rem;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 160ms ease, color 160ms ease;
    border-radius: 6px;
}

.insights-nav-link a:hover,
.insights-nav-link a:focus {
    background: rgba(255, 255, 255, 0.08);
}

.stats-collapse {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.city-input input {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    width: 100%;
}

.city-input {
    position: relative;
}

.city-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(8, 8, 8, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1000;
}

.city-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #f5f5f5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    letter-spacing: 0.02em;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.city-option:last-child {
    border-bottom: none;
}

.city-option:hover,
.city-option:focus {
    background: rgba(230, 255, 75, 0.18);
    color: #e6ff4b;
    transform: translateX(2px);
}

.city-option-empty {
    cursor: default;
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
    text-align: center;
}

.city-option-empty:hover,
.city-option-empty:focus {
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    transform: none;
}

.stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin-top: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

.stat-value.accent {
    color: #ff6f00;
}

.insights-sparkline {
    width: 100%;
    height: 54px;
    margin-top: 0.5rem;
}

.insights-sparkline svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sparkline-caption {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.932);
}

.map-status-legend {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
}

.map-status-modal {
    max-width: 420px;
}

.status-legend-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.status-legend-list li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot-green { background: #4caf50; }
.legend-dot-red { background: #f44336; }
.legend-dot-orange { background: #ff9800; }
.legend-dot-grey { background: #9e9e9e; }
}

.helptext {
    color: rgba(56, 84, 139, 0.425);
    font-style: italic;
}

label {
    color: #000;
}

.errorlist {
    color: #cf0000;
}

.table-title {
    font-size: 3em;
}

.select-wrapper input.select-dropdown{
    margin-top: 5px;
    color: rgb(197, 197, 197);
    background-color:rgb(37, 37, 37);

}

#nav-appname {
    font-size: 1.8em;
    padding-top:5px;
    /* margin-bottom:0; */
}

.table-header-row {
    background-color: #f5f5f5;
    padding: 12px 0;
    margin-bottom: 0;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.collapsible-header .col {
    display: flex;
    align-items: center;
}

/* Location type colors (colorblind-friendly palette) */
.location-type-residential { background-color: #0077BB; color: #fff; }
.location-type-transit { background-color: #EE7733; color: #fff; }
.location-type-public { background-color: #009988; color: #fff; }
.location-type-commercial { background-color: #CC3311; color: #fff; }

/* Map legend / filter buttons */
.map-legend {
    position: absolute;
    bottom: 2rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.0);
    padding: 0.6rem;
    /* border-radius: 4px; */
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.2); */
}
.filter-btn { cursor: pointer; width: 100%; text-align: left; }
.filter-btn:not(.active) { opacity: 0.4; }

/* Status report belief state colors */
.status-green { color: #4caf50; }
.status-red { color: #f44336; }
.status-orange { color: #ff9800; }
.status-gray { color: #9e9e9e; }

/* Opacity levels for staleness */
.opacity-100 { opacity: 1.0; }
.opacity-75 { opacity: 0.75; }
.opacity-50 { opacity: 0.5; }
.opacity-25 { opacity: 0.25; }

/* Verification badge */
.verified-badge {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}
.verified-badge.verified { background: #e8f5e9; color: #2e7d32; }
.verified-badge.unverified { background: #fff3e0; color: #e65100; }
.verified-badge.unknown { background: #eeeeee; color: #616161; }

/* Action buttons inside outage table */
.action-button-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: none;
    border: none;
    width: 100%;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.action-btn i {
    margin-right: 6px;
}

.action-btn-report {
    background: #bf360c;
}

.action-btn-validate {
    background: #f57c00;
}

.action-btn-restore {
    background: #2e7d32;
}

.action-btn:hover {
    filter: brightness(1.05);
}

.action-edit-link {
    display: inline-flex;
    margin-top: 8px;
}

.description-prompt {
    font-style: italic;
}

.description-column {
    justify-content: center;
}

.description-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eceff1;
    color: #455a64;
    font-weight: 600;
    text-decoration: none;
}

.description-trigger i {
    font-size: 1.2rem;
}

.description-trigger:hover {
    background: #e0e0e0;
}

.status-history-card {
    margin-bottom: 1.5rem;
}

.status-history {
    background: #fafafa;
    border-radius: 8px;
    padding: 1.1rem;
}

.status-history-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
}

.status-history-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #263238;
}

.status-history-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
}

.status-history-grid {
    display: flex;
    gap: 8px;
}

.status-history-week {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-cell {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: #eceff1;
    display: inline-block;
}

.status-cell.tooltipped {
    cursor: pointer;
}

.status-cell-believed_in {
    background: #7db47f;
}

.status-cell-believed_out {
    background: #f44336;
}

.status-cell-unverified {
    background: #ff9800;
}

.status-cell-no_data {
    background: #cfd8dc;
}

.status-cell-unknown {
    background: #9e9e9e;
}

.status-cell-outage_active {
    background: #d32f2f;
}

.status-cell-outside {
    background: transparent;
}

.status-week-labels {
    display: flex;
    gap: 14px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #607d8b;
}

.status-week-label {
    width: 14px;
    text-align: center;
}


.elevator-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.elevator-edit-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.elevator-edit-row input {
    width: 70px;
    margin: 0;
    padding: 0 5px;
    height: 28px;
}

.elevator-id-input {
    width: 70px;
    margin: 0;
    padding: 0 5px;
    height: 28px;
}

.elevator-description-field textarea {
    min-height: 60px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.status-validation-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 4px;
}

.validation-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 1.0rem;
}

.validation-chip i {
    font-size: 1rem;
}

.validation-chip.down {
    background: #ffebee;
    color: #b71c1c;
}

.validation-chip.up {
    background: #e8f5e9;
    color: #1b5e20;
}

@media (max-width: 600px) {
    :root {
        --insights-width: 92vw;
    }

    .map-wrapper {
        height: 95vh;
        max-height: 96vh;
        overflow: hidden;
    }

    .map-wrapper--form {
        height: 50vh;
    }

    .map-info-fab {
        bottom: 1rem;
        right: 1rem;
    }

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

    .stats-section .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem 1rem;
    }

    .insights-sparkline {
        height: 40px;
    }

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

    .insights-collapse-toggle {
        padding: 0.4rem 0.2rem;
    }

    .panel-link-list {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .map-legend {
        left: 1.5rem;
        right: auto;
        bottom: 2rem;
        top: auto;
        transform: none;
        flex-direction: column;
        flex-wrap: nowrap;
        width: calc(60vw - 1rem);
        max-width: 320px;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-btn {
        flex: 0 0 auto;
        width: 100%;
    }

    .map-status-legend {
        top: auto;
        bottom: 2rem;
        right: 1rem;
    }

    .city-suggestions {
        max-height: 50vh;
    }

    .stats-collapse {
        gap: 0.65rem;
    }

}

/* Folium Map Pin Popup Styles */
.pin-popup {
    font-family: -apple-system, system-ui, sans-serif;
    padding: 1rem;
    width: 280px;
    line-height: 1.5;
}

.pin-popup__header {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.pin-popup__header a {
    color: #000;
    text-decoration: none;
    font-size: 1.5em;
}

.pin-popup__header a:hover {
    text-decoration: underline;
}

.pin-popup__address {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.pin-popup__status-section {
    border-top: 1px solid #ddd;
    padding-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.pin-popup__status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pin-popup__status-count {
    font-size: 1.75rem;
    font-weight: 300;
}

.pin-popup__status-dots {
    display: flex;
    gap: 4px;
}

.pin-popup__status-dot {
    width: 12px;
    height: 12px;
}

.pin-popup__issues {
    border-left: 2px solid;
    padding-left: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: #333;
}

.pin-popup__footer {
    font-size: 0.85rem;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}

/* ===================
   Validation Modal
   =================== */
.validation-modal {
    max-width: 420px;
    max-height: 85vh;
    overflow: visible;
}

.validation-modal .modal-content {
    padding: 1.75rem 2rem 1.25rem;
}

.validation-modal-title {
    margin: 0 0 1rem;
    font-weight: 500;
    font-size: 1.5rem;
    color: #212121;
}

.validation-modal-message-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.validation-modal-icon {
    margin-right: 0.75rem;
    font-size: 1.5rem;
    color: #00b7ff;
}

.validation-modal-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #313131;
    flex: 1;
}

.validation-modal-disclaimer {
    margin: 0;
    padding-left: 1rem;
    border-left: 3px solid #9e9e9e;
    font-size: 0.95rem;
    color: #616161;
    font-style: italic;
}

.validation-modal .modal-footer {
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.validation-modal-cancel {
    margin-right: 1rem;
}

.validation-modal-confirm {
    margin: 0;
}

.validation-modal-confirm-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}
