:root{
    --bg:#f3f6fb;
    --text:#172033;
    --muted:#64748b;
    --panel:#ffffff;
    --border:#e5eaf1;
    --brand:#0f766e;
    --brand2:#14b8a6;
    --dark:#0f172a;
    --red:#dc2626;
    --blue:#2563eb;
    --yellow:#d97706;
    --green:#16a34a;
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:Arial,sans-serif;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

header{
    position:relative;
    overflow:hidden;
    background:
        linear-gradient(135deg, rgba(15,118,110,.70), rgba(15,23,42,.82)),
        url('/assets/img/header.jpg') center/cover no-repeat;
    color:#fff;
    padding:34px 18px 74px;
    box-shadow:0 18px 46px rgba(15,23,42,.18);
}

header::before{
    content:"";
    position:absolute;
    inset:0;
    background:
        radial-gradient(circle at 82% 12%, rgba(45,212,191,.24), transparent 34%),
        radial-gradient(circle at 18% 18%, rgba(59,130,246,.18), transparent 30%);
    pointer-events:none;
}

header::after{
    content:"";
    position:absolute;
    left:-8%;
    right:-8%;
    bottom:-74px;
    height:92px;
    background:var(--bg);
    border-radius:50% 50% 0 0;
}

.top{
    max-width:1320px;
    margin:0 auto;
    display:flex;
    gap:18px;
    align-items:center;
    justify-content:space-between;
    position:relative;
    z-index:2;
}

h1{
    margin:0;
    font-size:36px;
    line-height:1.04;
    letter-spacing:-.055em;
    text-shadow:0 8px 30px rgba(0,0,0,.22);
}

.sub{
    margin-top:8px;
    opacity:.94;
    font-size:15px;
    line-height:1.55;
    max-width:760px;
}

.nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.nav a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:11px 15px;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    color:#fff;
    text-decoration:none;
    font-weight:900;
    font-size:14px;
    border:1px solid rgba(255,255,255,.25);
    box-shadow:0 12px 28px rgba(15,23,42,.18);
    transition:.18s ease;
}

.nav a:hover{
    transform:translateY(-1px);
    background:rgba(255,255,255,.22);
}

/*
|--------------------------------------------------------------------------
| LAYOUT
|--------------------------------------------------------------------------
*/

.layout{
    max-width:1320px;
    margin:-44px auto 18px;
    padding:0 18px 18px;
    display:grid;
    grid-template-columns:350px 1fr;
    gap:16px;
    position:relative;
    z-index:5;
}

/*
|--------------------------------------------------------------------------
| SIDE PANEL
|--------------------------------------------------------------------------
*/

.panel{
    background:rgba(255,255,255,.97);
    border:1px solid rgba(226,232,240,.95);
    border-radius:24px;
    padding:18px;
    box-shadow:0 22px 54px rgba(15,23,42,.16);
    backdrop-filter:blur(10px);
    align-self:start;
}

.filters{
    display:grid;
    gap:11px;
}

input,
select,
button{
    width:100%;
    padding:13px 14px;
    border:1px solid #d7deea;
    border-radius:16px;
    font-size:14px;
    background:#fff;
    transition:.18s ease;
}

input:focus,
select:focus{
    outline:none;
    border-color:#14b8a6;
    box-shadow:0 0 0 4px rgba(20,184,166,.15);
}

button{
    border:0;
    color:#082f2b;
    font-weight:950;
    cursor:pointer;
    background:var(--brand2);
    box-shadow:0 12px 26px rgba(20,184,166,.18);
}

button:hover{
    transform:translateY(-1px);
    box-shadow:0 16px 36px rgba(20,184,166,.24);
}

/*
|--------------------------------------------------------------------------
| STATS
|--------------------------------------------------------------------------
*/

.stats{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin:15px 0;
}

.stat{
    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:18px;
    padding:13px;
}

.stat b{
    display:block;
    font-size:24px;
    letter-spacing:-.03em;
    margin-bottom:4px;
}

/*
|--------------------------------------------------------------------------
| LEGEND
|--------------------------------------------------------------------------
*/

.legend{
    display:grid;
    gap:9px;
    margin-top:15px;
    font-size:13px;
    color:#334155;
}

.legend-row{
    display:flex;
    align-items:center;
    gap:9px;
}

.dot{
    width:14px;
    height:14px;
    border-radius:999px;
    display:inline-block;
    box-shadow:0 3px 10px rgba(15,23,42,.18);
}

.dot.red{background:var(--red);}
.dot.blue{background:var(--blue);}
.dot.yellow{background:var(--yellow);}
.dot.green{background:var(--green);}

.small{
    color:var(--muted);
    font-size:12px;
    line-height:1.55;
    margin-top:14px;
}

/*
|--------------------------------------------------------------------------
| MAP
|--------------------------------------------------------------------------
*/

.map-card{
    border-radius:24px;
    overflow:hidden;
    border:1px solid rgba(226,232,240,.95);
    background:#fff;
    box-shadow:0 22px 54px rgba(15,23,42,.16);
    min-height:calc(100vh - 148px);
    position:relative;
}

#map{
    height:calc(100vh - 148px);
    min-height:610px;
    width:100%;
    background:#dbeafe;
}

.loading{
    position:absolute;
    z-index:999;
    top:16px;
    left:50%;
    transform:translateX(-50%);
    background:rgba(15,23,42,.92);
    color:#fff;
    padding:11px 15px;
    border-radius:999px;
    font-size:13px;
    font-weight:900;
    box-shadow:0 12px 30px rgba(15,23,42,.28);
}

/*
|--------------------------------------------------------------------------
| LEAFLET OVERRIDES
|--------------------------------------------------------------------------
*/

.leaflet-control-zoom a{
    border-radius:12px !important;
    margin-bottom:4px;
    border:1px solid #e2e8f0 !important;
    box-shadow:0 8px 20px rgba(15,23,42,.12);
}

.leaflet-control-attribution{
    border-radius:10px 0 0 0;
    font-size:10px;
}

.leaflet-popup-content-wrapper{
    border-radius:18px;
    box-shadow:0 18px 46px rgba(15,23,42,.20);
}

.leaflet-popup-content{
    margin:14px 15px;
    min-width:230px;
}

.leaflet-popup-tip{
    box-shadow:0 10px 22px rgba(15,23,42,.18);
}

/*
|--------------------------------------------------------------------------
| POPUP
|--------------------------------------------------------------------------
*/

.popup-title{
    font-weight:950;
    font-size:16px;
    margin-bottom:4px;
    color:#0f172a;
}

.popup-meta{
    color:#64748b;
    font-size:12px;
    margin-bottom:9px;
}

.popup-row{
    margin-top:7px;
    line-height:1.38;
    color:#334155;
}

.popup-row strong{
    color:#0f172a;
}

.popup-row a{
    display:inline-flex;
    margin-top:4px;
    color:var(--brand);
    font-weight:900;
    text-decoration:none;
}

/*
|--------------------------------------------------------------------------
| BADGES / MARKERS
|--------------------------------------------------------------------------
*/

.badge{
    display:inline-block;
    padding:6px 9px;
    border-radius:999px;
    font-weight:900;
    font-size:12px;
}

.badge.red{
    background:#fee2e2;
    color:#991b1b;
}

.badge.blue{
    background:#dbeafe;
    color:#1e40af;
}

.badge.yellow{
    background:#fef3c7;
    color:#92400e;
}

.badge.green{
    background:#dcfce7;
    color:#166534;
}

.custom-marker{
    width:22px;
    height:22px;
    border-radius:999px;
    border:3px solid #fff;
    box-shadow:0 8px 22px rgba(15,23,42,.32);
}

.custom-marker.red{background:var(--red);}
.custom-marker.blue{background:var(--blue);}
.custom-marker.yellow{background:var(--yellow);}
.custom-marker.green{background:var(--green);}

/*
|--------------------------------------------------------------------------
| MARKER CLUSTER
|--------------------------------------------------------------------------
*/

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large{
    background-color:rgba(15,118,110,.20);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div{
    background:linear-gradient(135deg,#14b8a6,#0f766e);
    color:#fff;
    font-weight:950;
    box-shadow:0 12px 28px rgba(15,23,42,.22);
}

/*
|--------------------------------------------------------------------------
| SCROLLBAR
|--------------------------------------------------------------------------
*/

::-webkit-scrollbar{
    width:10px;
    height:10px;
}

::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:999px;
}

::-webkit-scrollbar-track{
    background:#f1f5f9;
}

/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media(max-width:900px){

    header{
        padding:30px 14px 58px;
    }

    .top{
        align-items:flex-start;
        flex-direction:column;
    }

    h1{
        font-size:30px;
    }

    .sub{
        font-size:14px;
    }

    .layout{
        grid-template-columns:1fr;
        margin:-36px auto 12px;
        padding:0 12px 12px;
    }

    .panel{
        order:2;
    }

    .map-card{
        order:1;
        min-height:70vh;
    }

    #map{
        height:70vh;
        min-height:430px;
    }
}

@media(max-width:520px){

    header{
        padding:26px 10px 52px;
        background-position:center;
    }

    .nav{
        width:100%;
    }

    .nav a{
        flex:1;
    }

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

    .panel{
        border-radius:20px;
        padding:15px;
    }

    .map-card{
        border-radius:20px;
    }

    #map{
        min-height:390px;
    }
}
