/* Навигация и эвакуация: метки на плане, панель маршрута, редактор проходов */
.nav-marker { position: absolute; }
.nav-marker .nav-dot { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #2563eb; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.nav-marker .nav-tag { position: absolute; left: 10px; top: -10px; white-space: nowrap; font: 600 11px/1 var(--font, system-ui); padding: 3px 6px; border-radius: 4px; background: #fff; color: #111827; border: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.nav-exit .nav-dot { background: #16a34a; border-radius: 3px; width: 16px; height: 16px; left: -8px; top: -8px; }
.nav-exit .nav-tag { background: #16a34a; color: #fff; border-color: #15803d; }
.nav-assembly .nav-dot { background: #0d9488; border-radius: 3px; transform: rotate(45deg); }
.nav-assembly .nav-tag { background: #0d9488; color: #fff; border-color: #0f766e; }
.nav-stairs .nav-dot, .nav-elevator .nav-dot { background: #7c3aed; border-radius: 3px; }
.nav-door .nav-dot { background: #f59e0b; border-radius: 2px; width: 10px; height: 10px; left: -5px; top: -5px; }
.nav-start .nav-dot { background: #2563eb; border-radius: 3px; }
.nav-path .nav-dot { width: 10px; height: 10px; left: -5px; top: -5px; background: #1d4ed8; }
.nav-here .nav-dot { background: #2563eb; box-shadow: 0 0 0 5px rgba(37,99,235,.25); }
.nav-goal .nav-dot { background: #dc2626; }
.nav-marker.selected .nav-dot { box-shadow: 0 0 0 4px rgba(245,158,11,.7); }
.nav-marker.blocked .nav-dot { opacity: .5; border-style: dashed; }
.nav-route-line { animation: nav-flow 1.2s linear infinite; }
@keyframes nav-flow { to { stroke-dashoffset: -22; } }
@media (prefers-reduced-motion: reduce) { .nav-route-line { animation: none; } }
.nav-arrow { background: none; border: 0; }
.nav-picking { cursor: crosshair !important; }
.btn-evac { color: #b91c1c; border-color: #fca5a5; font-weight: 600; }
.btn-evac:hover { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

.nav-panel, .nav-editor { position: fixed; top: 64px; right: 12px; bottom: 12px; width: 340px; z-index: 1001; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.nav-panel[hidden], .nav-editor[hidden] { display: none; }
.nav-panel.evac { border-color: #ef4444; }
.nav-panel.evac .free-head { background: #fef2f2; color: #991b1b; }
.nav-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.nav-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.nav-row select, .nav-row input { min-height: 36px; }
.nav-target { font-weight: 600; }
.nav-modes { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-hint { margin: 0; padding: 8px 10px; border-radius: var(--radius); background: #eff6ff; color: #1e3a8a; font-size: 14px; }
.nav-error { margin: 0; color: var(--danger); font-size: 14px; }
.nav-summary { font-weight: 600; }
.nav-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.nav-steps li.final { font-weight: 600; }
.nav-steps li button { margin-left: 8px; }
.nav-disclaimer { margin: 0; font-size: 12px; color: var(--text-muted); }
.nav-go { margin-left: 8px; }
.nav-pop { display: flex; flex-direction: column; gap: 4px; }
body.nav-editing #map .desk-marker, body.nav-editing #map .object-marker { pointer-events: none; }
body.nav-editing .editor-panel, body.nav-editing .staff-panel { display: none !important; }
.ne-drawing { cursor: crosshair !important; }
.ne-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ne-tools .active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.ne-props { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; min-height: 80px; }
.ne-props label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-muted); }
.ne-props label.check-row { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.ne-prop-title { font-weight: 600; }
.ne-scale { display: flex; gap: 6px; }
.ne-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ne-issues { display: flex; flex-direction: column; gap: 6px; }
.ne-issue { padding: 8px 10px; border-radius: var(--radius); font-size: 13px; border: 1px solid var(--border); cursor: pointer; }
.ne-issue.error { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.ne-issue.warn { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.ne-issue.ok { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.ne-footer { display: flex; align-items: center; gap: 10px; justify-content: space-between; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.ok-text { color: #166534; font-size: 13px; }
@media (max-width: 700px) { .nav-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 55vh; } .nav-editor { display: none !important; } }

.nav-link { font-size: 13px; }
.ne-bld { display: flex; flex-direction: column; gap: 8px; }
.ne-bld-row { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.ne-bld-geo, .ne-bld-actions { display: flex; gap: 6px; }
.ne-bld-row input { min-height: 32px; min-width: 0; flex: 1; }

/* поиск сотрудника или места в панели «Как пройти» */
.nav-search { width: 100%; min-height: 36px; }
.nav-results { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 220px; overflow-y: auto; }
.nav-results[hidden] { display: none; }
.nav-result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.nav-result:last-child { border-bottom: 0; }
.nav-result:hover, .nav-result:focus-visible { background: var(--surface-2, rgba(0, 0, 0, 0.05)); }
.nav-result span { color: var(--text-muted); font-size: 12px; }
.nav-none { padding: 8px 10px; color: var(--text-muted); font-size: 13px; }

/* шапка: при нехватке места кнопки сжимаются до значков (вместе с правилом в style.css), иначе правая группа налезает на «сейчас» у выбора момента */
@media (max-width: 1560px) { .btn-presence .txt { display: none; } .search-panel { width: clamp(140px, 11vw, 300px); } }
@media (max-width: 1500px) { #btnRoute .txt { display: none; } }

/* режим редактирования: на экранах уже 1560 px панель инструментов сжимается, иначе она налезает на кнопки слева (проходы, QR-таблички) */
@media (max-width: 1560px) {
    body.edit-mode .hr-panel input[type="text"] { width: 110px; }
    body.edit-mode .hr-panel select { max-width: 110px; }
    body.edit-mode .btn-office-add span { display: none; }
    body.edit-mode #adminMenu > summary { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
