.blackspot-page {
    background: #f5f7fa;
    color: #172033;
}

.blackspot-heading {
    padding: 40px 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #dfe4ea;
}

.heading-row,
.map-toolbar,
.list-heading,
.spot-card-header,
.spot-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #087443;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.blackspot-heading h1 {
    margin: 0;
    color: #102a43;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0;
}

.blackspot-heading p,
.map-toolbar p,
.list-heading p {
    margin: 8px 0 0;
    color: #627386;
}

.btn-report-spot,
.btn-show-map,
.btn-navigate {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.btn-report-spot {
    flex: 0 0 auto;
    background: #d92d20;
    color: #ffffff;
}

.btn-report-spot:hover {
    background: #b42318;
    color: #ffffff;
    transform: translateY(-1px);
}

.spot-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 28px;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    background: #ffffff;
}

.summary-item {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-right: 1px solid #dfe4ea;
}

.summary-item:last-child {
    border-right: 0;
}

.summary-item > span:last-child {
    min-width: 0;
    color: #627386;
    font-size: 13px;
}

.summary-item strong {
    display: block;
    color: #172033;
    font-size: 25px;
    line-height: 1.1;
}

.summary-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.summary-icon.total { background: #e7f0ff; color: #175cd3; }
.summary-icon.active { background: #fff1f0; color: #d92d20; }
.summary-icon.reports { background: #fff4e5; color: #b54708; }

.map-section {
    padding: 32px 0 0;
}

.map-toolbar,
.list-heading {
    align-items: flex-end;
    margin-bottom: 16px;
}

.map-toolbar h2,
.list-heading h2 {
    margin: 0;
    color: #102a43;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
}

.map-toolbar h2 i {
    margin-right: 8px;
    color: #175cd3;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    color: #48586a;
    font-size: 12px;
    font-weight: 700;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.low { background: #fdb022; }
.legend-dot.medium { background: #f79009; }
.legend-dot.high { background: #d92d20; }

.map-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid #ccd4dd;
    border-radius: 8px;
    background: #e9eef3;
}

.blackspots-map {
    height: 520px;
    min-height: 420px;
}

.map-status {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 500;
    transform: translateX(-50%);
    border: 1px solid #ccd4dd;
    border-radius: 6px;
    padding: 9px 13px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(23, 32, 51, .12);
    color: #48586a;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.map-status.error {
    border-color: #f1b4af;
    color: #b42318;
}

.blackspot-marker-wrap {
    background: transparent;
    border: 0;
}

.blackspot-marker {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffffff;
    border-radius: 50% 50% 50% 8px;
    box-shadow: 0 3px 12px rgba(16, 42, 67, .35);
    color: #172033;
    font-size: 11px;
    font-weight: 800;
    transform: rotate(-45deg);
    transition: transform .2s ease;
}

.blackspot-marker span {
    transform: rotate(45deg);
}

.blackspot-marker.severity-1 { background: #fdb022; }
.blackspot-marker.severity-2 { background: #f79009; color: #ffffff; }
.blackspot-marker.severity-3 { background: #d92d20; color: #ffffff; }
.blackspot-marker.is-selected { transform: rotate(-45deg) scale(1.25); }

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.spot-popup {
    width: 230px;
    color: #172033;
}

.spot-popup h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
}

.spot-popup p {
    margin: 0 0 9px;
    color: #627386;
    line-height: 1.4;
}

.popup-approval {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 9px;
    color: #087443;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.popup-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 10px 0;
    font-size: 12px;
}

.popup-navigate {
    display: block;
    border-radius: 5px;
    padding: 8px 10px;
    background: #175cd3;
    color: #ffffff !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.approved-list {
    padding: 38px 0 56px;
}

.approval-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #087443;
    font-size: 13px;
    font-weight: 800;
}

.blackspot-card {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d9e0e7;
    border-top: 4px solid #fdb022;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(23, 32, 51, .06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.blackspot-card.severity-2 { border-top-color: #f79009; }
.blackspot-card.severity-3 { border-top-color: #d92d20; }

.blackspot-card:hover,
.blackspot-card.is-selected {
    border-color: #175cd3;
    box-shadow: 0 8px 22px rgba(23, 92, 211, .13);
    transform: translateY(-2px);
}

.spot-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f3;
    background: #fafbfc;
}

.severity-label,
.spot-status {
    font-size: 12px;
    font-weight: 800;
}

.severity-label { color: #8a4b08; }
.severity-2 .severity-label { color: #b54708; }
.severity-3 .severity-label { color: #b42318; }
.spot-status { color: #087443; }

.spot-card-body {
    flex: 1 1 auto;
    padding: 18px 16px;
}

.spot-title-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
}

.category-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #e7f0ff;
    color: #175cd3;
}

.spot-title-row h3 {
    margin: 0;
    color: #102a43;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
}

.spot-address {
    margin: 4px 0 0;
    color: #627386;
    font-size: 12px;
    line-height: 1.4;
}

.spot-description {
    display: -webkit-box;
    min-height: 42px;
    margin: 14px 0;
    overflow: hidden;
    color: #48586a;
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.spot-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    background: #f8fafc;
}

.spot-metrics span {
    min-width: 0;
    padding: 9px 5px;
    border-right: 1px solid #e3e8ee;
    color: #627386;
    font-size: 10px;
    text-align: center;
}

.spot-metrics span:last-child { border-right: 0; }

.spot-metrics strong {
    display: block;
    color: #172033;
    font-size: 16px;
}

.verification-details {
    margin: 14px 0 0;
}

.verification-details > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #edf0f3;
    font-size: 12px;
}

.verification-details > div:last-child { border-bottom: 0; }
.verification-details dt { color: #748397; font-weight: 500; }
.verification-details dd { margin: 0; color: #2d3b4f; font-weight: 700; text-align: right; }

.spot-card-actions {
    padding: 12px 16px;
    border-top: 1px solid #edf0f3;
}

.btn-show-map,
.btn-navigate {
    flex: 1 1 0;
    padding: 8px 10px;
    font-size: 12px;
}

.btn-show-map {
    border-color: #b8c4d1;
    background: #ffffff;
    color: #2d3b4f;
}

.btn-show-map:hover {
    border-color: #175cd3;
    color: #175cd3;
}

.btn-navigate {
    background: #175cd3;
    color: #ffffff;
}

.btn-navigate:hover {
    background: #124cae;
    color: #ffffff;
}

.empty-spots {
    padding: 56px 24px;
    border: 1px dashed #b8c4d1;
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
}

.empty-spots > i {
    margin-bottom: 12px;
    color: #748397;
    font-size: 38px;
}

.empty-spots h3 { margin: 0; font-size: 20px; }
.empty-spots p { margin: 8px 0 18px; color: #627386; }

@media (max-width: 991.98px) {
    .spot-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-item:nth-child(2) { border-right: 0; }
    .summary-item:nth-child(-n+2) { border-bottom: 1px solid #dfe4ea; }
}

@media (max-width: 767.98px) {
    .blackspot-heading { padding-top: 26px; }
    .heading-row,
    .map-toolbar,
    .list-heading { align-items: stretch; flex-direction: column; }
    .blackspot-heading h1 { font-size: 27px; }
    .btn-report-spot { width: 100%; }
    .map-legend { justify-content: flex-start; }
    .blackspots-map { height: 430px; min-height: 360px; }
    .map-status { max-width: calc(100% - 24px); white-space: normal; text-align: center; }
}

@media (max-width: 479.98px) {
    .spot-summary { grid-template-columns: 1fr; }
    .summary-item,
    .summary-item:nth-child(2) { border-right: 0; border-bottom: 1px solid #dfe4ea; }
    .summary-item:last-child { border-bottom: 0; }
    .spot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spot-metrics span:nth-child(2) { border-right: 0; }
    .spot-metrics span:nth-child(-n+2) { border-bottom: 1px solid #e3e8ee; }
    .spot-card-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .blackspot-marker,
    .blackspot-card,
    .btn-report-spot { transition: none; }
}

.blackspot-page {
    min-height: 680px;
    background: #f6f8fb;
}

.blackspot-heading {
    box-shadow: 0 4px 18px rgba(16, 43, 78, .035);
}

.spot-summary,
.map-frame,
.blackspot-card {
    box-shadow: 0 8px 24px rgba(16, 43, 78, .055);
}

.btn-report-spot:focus-visible,
.btn-show-map:focus-visible,
.btn-navigate:focus-visible {
    outline: 3px solid rgba(23, 105, 170, .28);
    outline-offset: 3px;
}

/* Public register cards show location safety information only, never citizen identity. */
.spot-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    box-shadow: 0 8px 22px rgba(16, 43, 78, .055);
}

.blackspot-card {
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(16, 43, 78, .065);
}

.blackspot-card:hover,
.blackspot-card.is-selected {
    box-shadow: 0 14px 30px rgba(23, 92, 211, .14);
}

.spot-card-header {
    padding: 14px 17px;
    background: #fbfcfe;
}

.severity-label,
.spot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 5px;
    background: #f4f6f8;
}

.spot-status {
    color: #087443;
    background: #eaf7ef;
}

.spot-public-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 10px 11px;
    border: 1px solid #d9e8f5;
    border-radius: 7px;
    color: #175c92;
    background: #f3f8fd;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.spot-public-note i {
    color: #087443;
}

.spot-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.spot-metrics span:nth-child(odd) {
    border-right: 1px solid #e3e8ee;
}

.spot-metrics span:nth-child(even) {
    border-right: 0;
}

.spot-metrics span:nth-child(-n+2) {
    border-bottom: 1px solid #e3e8ee;
}

.verification-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.verification-details > div {
    display: block;
    padding: 9px 10px;
    border: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
    border-radius: 6px;
    background: #fbfcfd;
}

.verification-details dd {
    margin-top: 3px;
    text-align: left;
}

.spot-card-actions {
    padding: 14px 16px;
    background: #fbfcfe;
}

@media (max-width: 991.98px) {
    .spot-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-item:nth-child(2) {
        border-right: 0;
    }

    .summary-item:nth-child(3) {
        border-top: 1px solid #dfe4ea;
    }
}

@media (max-width: 479.98px) {
    .spot-summary {
        grid-template-columns: 1fr;
    }

    .summary-item,
    .summary-item:nth-child(2),
    .summary-item:nth-child(3) {
        border-right: 0;
        border-bottom: 1px solid #dfe4ea;
        border-top: 0;
    }

    .summary-item:last-child {
        border-bottom: 0;
    }

    .verification-details {
        grid-template-columns: 1fr;
    }
}
