.map-system {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #1a1a1a;
    color: #fff;
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

.map-sidebar {
    flex: 0 0 180px;
}

.map-sidebar h4,
.map-box h4,
.map-panel h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd54f;
}

.area-btn {
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    transition: background 0.2s;
    gap: 4px;
}

.area-btn:hover {
    background: rgba(255,255,255,0.1);
}

.area-btn.active {
    background: rgba(33, 150, 243, 0.3);
}

.area-btn .area-color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.map-box {
    flex: 1;
    min-width: 0;
}

.map-wrap {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.map-wrap .map-img {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.map-wrap .dot {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.map-wrap .dot:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.map-panel {
    flex: 0 0 280px;
}

.panel-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar nhẹ nhàng cho panel và nội dung chi tiết (WebKit) */
.panel-scroll::-webkit-scrollbar,
.company-detail-scroll::-webkit-scrollbar {
    width: 6px;
}
.panel-scroll::-webkit-scrollbar-track,
.company-detail-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.panel-scroll::-webkit-scrollbar-thumb,
.company-detail-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    border-radius: 4px;
}
.panel-scroll::-webkit-scrollbar-thumb:hover,
.company-detail-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12));
}

.company {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.company:hover {
    background: rgba(255,255,255,0.1);
}

.company.hidden {
    display: none;
}

.company b {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.company .sub {
    font-size: 11px;
    color: #aaa;
}

/* Chi tiết doanh nghiệp — hiển thị trong khung THÔNG TIN DOANH NGHIỆP */
.company-detail-inline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
    min-height: 120px;
}
/* Nút quay lại — nằm ngoài vùng chi tiết, trên cùng */
.company-detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 10px;
    padding: 2px 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
}
.company-detail-back-link:hover {
    color: #ffffff;
}
.company-detail-placeholder {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    text-align: center;
    padding: 12px 0;
}
.company-detail-inline .company-detail-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.company-detail-inline .company-detail-logo-wrap img {
    width: 56px;
    height: 56px;
}
.company-detail-inline .company-detail-name {
    font-size: 15px;
    text-align: center;
    width: 100%;
}
.company-detail-inline .company-detail-map-btn {
    align-self: center;
    margin-top: 6px;
    margin-bottom: 0;
    padding: 6px 12px;
    font-size: 11px;
}
.company-detail-inline .company-detail-desc {
    margin-top: 10px;
    margin-bottom: 10px;
}
.company-detail-inline .company-detail-body-wrap {
    padding-top: 10px;
}

.company-detail-section {
    margin-top: 10px;
}
.company-detail-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

/* Vùng scroll chung cho cả Giới thiệu + Mô tả */
.company-detail-scroll {
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}
.company.selected {
    background: rgba(33, 150, 243, 0.25);
    border: 1px solid rgba(33, 150, 243, 0.4);
}
.company-detail-logo-wrap {
    padding: 0 0 12px;
    text-align: center;
    flex-shrink: 0;
}
.company-detail-logo-wrap img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.company-detail-name {
    margin: 0 0 8px;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.company-detail-desc {
    margin: 0 0 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}
.company-detail-body-wrap {
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}
/* Ảnh trong content: hàng ngang, nhỏ bằng nhau, viền nhẹ, tự xuống dòng */
.company-detail-body-wrap > img {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    vertical-align: middle;
}
.company-detail-body-wrap > *:not(img) {
    flex: 1 1 100%;
}
.company-detail-body-wrap > *:not(img) img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    vertical-align: middle;
    margin: 0 4px 4px 0;
}
.company-detail-body-wrap table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}
.company-detail-body-wrap th,
.company-detail-body-wrap td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 10px;
    text-align: left;
}
.company-detail-map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 12px 18px;
    background: #1a73e8;
    color: #fff !important;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}
.company-detail-map-btn:hover {
    background: #1557b0;
    color: #fff;
}
.company-detail-map-btn:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    /* Xếp lại bố cục theo chiều dọc: KHU VỰC -> BẢN ĐỒ -> THÔNG TIN DOANH NGHIỆP */
    .map-system {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .map-sidebar,
    .map-box,
    .map-panel {
        flex: 0 0 auto;
        width: 100%;
    }

    .map-wrap {
        max-width: 100%;
    }

    .panel-scroll {
        max-height: none;
        max-height: 320px;
    }

    .company-detail-inline .company-detail-body-wrap {
        max-height: 140px;
    }
}
