/* =========================================
   The map's status (EntityHealth): one class per status, named by
   Symbols.OfHealth (MapClass). Markers, clusters, places and dots read
   the same variables, so a status looks the same wherever it is drawn.
   Loaded after app.css, whose marker pin this colours.
========================================= */

.b2b-health-unknown { --b2b-health-color: #2563eb; --b2b-health-border: #e5e7eb; --b2b-health-bg: #fff; }
.b2b-health-online { --b2b-health-color: #16a34a; --b2b-health-border: #22c55e; --b2b-health-bg: #fff; }
/* Grey, not red: red is an alarm, and without contact is not one */
.b2b-health-offline { --b2b-health-color: #6b7280; --b2b-health-border: #9ca3af; --b2b-health-bg: #e5e7eb; }
.b2b-health-warning { --b2b-health-color: #d97706; --b2b-health-border: #f59e0b; --b2b-health-bg: #fff; }
.b2b-health-alarm { --b2b-health-color: #dc2626; --b2b-health-border: #ef4444; --b2b-health-bg: #fff; }

.b2b-marker-wrapper .b2b-marker-icon {
    background: var(--b2b-health-bg, #fff);
    border-color: var(--b2b-health-border, #e5e7eb);
}

    /* The status decides the colour, over the kind's theme colour (bgCustomText) */
    .b2b-marker-wrapper .b2b-marker-icon i {
        color: var(--b2b-health-color, #2563eb) !important;
    }

.b2b-health-dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: var(--b2b-health-border, #d1d5db);
}

/* =========================================
   Clusters and places
========================================= */

.b2b-cluster-container {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.b2b-cluster,
.b2b-place {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 3px solid var(--b2b-health-border, #e5e7eb);
    box-shadow: 0 6px 18px rgba(0,0,0,.24), 0 2px 6px rgba(0,0,0,.14);
    color: #111827;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.b2b-cluster {
    width: 40px;
    height: 40px;
    justify-content: center;
    border-radius: 9999px;
    font-size: 14px;
    background: var(--b2b-health-bg, #fff);
}

.b2b-place {
    padding: 4px 6px 4px 4px;
    border-radius: 9999px;
    font-size: 13px;
}

.b2b-place-icon {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 13px;
}

.b2b-place-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.b2b-place-count {
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 9999px;
    background: var(--b2b-health-border, #e5e7eb);
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.b2b-cluster-alarm {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    background: #ef4444;
    border: 2px solid #fff;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   What a cluster holds: on hover, or the first tap on a touch screen
========================================= */

.b2b-cluster-popup .leaflet-popup-content {
    margin: 8px;
    min-width: 220px;
}

.b2b-cluster-title {
    font-weight: 800;
    font-size: 14px;
    color: #111827;
    padding: 2px 6px 6px;
}

.b2b-cluster-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #111827;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

    .b2b-cluster-row:hover {
        background: #f3f4f6;
    }

.b2b-cluster-row-icon {
    width: 18px;
    text-align: center;
    color: #4b5563;
}

.b2b-cluster-row-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.b2b-cluster-row-count {
    color: #6b7280;
    font-size: 12px;
}

.b2b-cluster-more {
    padding: 4px 6px;
    color: #6b7280;
    font-size: 12px;
}

.b2b-cluster-zoom {
    width: 100%;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}
