/* site-19-maps.css: the mini map of "Lugar del Hecho" (eventLocationMap.js) and the map of the supervisor's
   statistics (eventStatsMap.js). Leaflet's own styles: lib/leaflet/leaflet.css */

/* ===== Field "Lugar" with its list of addresses ===== */
.em-place {
    position: relative;
}

.em-suggestions {
    position: absolute;
    z-index: 1100;            /* over the map (Leaflet uses up to 1000) */
    left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    margin: 6px 0 0;
    padding: 6px;
    list-style: none;
    border: 1px solid #d5dce6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.em-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
}

    .em-suggestion i {
        color: #94a3b8;
    }

    .em-suggestion span {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .em-suggestion strong {
        color: #0f172a;
        font-weight: 500;
    }

    .em-suggestion small {
        overflow: hidden;
        color: #5b6778;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .em-suggestion:hover,
    .em-suggestion.is-active {
        background: #eef4fc;
    }

        .em-suggestion.is-active i {
            color: #dc2626;
        }

.em-suggestion-empty {
    padding: 10px 12px;
    color: #5b6778;
    font-size: 0.9rem;
}

/* ===== The mini map ===== */
.em-box {
    position: relative;
    margin-top: 18px;
}

.em-map {
    height: 320px;
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    background: #ebeee8;
}

.em-hint {
    position: absolute;
    z-index: 500;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 14px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    font-size: 0.9rem;
    pointer-events: none;     /* the click goes to the map */
    text-align: center;
}

.em-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.em-status-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.em-located {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.82rem;
    font-weight: 500;
}

.em-coords {
    color: #334155;
    font-family: "Roboto Mono", ui-monospace, monospace;
    font-size: 0.9rem;
}

.em-help {
    color: #5b6778;
    font-size: 0.82rem;
}

    .em-help.is-warning {
        color: #9a4a12;
        font-weight: 500;
    }

.em-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #d5dce6;
    border-radius: 10px;
    background: #fff;
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 500;
}

    .em-clear:hover {
        border-color: #f1b7b0;
        background: #fff5f4;
    }

/* --- The red pin (L.divIcon; two classes: leaflet.css, loaded later, paints .leaflet-div-icon white) --- */
.leaflet-marker-icon.em-pin {
    background: none;
    border: 0;
}

.em-pin-head {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: #dc2626;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transform: rotate(-45deg);
}

    .em-pin-head span {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #fff;
    }

/* ===== Map of the statistics ===== */
.st-map {
    height: 480px;
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    background: #ebeee8;
}

.st-popup {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 200px;
    color: #334155;
    font-family: inherit;
    font-size: 0.85rem;
}

    .st-popup strong {
        color: #0f172a;
        font-size: 0.95rem;
    }

    .st-popup a {
        margin-top: 4px;
        font-weight: 500;
    }

.st-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    font-size: 0.75rem;
}

    .st-legend-bar {
        width: 160px;
        height: 10px;
        border-radius: 999px;
        background: linear-gradient(90deg, #fde68a, #f59e0b, #dc2626);
    }

    .st-legend-ends {
        display: flex;
        justify-content: space-between;
    }

/* ===== Page of the statistics (Management/SupervisorStatistics) ===== */
.st-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 12px;
}

.st-field {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    gap: 6px;
}

    .st-field--date {
        flex: 0 1 170px;
    }

    .st-field label {
        color: #475569;
        font-size: 0.85rem;
        font-weight: 500;
    }

.st-apply,
.st-clear {
    min-height: 44px;
}

/* "Generar reporte" in the place of a filter: as tall as the selects, under an empty label */
.st-field--action {
    align-self: stretch;
}

    .st-field-spacer {
        font-size: 0.85rem;
    }

.st-report {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    font-weight: 600;
}

.st-range {
    margin: 0 0 16px;
    color: #5b6778;
    font-size: 0.85rem;
}

.st-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.st-kpi {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid #dfe5ee;
    border-radius: 16px;
    background: #fff;
}

.st-kpi-label {
    color: #5b6778;
    font-size: 0.85rem;
    font-weight: 500;
}

.st-kpi-value {
    color: #0f172a;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

    /* The carátula: up to two lines, then "..." (the whole text in the tooltip) */
    .st-kpi-value--text {
        display: -webkit-box;
        overflow: hidden;
        font-size: 1.45rem;
        line-height: 1.2;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

.st-kpi-sub {
    color: #5b6778;
    font-size: 0.82rem;
}

.st-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

    .st-card h3 {
        margin: 0;
        color: #0f172a;
        font-size: 1.15rem;
        font-weight: 700;
    }

.st-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .st-card-head p {
        margin: 4px 0 0;
        color: #5b6778;
        font-size: 0.9rem;
    }

.st-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.st-mode {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #d5dce6;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 500;
}

    .st-mode.is-active {
        border-color: #1e3a6b;
        background: #1e3a6b;
        color: #fff;
    }

.st-note {
    margin: 0;
    color: #5b6778;
    font-size: 0.85rem;
}

/* --- Day × hour --- */
.st-heat-wrap {
    overflow-x: auto;
}

.st-heat {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 4px;
    font-size: 0.85rem;
}

    .st-heat thead th {
        padding-bottom: 4px;
        color: #5b6778;
        font-weight: 500;
        text-align: center;
    }

    .st-heat tbody th {
        width: 52px;
        color: #334155;
        font-weight: 500;
    }

    .st-heat td {
        height: 40px;
        border-radius: 6px;
        color: #5a2a0c;
        font-weight: 700;
        text-align: center;
    }

        .st-heat td.is-dark {
            color: #fff;
        }

/* --- Kinds and evolution --- */
.st-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

    .st-row > .st-card {
        flex: 1 1 420px;
        min-width: 0;
    }

.st-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.st-bar-label {
    overflow: hidden;
    color: #334155;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-bar {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

    .st-bar > div {
        height: 100%;
        border-radius: 999px;
        background: #2f6fb5;
    }

.st-bar-value {
    font-weight: 700;
    text-align: right;
}

.st-line {
    width: 100%;
    height: auto;
}

    .st-line .st-axis {
        stroke: #cbd5e1;
    }

    .st-line .st-grid {
        stroke: #eef2f7;
    }

    .st-line .st-path {
        fill: none;
        stroke: #2f6fb5;
        stroke-width: 3;
        stroke-linejoin: round;
        stroke-linecap: round;
    }

    .st-line .st-dot {
        fill: #fff;
        stroke: #2f6fb5;
        stroke-width: 3;
    }

    .st-line .st-tick {
        fill: #5b6778;
        font-size: 13px;
    }

/* ===== Card of the dashboard ===== */
.action-card--statistics {
    --card-tint: 47, 111, 181;
    --card-image: url("../images/cards/polices.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);
}

/* ===== "Buscar" at the end of the fields of the address: only the magnifier ===== */
.em-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: transparent;
    color: #1e3a6b;
    font-size: 1.15rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .em-search:hover {
        border-color: #9fb2cf;
        background: rgba(30, 58, 107, 0.08);
    }

    .em-search:focus-visible {
        outline: 3px solid rgba(47, 111, 181, 0.45);
        outline-offset: 2px;
    }

/* ===== "Parte informativo" (InfoSummaries: _InfoDailyReportModal, dailyReport.js) ===== */
button.dt-back.dr-open {
    cursor: pointer;
}

.dr-help {
    margin: 0 0 10px;
    color: #5b6778;
    font-size: 0.9rem;
}

.dr-text {
    height: min(60vh, 520px);   /* the whole parte is seen without making the box bigger */
    min-height: 360px;
    font-family: "Roboto Mono", ui-monospace, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.dr-error {
    margin: 10px 0 0;
}

.dr-whatsapp i {
    margin-right: 4px;
}

/* ===== Recorrido fotográfico (JudicialSummaries/PhotoTour, photoTour.js) ===== */
.pt-page {
    max-width: 1120px;
    margin: 0 auto;
}

.pt-intro {
    min-height: 140px;
}

.pt-origins {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.pt-origin {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pt-icon-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #d5dce6;
    border-radius: 10px;
    background: #fff;
    color: #b42318;
}

.pt-add-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px dashed #9fb2cf;
    border-radius: 10px;
    background: transparent;
    color: #1e3a6b;
    font-size: 0.9rem;
    font-weight: 500;
}

.pt-tour-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pt-tour {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pt-place {
    overflow: hidden;
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    background: #fff;
}

.pt-place-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #eef2f8;
}

.pt-place-head label {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.pt-place-head input {
    flex: 1 1 280px;
    font-weight: 500;
}

.pt-camera {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
}

.pt-camera-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.pt-camera-head .pt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pt-camera-head .pt-field label {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 500;
}

/* One capture per row: photo on the left, the text (big) on the right; "Agregar captura" below */
.pt-shots {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pt-shot {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 14px;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    background: #fff;
}

.pt-shot-side {
    display: flex;
    flex: 0 1 380px;
    flex-direction: column;
    gap: 10px;
    min-width: 260px;
}

.pt-shot-photo {
    position: relative;
    height: 240px;
    overflow: hidden;
    border-radius: 8px;
    background: #1f2937;
}

    .pt-shot-photo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.pt-shot-number {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.78rem;
}

.pt-shot-body {
    display: flex;
    flex: 999 1 420px;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

    .pt-shot-body label {
        color: #475569;
        font-size: 0.82rem;
        font-weight: 500;
    }

.pt-shot-when {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

    .pt-shot-when > div {
        display: flex;
        flex: 0 1 190px;
        flex-direction: column;
        gap: 4px;
    }

.pt-shot-body textarea.pt-shot-text {
    min-height: 200px;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.55;
    resize: vertical;
}

.pt-shot-count {
    align-self: flex-end;
    color: #5b6778;
    font-size: 0.78rem;
}

.pt-shot-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pt-circle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #fde8e6;
    color: #b42318;
    font-size: 0.88rem;
    font-weight: 500;
}

.pt-mini-btn {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.85rem;
}

    .pt-mini-btn.is-danger {
        color: #b42318;
    }

    .pt-mini-btn:disabled {
        opacity: 0.4;
    }

.pt-shot-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    border: 2px dashed #9fb2cf;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e3a6b;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

    .pt-shot-add small {
        color: #5b6778;
        font-weight: 400;
    }

    .pt-shot-add.is-over {
        border-color: #1e3a6b;
        background: #eef4fc;
    }

.pt-warning {
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fef3c7;
    color: #8a4b08;
    font-size: 0.85rem;
}

/* --- Circle editor --- */
.pt-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.pt-tool-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e11d1d;
    border-radius: 8px;
    background: #fde8e6;
    color: #b42318;
    font-size: 0.88rem;
    font-weight: 500;
}

.pt-tools .pt-danger {
    color: #b42318;
}

.pt-tools-help {
    margin-left: auto;
    color: #5b6778;
    font-size: 0.82rem;
}

.pt-canvas-wrap {
    display: flex;
    justify-content: center;
    background: #f1f5f9;
}

.pt-canvas {
    max-width: 100%;
    max-height: 68vh;
    cursor: crosshair;
    touch-action: none;   /* the finger draws, it does not scroll the page */
}

/* ===== Monthly sheet (Management/MonthlySheet) ===== */
.action-card--sheet {
    --card-tint: 22, 110, 64;
    --card-image: url("../images/cards/estadistica.jpg");
    --card-image-filter: brightness(0.50) contrast(1.05);
}

.ms-help h3 {
    margin: 0 0 8px;
}

.ms-help p {
    margin: 0 0 8px;
    color: #334155;
}

.ms-help ol {
    margin: 0 0 12px;
    padding-left: 22px;
    color: #334155;
    line-height: 1.7;
}

/* ===== "Sustraído" / "Tipo de arma" over the text marked in the relato (stolenItemsPicker.js) ===== */
.pick-bar {
    position: fixed;
    z-index: 3000;
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 24px -8px rgba(2, 6, 23, 0.45);
}

    .pick-bar[hidden] {
        display: none;
    }

.pick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

    .pick-btn:focus-visible {
        outline: 2px solid #0f172a;
        outline-offset: 2px;
    }

.pick-btn--stolen {
    background: #166e40;
}

    .pick-btn--stolen:hover {
        background: #0f5a33;
    }

.pick-btn--weapon {
    background: #c2410c;
}

    .pick-btn--weapon:hover {
        background: #9a3412;
    }

.pick-toast {
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 24px;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-size: 0.9rem;
    transform: translateX(-50%);
    box-shadow: 0 10px 24px -8px rgba(2, 6, 23, 0.6);
}

/* The two fields under the relato */
.pick-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.pick-dot {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.pick-dot--stolen {
    background: #16a34a;
}

.pick-dot--weapon {
    background: #ea580c;
}

.pick-optional {
    color: #5b6778;
    font-weight: 400;
}

.pick-help {
    display: block;
    margin-top: 6px;
    color: #5b6778;
    font-size: 0.85rem;
}

.pick-stolen {
    color: #166534;
}

.pick-weapon {
    color: #9a3412;
}

/* The two fields stay small (a few lines); they can be dragged bigger */
form textarea.cool-input.pick-field,
textarea.cool-input.pick-field {
    min-height: 0;
    height: 88px;
    resize: vertical;
}

form textarea.cool-input.pick-field--short,
textarea.cool-input.pick-field--short {
    height: 64px;
}

/* ===== Who added a document of the expediente (InfoSummaries): Juzgado / Fiscalía ===== */
.doc-origin {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.doc-origin--court {
    background: #ede9fe;
    color: #4c1d95;
}

.doc-origin--prosecutor {
    background: #dbeafe;
    color: #1e3a8a;
}

/* ===== Family court: has the complaint a precautionary measure of the court? (FamilyCourtPanel) ===== */
.court-measure {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.court-measure--done {
    background: #dcfce7;
    color: #14532d;
}

.court-measure--none {
    background: #fff1e6;
    color: #9a3412;
}

a.st-mode {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
