/* License Map popup (Document Management > Licenses). Built by licenseMap.js -> DrawLicenseMap. */
.PopUp.lm-popup {
    border: 1px solid #d5dee8;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 42, 68, .22);
    overflow: hidden;
}

.lm {
    --lm-bg: #f4f7fb;
    --lm-panel: #ffffff;
    --lm-ink: #1a2c42;
    --lm-muted: #475569;
    --lm-line: #e3eaf0;
    --lm-brand: #0f2a44;
    --lm-accent: #0e8f8f;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    color: var(--lm-ink);
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
}
.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }

/* toolbar: company + hint */
.lm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lm-company { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lm-company-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lm-muted); }
.lm-company-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-select {
    height: 32px; min-width: 200px; max-width: 320px; padding: 0 10px;
    border: 1px solid var(--lm-line); border-radius: 8px; background: #fff;
    font: inherit; font-size: 13px; color: var(--lm-ink); cursor: pointer;
}
.lm-select:focus { outline: 2px solid rgba(14, 143, 143, .35); outline-offset: 1px; border-color: var(--lm-accent); }
.lm-hint { font-size: 12px; color: var(--lm-muted); }

/* license type chips */
.lm-types { display: flex; flex-wrap: wrap; gap: 6px; max-height: 68px; overflow-y: auto; padding: 1px; }
.lm-type {
    height: 28px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--lm-line); background: var(--lm-panel); color: var(--lm-ink);
    font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.lm-type:hover { border-color: var(--lm-accent); color: var(--lm-accent); }
.lm-type:focus-visible { outline: 2px solid rgba(14, 143, 143, .4); outline-offset: 1px; }
.lm-type.is-active { background: var(--lm-brand); border-color: var(--lm-brand); color: #fff; }

/* status summary / legend */
.lm-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.lm-stat {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: var(--lm-panel); border: 1px solid var(--lm-line); border-radius: 10px;
}
.lm-stats { max-height: 92px; overflow-y: auto; }
.lm-stat.is-zero { background: var(--lm-bg); }
.lm-stat.is-zero .lm-stat-count { color: var(--lm-muted); }
.lm-stat.is-extra { display: none; }
.lm-stats.show-all .lm-stat.is-extra { display: inline-flex; }
.lm-more {
    align-self: center; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--lm-accent); cursor: pointer;
}
.lm-more:hover { background: rgba(14, 143, 143, .08); }
.lm-stat-count { font-size: 16px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.lm-stat-label { font-size: 12px; font-weight: 500; color: var(--lm-ink) !important; }
.lm-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 42, 68, .18);
}

/* body: map + side list */
.lm-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
.lm-card { background: var(--lm-panel); border: 1px solid var(--lm-line); border-radius: 12px; min-height: 0; }
.lm-map-card { position: relative; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; }
.lm-map { width: 100%; height: 100%; }
.lm-map-empty {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
    padding: 6px 12px; border-radius: 999px; background: var(--lm-bg); color: var(--lm-muted); font-size: 12px; white-space: nowrap;
}
.lm-side { display: flex; flex-direction: column; overflow-y: auto; padding: 10px 0; }
.lm-side-title {
    padding: 4px 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lm-muted);
}
.lm-side-title + .lm-side-title, .lm-group + .lm-side-title { margin-top: 10px; border-top: 1px solid var(--lm-line); padding-top: 12px; }
.lm-group { padding-bottom: 6px; }
.lm-group-hdr { display: flex; align-items: center; gap: 8px; padding: 6px 14px 2px; font-size: 12px; font-weight: 600; }
.lm-group-hdr .lm-count { margin-left: auto; color: var(--lm-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lm-row {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 14px 5px 32px;
    background: none; border: 0; text-align: left; font: inherit; font-size: 12.5px; color: var(--lm-ink); cursor: pointer;
}
.lm-row:hover, .lm-row:focus-visible { background: var(--lm-bg); color: var(--lm-accent); outline: none; }
.lm-row .lm-abbr { margin-left: auto; font-size: 11px; color: var(--lm-muted); }
.lm-row .lm-city-count { font-size: 11px; color: var(--lm-muted); }
.lm-city { display: flex; align-items: center; gap: 7px; padding: 2px 14px 3px 44px; font-size: 12px; min-width: 0; }
.lm-city .lm-dot { width: 8px; height: 8px; }
.lm-city-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-city-status { margin-left: auto; font-size: 11px; color: var(--lm-muted); white-space: nowrap; }
.lm-side-empty { padding: 6px 14px; font-size: 12px; color: var(--lm-muted); }

/* loading */
.lm-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; color: var(--lm-muted); }
.lm-spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid var(--lm-line); border-top-color: var(--lm-accent);
    animation: lm-spin .8s linear infinite;
}
@keyframes lm-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .lm-body { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1fr) auto; }
}
