:root {
    --bg: #f3f7ff;
    --ink: #1a2f47;
    --muted: #5a6f86;
    --card: #ffffff;
    --line: #d8e3f2;
    --brand-green: #19B859;
    --brand-blue: #286FB2;
    --brand-purple: #A16AE9;
    --brand-purple-dark: #7c49bf;
    --shadow: 0 18px 34px rgba(40, 111, 178, 0.14);
}

* {
    box-sizing: border-box;
}

.public-map-body {
    margin: 0;
    font-family: "Nunito", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 10%, rgba(40, 111, 178, 0.2), transparent 42%),
        radial-gradient(circle at 92% 16%, rgba(161, 106, 233, 0.18), transparent 45%),
        radial-gradient(circle at 50% 105%, rgba(25, 184, 89, 0.16), transparent 36%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

.public-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 18px 34px;
}

.public-hero {
    background: linear-gradient(124deg, var(--brand-blue) 0%, var(--brand-purple) 58%, var(--brand-green) 100%);
    color: #f5fbff;
    border-radius: 22px;
    padding: 24px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.public-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 75%);
}

.hero-topline {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.public-hero h1 {
    margin: 10px 0 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.95rem;
}

.public-hero p {
    margin: 0;
    max-width: 760px;
    opacity: 0.95;
}

.hero-controls {
    margin-top: 14px;
    width: 170px;
    position: relative;
    z-index: 2;
}

.hero-controls label {
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.map-card,
.tools-card,
.table-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.map-card,
.tools-card {
    padding: 16px;
}

.card-head h2 {
    margin: 0 0 2px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.18rem;
}

.card-head p {
    margin: 0 0 10px;
    color: var(--muted);
}

#mapCanvas {
    width: 100%;
    height: 560px;
    border-radius: 14px;
    border: 1px solid rgba(40, 111, 178, 0.24);
}

.map-legend {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--muted);
}

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

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

.dot.low { background: #19B859; }
.dot.medium { background: #286FB2; }
.dot.high { background: #A16AE9; }
.dot.top { background: #7c49bf; }

.tool-group {
    margin-bottom: 12px;
}

.tool-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 0.9rem;
}

#toolMin {
    width: 100%;
}

.tool-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

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

.metric-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 10px;
    background: linear-gradient(150deg, rgba(40, 111, 178, 0.08) 0%, rgba(161, 106, 233, 0.06) 100%);
}

.metric-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.metric-card strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.22rem;
}

.status-banner {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(40, 111, 178, 0.24);
    background: linear-gradient(135deg, rgba(40, 111, 178, 0.12) 0%, rgba(161, 106, 233, 0.11) 100%);
    color: #254463;
    margin-bottom: 14px;
    font-weight: 600;
}

.table-card {
    padding: 16px;
}

#tableListados_wrapper {
    margin-top: 8px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #b6cae5;
    border-radius: 8px;
    background: #fff;
    padding: 4px 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border: 1px solid var(--brand-purple) !important;
    background: var(--brand-purple) !important;
    color: #fff !important;
    border-radius: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    border: 1px solid rgba(40, 111, 178, 0.4) !important;
    background: rgba(25, 184, 89, 0.12) !important;
    color: #1e4f78 !important;
    border-radius: 8px;
}

.btn-outline-primary {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-outline-primary:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-outline-secondary {
    color: var(--brand-purple-dark);
    border-color: var(--brand-purple);
}

.btn-outline-secondary:hover {
    background: var(--brand-purple);
    border-color: var(--brand-purple);
    color: #fff;
}

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

    #mapCanvas {
        height: 460px;
    }
}

@media (max-width: 640px) {
    .public-hero h1 {
        font-size: 1.5rem;
    }

    .hero-controls {
        width: 100%;
    }

    #mapCanvas {
        height: 360px;
    }
}
