/* ===== MENU TRÁI ===== */
    .sidebar-left {
        width: 300px;
        background: #f5f5f5;
        border-right: 1px solid #ccc;
        padding: 10px;
        overflow-y: auto;
    }

    .label-strong {
        display: block;
        font-weight: normal;
        font-size: 16px;
        margin: 10px;
        color: #333;
    }

    .commune-picker {
        position: relative;
    }

    #communeSearch {
        width: 100%;
        margin: 0;
        padding: 6px 32px 6px 10px;
        border: 1px solid #bbb;
        border-radius: 6px;
        background: #fff;
        font-size: 14px;
        color: #222;
    }

    #communeSearch::-webkit-search-cancel-button,
    #communeSearch::-webkit-search-decoration {
        -webkit-appearance: none;
        appearance: none;
    }

    .commune-toggle {
        position: absolute;
        top: 1px;
        right: 1px;
        width: 28px;
        height: calc(100% - 2px);
        border: none;
        background: transparent;
        color: #334155;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 0 6px 6px 0;
    }

    .commune-toggle svg {
        width: 12px;
        height: 8px;
        display: block;
    }

    .commune-toggle:disabled {
        cursor: default;
        color: #94a3b8;
    }

    .commune-picker.is-open .commune-toggle svg {
        transform: rotate(180deg);
    }

    .commune-list {
        position: absolute;
        z-index: 30;
        left: 0;
        right: 0;
        top: calc(100% + 2px);
        max-height: 220px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
    }

    .commune-option,
    .commune-empty {
        display: block;
        width: 100%;
        padding: 6px 8px;
        border: none;
        background: #fff;
        text-align: left;
        font-size: 13px;
        cursor: pointer;
    }

    .commune-option.is-active,
    .commune-option:hover {
        background: #dbeafe;
    }

    .commune-empty {
        color: #64748b;
        cursor: default;
    }

    select {
        width: 100%;
        padding: 6px 10px;
        border: 1px solid #bbb;
        border-radius: 6px;
        background: #fff;
        font-size: 14px;
        color: #222;
        margin-bottom: 10px;
    }

    .checklist-container {
        background: transparent;        /* không màu khi mới load */
        border: none;
        border-radius: 8px;
        padding: 0px 5px 0px 5px;
        margin-bottom: 0px;
        transition: all 0.3s ease;          /* cố định chiều cao hợp lý */
        overflow-y: auto;              /* cho phép cuộn nếu quá dài */
        scrollbar-width: thin;
        scrollbar-color: #bbb #f1f1f1;
    }

    /* Khi có dữ liệu (active) */
    .checklist-container.active {
        background: #ffffff;
        border: 1px solid #d0d0d0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Label từng dòng */
    .checklist-container label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: #222;
        padding: 0px;
        border-radius: 4px;
        margin-bottom: 4px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    /* Hiệu ứng hover nhẹ */
    .checklist-container label:hover {
        background: #f3f6f9;
    }

    /* Checkbox */
    .checklist-container input[type="checkbox"] {
        transform: scale(1.1);
        cursor: pointer;
        accent-color: #0078ff; /* màu tick hiện đại */
    }

    /* Kẻ ngang giữa nhóm */
    .checklist-container hr {
        border: 0;
        border-top: 1px solid #ccc;
        margin: 8px 0;
    }

    /* Thanh cuộn đẹp cho Chrome/Safari/Edge */
    .checklist-container::-webkit-scrollbar {
        width: 6px;
    }
    .checklist-container::-webkit-scrollbar-thumb {
        background-color: #bbb;
        border-radius: 4px;
    }
    .checklist-container::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

  /* ===== BẢN ĐỒ ===== */
        .controls {
            width: 260px;
            background: #f5f5f5;
            padding: 10px;
            border-right: 1px solid #ccc;
            overflow-y: auto;
        }

    .controls label {
      display: block;
      margin-bottom: 5px;
      font-weight: 500;
    }

    .controls input,
    .controls select,
    .controls button {
      width: 100%;
      padding: 6px 8px;
      margin-bottom: 10px;
      font-size: 14px;
    }

    .controls button {
      background: #4caf50;
      color: white;
      border: none;
      cursor: pointer;
      transition: 0.3s;
    }

    .controls button:hover { background: #43a047; }

    .sidebar-right {
        width: 280px;
        background: #f9fafb;
        border-left: 1px solid #ccc;
        padding: 15px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .sidebar-right {
        width: 280px;
        background: #e9f4ff; /* 💡 cùng màu cho toàn khối */
        border-left: 1px solid #ccc;
        padding: 10px;
        box-sizing: border-box;
        border-radius: 8px 0 0 8px;
        box-shadow: -2px 0 6px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sidebar-right > div {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Tiêu đề */
    .sidebar-right h3 {
        margin-top: 0px;
        margin-bottom: 0px;
        font-size: 16px;
        font-weight: bold;
        color: #004a8f;
    }

    .analysis-buttons {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    }
    .analysis-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    color: rgb(12, 12, 12);
    font-size: 14px;
    cursor: pointer;
    }
    .btn-fire {
        background-color: #119beb;
        height: 40px;          /* độ cao nút */
        padding: 0 4px;      /* khoảng cách trong (trái/phải) */
        margin: 0px;          /* khoảng cách ngoài */
        border-radius: 6px;  /* bo góc (tuỳ chọn) */
    }

    .routing-btn {
        min-height: 28px;
        height: auto;
        padding: 4px 6px;
        border: none;
        border-radius: 6px;
        font-weight: 700;
        font-size: 12px;
        line-height: 1.2;
        cursor: pointer;
        background: #e2e8f0;
        color: #0f172a;
    }

    .routing-btn:disabled {
        opacity: 0.6;
        cursor: wait;
    }

    .routing-btn-poi { background: #1d4ed8; color: #fff; }
    .routing-btn-multi { background: #0f766e; color: #fff; }
    .routing-btn-area { background: #b45309; color: #fff; }
    .routing-btn-clear {
        background: #fff;
        color: #334155;
        border: 1px solid #cbd5e1;
        grid-column: 1 / -1;
        min-height: 24px;
        font-weight: 600;
    }

    #routingPanel {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 6px 8px;
        border: 1px solid #d0d7de;
        border-radius: 8px;
        background: #f8fafc;
    }

    .routing-head,
    .fold-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 0;
        padding: 2px 0;
        border: none;
        background: transparent;
        color: #0f172a;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        text-align: left;
    }

    .routing-chevron {
        font-size: 12px;
        color: #64748b;
    }

    #routingBody {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    #routingPanel.is-collapsed #routingBody {
        display: none;
    }

    .routing-row {
        display: flex;
        gap: 4px;
    }

    .routing-row select {
        flex: 1;
        min-width: 0;
        padding: 3px 4px;
        font-size: 12px;
    }

    .routing-loop {
        display: flex;
        gap: 6px;
        align-items: center;
        margin: 0;
        font-size: 12px;
    }

    .routing-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    #routingLegend {
        display: none;
        font-size: 12px;
        line-height: 1.4;
    }

    #routingStatus {
        font-size: 11px;
        line-height: 1.35;
        color: #334155;
    }

    #routingStatus:empty {
        display: none;
    }

    .fold-panel {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 6px 8px;
        border: 1px solid #d0d7de;
        border-radius: 8px;
        background: #f8fafc;
    }

    .fold-body {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .fold-panel.is-collapsed .fold-body {
        display: none;
    }

    .fold-field {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1;
        min-width: 0;
        margin: 0;
        font-size: 12px;
    }

    .fold-field input {
        width: 58px;
        padding: 3px 4px;
        font-size: 12px;
    }

    .fold-huff input {
        width: 40px;
        padding: 3px 4px;
        font-size: 12px;
    }

    .fold-btn-site { background: #f8930e; color: #fff; }
    .fold-btn-choice { background: #dc2626; color: #fff; }
    .fold-btn-huff { background: #9f1239; color: #fff; }

    .fold-huff {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
    }

    .fold-huff .routing-btn {
        flex: 1;
        min-width: 0;
    }

    #potentialInfo {
        font-size: 11px;
        line-height: 1.35;
        color: #334155;
    }

    #potentialInfo:empty {
        display: none;
    }

    .btn-site {
        background-color: #e7eb11;
        height: 40px;          /* độ cao nút */
        padding: 0 4px;      /* khoảng cách trong (trái/phải) */
        margin: 0px;          /* khoảng cách ngoài */
        border-radius: 6px;  /* bo góc (tuỳ chọn) */
    }

    .btn-criminal {
        background-color: #1e88e5;
        height: 40px;
        padding: 0 16px;
        margin: 8px;
        border-radius: 6px;
    }

    #map {
      flex: 1;
      height: 100%;
    }
    
    .info.legend {
      background: white;
      padding: 6px 8px;
      font: 12px Arial, sans-serif;
      box-shadow: 0 0 15px rgba(0,0,0,0.2);
      border-radius: 5px;
    }

    #loading-popup {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(30, 30, 30, 0.4);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
    }

    .popup-box {
      background: white;
      padding: 20px 30px;
      border-radius: 12px;
      text-align: center;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
      width: 250px;
      font-family: Arial, sans-serif;
    }

    .popup-box h3 {
      margin-top: 0;
      color: #333;
      font-size: 16px;
    }

    .progress-bar {
      width: 100%;
      height: 14px;
      background: #ddd;
      border-radius: 7px;
      overflow: hidden;
      margin-top: 10px;
    }

    .progress-fill {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, #4caf50, #81c784);
      transition: width 0.4s ease;
    }

    .progress-text {
      margin: 0px;
      color: #444;
      font-size: 13px;
      font-weight: bold;
    }

    #btnUpdateNews {
        display: block;
        margin: 10px auto;
        padding: 5px 10px;
        cursor: pointer;
    }

    .map-btn {
        position: absolute;
        top: 60px;
        font-size: 14px;
        z-index: 1000;
        padding: 5px 10px;
        background: white;
        border: 1px solid gray;
        cursor: pointer;
        height: 32px;           /* cùng chiều cao */
        display: flex;
        align-items: center;    /* căn giữa dọc */
        justify-content: center;
        box-sizing: border-box;
    }
    
    #labelBtn { left: 330px; }
    #toggle3D { left: 460px; }
    #render3DBtn { left: 460px; }

    #tiltControl { left: 575px}
    #rotationControl { left: 740px; }

    #searchControl.active input,
    #searchControl.active button {
        display: inline-block;
    }

    #searchBtn {
        display: none;
        height: 32px;
        font-size: 14px;
        margin-left: 5px;
        border-radius: 5px;       /* bo góc */
        border: 1px solid #888;   /* viền */
        background-color: #0770e9; /* màu nền */
        color: white;              /* màu chữ */
        cursor: pointer;           /* con trỏ khi hover */
        padding: 0 12px;
        transition: background 0.3s;
    }

    #searchBtn {
        display: none;
        height: 32px;
        font-size: 14px;
        margin-left: 5px;
        border-radius: 5px;       /* bo góc */
        border: 1px solid #888;   /* viền */
        background-color: #0770e9; /* màu nền */
        color: white;              /* màu chữ */
        cursor: pointer;           /* con trỏ khi hover */
        padding: 0 12px;
        transition: background 0.3s;
    }

    #searchBtn:hover {
        background-color: #45a049; /* màu khi hover */
    }


    /* Bỏ giới hạn chiều cao cho Layer Control */
    .leaflet-control-layers {
        max-height: none !important;  /* không giới hạn chiều cao */
    }

    .leaflet-control-layers-list {
        max-height: none !important;  /* danh sách layer cũng không scroll */
    }

.heatmap-legend {
    background: white;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    font-size: 12px;
    width: 260px;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}

.legend-bar {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
