/* dashboard — главная, карта, фильтры. Только токены из app.css (var(--…)) и собственные --dash-*. */

:root {
  --dash-pin-ring: #ffffff;
  --dash-pin-edge: #2a1012;
  --dash-pin-shadow: rgba(42, 16, 18, .38);
  --dash-hero-glow: rgba(212, 33, 61, .55);
  --dash-hero-line: rgba(255, 255, 255, .09);
  --dash-hero-text: rgba(255, 255, 255, .74);
  --dash-hero-name: #ffc4cc;
  --dash-glass-line: rgba(42, 16, 18, .08);
  --dash-ending-text: #a50e26;
  --dash-ok-text: #23704a;
  --dash-sheet-peek: 114px;
}
:root[data-theme=dark] {
  --dash-pin-ring: #fff7f6;
  --dash-pin-edge: #120607;
  --dash-pin-shadow: rgba(0, 0, 0, .6);
  --dash-hero-glow: rgba(212, 33, 61, .42);
  --dash-glass-line: rgba(255, 255, 255, .08);
  --dash-ending-text: #ff8d9c;
  --dash-ok-text: #6fd29b;
}

/* ============ Герой ============ */
.dash-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 104px; padding: 18px 24px; margin-bottom: 16px;
  border-radius: var(--radius); color: var(--on-brand);
  background: radial-gradient(90% 160% at 100% 0%, var(--dash-hero-glow), transparent 58%), var(--grad-ink);
  box-shadow: var(--shadow); border: 1px solid var(--dash-hero-line);
}
.dash-hero-art { position: absolute; z-index: -1; right: 0; top: 0; width: min(62%, 620px); height: 100%; pointer-events: none; }
.dash-hero-art .grid { stroke: var(--dash-hero-line); stroke-width: 1; fill: none; }
.dash-hero-art .diag { stroke-width: 6; stroke: rgba(255, 255, 255, .04); }
.dash-hero-art .contours { stroke: rgba(255, 190, 198, .2); stroke-width: 1.2; fill: none; }
.dash-hero-art .pins { fill: rgba(255, 196, 204, .55); }
.dash-hero-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-hero-date {
  display: flex; align-items: center; gap: 6px;
  font: 600 11.5px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--dash-hero-text);
}
.dash-hero-date svg { width: 13px; height: 13px; }
.dash-hero-title { color: var(--on-brand); font: 700 22px/1.2 var(--font-head); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hero-title span { color: var(--dash-hero-name); }
.dash-hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hero-fact {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px;
  border-radius: 15px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08);
  color: var(--on-brand); font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
button.hero-fact:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.hero-fact:focus-visible { outline: 2px solid var(--on-brand); outline-offset: 2px; }
.hero-fact i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--st-free); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.hero-fact.is-alert i { background: var(--st-ending); }
.hero-fact.is-alert i::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--st-ending); animation: dashPing 1.8s ease-out infinite; }
.hero-fact.is-ok { cursor: default; }
.hero-fact.is-ok i { background: var(--st-active); }
.dash-hero-actions { display: flex; gap: 8px; flex: none; }
.hero-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: var(--on-brand); backdrop-filter: blur(6px); }
.hero-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); }
.hero-cta { box-shadow: 0 6px 18px rgba(179, 19, 41, .45); }
.dash-hero .btn svg { width: 16px; height: 16px; }

/* ============ Показатели ============ */
.dash-kpis { gap: 14px; margin-bottom: 16px; }
.dash-kpis .kpi {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  min-height: 146px; padding: 14px 16px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, border-color .2s;
}
.dash-kpis .kpi::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.dash-kpis .kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.dash-kpis .kpi:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus), var(--shadow-hover); }
.dash-kpis .kpi.active { border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone), var(--shadow-hover); }
.dash-kpis .kpi.active::after { transform: scaleX(1); }
.dash-kpis .kpi-top { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.dash-kpis .kpi-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 18%, transparent);
}
.dash-kpis .kpi-ink .kpi-icon { color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100); }
.dash-kpis .kpi-icon svg { width: 17px; height: 17px; }
.dash-kpis .kpi-label { font: 600 12.5px/1.25 var(--font); color: var(--ink-2); }
.kpi-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.dash-kpis .kpi-value {
  margin: 0; font: 700 34px/1 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.dash-kpis .kpi-sub { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.3; }
.kpi-ring { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.kpi-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.kpi-ring circle { fill: none; stroke-width: 3.4; }
.kpi-ring .trk { stroke: var(--track); }
.kpi-ring .val { stroke: var(--tone); stroke-linecap: round; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .3, 1); }
.kpi-ring b { font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.kpi-ring small { font-size: 8px; font-weight: 600; }
.kpi-stack { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.kpi-stack i { display: block; min-width: 3px; }
.bg-free { background: var(--st-free); }
.bg-occupied { background: var(--st-occupied); }
.bg-reserved { background: var(--st-reserved); }
.bg-active { background: var(--st-active); }
.bg-ending { background: var(--st-ending); }
.kpi-sum {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--dash-ok-text);
  padding: 5px 8px; border-radius: 7px; background: color-mix(in srgb, var(--st-active) 12%, transparent);
}

/* Акцентная плитка «Истекают» */
.dash-kpis .kpi.accent { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); }
.dash-kpis .kpi.accent::before {
  content: ''; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 0 0 22px rgba(255, 255, 255, .04); pointer-events: none;
}
.dash-kpis .kpi.accent::after { background: var(--on-brand); }
.dash-kpis .kpi.accent .kpi-label, .dash-kpis .kpi.accent .kpi-sub { color: rgba(255, 255, 255, .86); }
.dash-kpis .kpi.accent .kpi-icon { color: var(--on-brand); background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.dash-kpis .kpi.accent:hover { box-shadow: 0 2px 4px rgba(125, 12, 28, .2), 0 16px 36px rgba(179, 19, 41, .35); }
.dash-kpis .kpi.accent.active { box-shadow: 0 0 0 3px var(--brand-100), 0 16px 36px rgba(179, 19, 41, .35); }
.kpi-cols { display: flex; align-items: flex-end; gap: 6px; flex: none; }
.kpi-col { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 22px; }
.kpi-col b { font: 700 10.5px/1 var(--font); font-variant-numeric: tabular-nums; }
.kc-bar { display: flex; align-items: flex-end; width: 12px; height: 26px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.kc-bar i { display: block; width: 100%; background: rgba(255, 255, 255, .9); border-radius: 3px 3px 0 0; transition: height .9s cubic-bezier(.2, .8, .3, 1); }
.kpi-col small { font-size: 9.5px; font-weight: 600; opacity: .85; white-space: nowrap; }

.dash-kpis.enter .kpi { animation: dashUp .5s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.dash-hero { animation: dashUp .45s cubic-bezier(.2, .8, .3, 1) both; }

/* ============ Карта и боковая панель ============ */
.dash-map {
  position: relative; isolation: isolate;
  grid-template-columns: 360px 1fr;
  height: max(560px, calc(100vh - 128px)); min-height: 0;
  border-radius: calc(var(--radius) + 2px);
}
.dash-map .map-side { background: var(--card); position: relative; z-index: 2; box-shadow: 1px 0 0 var(--line); border-right: 0; }
.sheet-handle { display: none; }
.map-side-head { flex: none; background: var(--card); border-bottom: 1px solid var(--line); }
.dash-map .map-side-filters { padding: 14px 14px 12px; border-bottom: 0; gap: 10px; }
.dash-map .map-side-count {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 10px; border: 0; font-size: 12px; color: var(--muted);
}
.dash-map .map-side-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dash-map .map-side-count a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.dash-map .map-side-count a svg { width: 14px; height: 14px; }
.dash-map .map-side-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); scrollbar-width: thin; }

.dash-map .result {
  position: relative; overflow: hidden; display: flex; align-items: stretch; gap: 10px; flex: none;
  width: 100%; padding: 10px 12px 10px 16px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.dash-map .result::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.dash-map .result:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateX(2px); background: var(--card); }
.dash-map .result.active { border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent); background: var(--card); }
.dash-map .result:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.st-free { --tone: var(--st-free); }
.st-occupied { --tone: var(--st-occupied); }
.st-reserved { --tone: var(--st-reserved); }
.st-active { --tone: var(--st-active); }
.st-ending { --tone: var(--st-ending); }
.result-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.result-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dash-map .result-title { font: 700 16px/1.2 var(--font-head); letter-spacing: -.01em; }
.result-type { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-addr { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-map .result-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; flex: none; }
.result-st { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.result-days {
  font: 700 11px/1 var(--font); padding: 4px 7px; border-radius: 6px; white-space: nowrap;
  color: var(--dash-ending-text); background: var(--brand-50);
}
.result-date { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.dash-map .map { background: var(--track); }
.dash-map .map-wrap { isolation: isolate; }

/* Пустое состояние */
.dash-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 20px; }
.dash-empty b { color: var(--ink); font-size: 14px; }
.dash-empty > span:last-child { font-size: 12.5px; max-width: 260px; }
.dash-empty-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 8px; background: var(--card); color: var(--muted); box-shadow: var(--shadow); }
.dash-empty-ic svg { width: 24px !important; height: 24px !important; margin: 0 !important; color: inherit !important; }
.dash-empty-ic.ok { color: var(--st-active); background: color-mix(in srgb, var(--st-active) 12%, var(--card)); box-shadow: none; }

/* ============ Пины ============ */
.rpin-wrap { background: none; border: 0; }
.rpin-wrap:focus { outline: none; }
.rpin-wrap:focus-visible .rpin-body { stroke: var(--brand); stroke-width: 3.5; }
.rpin {
  position: relative; width: 28px; height: 37px; transform-origin: 50% 100%;
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1);
}
.rpin-wrap:hover .rpin { transform: scale(1.12); }
.rpin.is-hover { transform: scale(1.22); }
.rpin.is-selected { transform: scale(1.38); }
.rpin.is-selected .rpin-svg { filter: drop-shadow(0 4px 6px var(--dash-pin-shadow)); }
.rpin-svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 2px var(--dash-pin-shadow)); }
.rpin-body { fill: var(--tone); stroke: var(--dash-pin-ring); stroke-width: 2.4; }
.rpin-edge { fill: none; stroke: var(--dash-pin-edge); stroke-width: 6; }
.rpin-hole { fill: var(--dash-pin-ring); }
.rpin-g { fill: var(--tone); }
.rpin-gs { fill: none; stroke: var(--tone); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.rpin-free { --tone: var(--st-free); }
.rpin-occupied { --tone: var(--st-occupied); }
.rpin-reserved { --tone: var(--st-reserved); }
.rpin-active { --tone: var(--st-active); }
.rpin-ending { --tone: var(--st-ending); }
.rpin-pick { --tone: var(--brand); width: 32px; height: 42px; }
.rpin-pulse {
  position: absolute; left: 50%; bottom: -4px; width: 30px; height: 12px; margin-left: -15px;
  border-radius: 50%; border: 2px solid var(--st-ending); pointer-events: none;
  animation: pinPulse 1.9s ease-out infinite;
}
.dash-many .rpin-pulse { display: none; }
.rpin-num {
  position: absolute; left: calc(100% - 3px); top: 3px; z-index: -1;
  padding: 3px 7px 3px 8px; border-radius: 0 7px 7px 0;
  background: var(--card); color: var(--ink); font: 700 11px/1 var(--font); white-space: nowrap;
  box-shadow: 0 1px 4px var(--dash-pin-shadow); border-left: 3px solid var(--tone);
}
.rpin-mini { display: inline-block; width: 12px; height: 16px; flex: none; }
.rpin-mini .rpin-svg { filter: none; }
.rpin-mini .rpin-body { stroke-width: 1.5; }
.rpin-mini .rpin-edge { stroke-width: 5; }

.leaflet-tooltip.rpin-tip {
  padding: 6px 10px; border: 0; border-radius: 8px; box-shadow: var(--shadow-lg);
  background: var(--ink); color: var(--card); font: 500 12px/1.3 var(--font); max-width: 280px; white-space: nowrap;
}
.leaflet-tooltip.rpin-tip b { font-weight: 700; }
.leaflet-tooltip-top.rpin-tip::before { border-top-color: var(--ink); }

/* ============ Плавающие панели и элементы Leaflet ============ */
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-container { font-family: var(--font); background: var(--track); }

.map-legend {
  background: var(--glass); color: var(--ink);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--dash-glass-line); box-shadow: var(--shadow);
}
.dash-map .map-legend { left: 14px; bottom: 26px; gap: 6px 14px; padding: 9px 14px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.dash-map .map-legend span { gap: 6px; }

.map-geo .input, .map-geo .search-input .input {
  height: 42px; border-radius: 12px;
  background: var(--glass); color: var(--ink);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--dash-glass-line); box-shadow: var(--shadow);
}
.map-geo .search-input svg { z-index: 1; }
.map-geo .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus), var(--shadow); }
.dash-map .map-geo { top: 14px; right: 14px; }
.geo-results {
  background: var(--glass); color: var(--ink); border: 1px solid var(--dash-glass-line);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.geo-results button { color: var(--ink); border-bottom-color: var(--line); }
.geo-results button:hover { background: var(--hover); }

.leaflet-bar, .leaflet-touch .leaflet-bar {
  border: 1px solid var(--dash-glass-line) !important; border-radius: 12px !important; overflow: hidden;
  box-shadow: var(--shadow) !important; background-clip: padding-box;
}
.leaflet-bar a, .leaflet-touch .leaflet-bar a {
  width: 36px; height: 36px; line-height: 34px; font-size: 18px;
  background: var(--glass); color: var(--ink); border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.leaflet-bar a:hover, .leaflet-touch .leaflet-bar a:hover { background: var(--card); color: var(--brand); }
.leaflet-bar a.leaflet-disabled { background: var(--glass); color: var(--muted); opacity: .6; }
.leaflet-touch .leaflet-bar a:first-child { border-radius: 12px 12px 0 0; }
.leaflet-touch .leaflet-bar a:last-child { border-radius: 0 0 12px 12px; }
.map-ctl, .leaflet-touch .map-ctl {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--dash-glass-line);
  background: var(--glass); color: var(--ink); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.map-ctl:hover { background-color: var(--card); color: var(--brand); }
.map-ctl:focus-visible, .leaflet-bar a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.leaflet-control-layers, .leaflet-touch .leaflet-control-layers {
  border: 1px solid var(--dash-glass-line) !important; border-radius: 12px !important;
  background: var(--glass); color: var(--ink); box-shadow: var(--shadow) !important;
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.leaflet-control-layers-expanded { padding: 8px 12px; }
.leaflet-control-layers label { display: block; padding: 2px 0; }
.leaflet-control-layers-selector { accent-color: var(--brand); }
:root[data-theme=dark] .leaflet-control-layers-toggle { filter: invert(1) hue-rotate(180deg) brightness(1.2); }
.leaflet-control-attribution, .leaflet-container .leaflet-control-attribution {
  background: var(--glass); color: var(--muted); border-radius: 8px 0 0 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.leaflet-control-attribution a { color: var(--ink-2); }

/* Попап места */
.rpop .leaflet-popup-content-wrapper {
  padding: 0; overflow: hidden; border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.rpop .leaflet-popup-tip { background: var(--card); box-shadow: none; border: 1px solid var(--line); }
.rpop .leaflet-popup-content { margin: 0; width: 288px !important; font: 13px/1.45 var(--font); color: var(--ink); }
.rpop a.leaflet-popup-close-button {
  top: 10px; right: 10px; width: 28px; height: 28px; z-index: 2;
  display: grid; place-items: center; padding: 0; border-radius: 50%;
  font: 400 18px/1 var(--font); color: var(--on-brand); text-shadow: none;
  background: rgba(20, 8, 9, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rpop a.leaflet-popup-close-button:hover { background: rgba(20, 8, 9, .6); color: var(--on-brand); }
.rpop a.leaflet-popup-close-button span { line-height: 1; }
.pop { --tone: var(--st-occupied); animation: dashPop .22s cubic-bezier(.2, .8, .3, 1); }
.pop-free { --tone: var(--st-free); }
.pop-occupied { --tone: var(--st-occupied); }
.pop-reserved { --tone: var(--st-reserved); }
.pop-active { --tone: var(--st-active); }
.pop-ending { --tone: var(--st-ending); }
.pop-hero {
  position: relative; height: 128px; color: var(--on-brand);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 14px),
    radial-gradient(120% 120% at 85% 0%, color-mix(in srgb, var(--tone) 90%, transparent), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--tone) 55%, #2a1012), #1d0a0b);
  background-size: cover; background-position: center;
}
.pop-hero.has-photo { background-size: cover; background-position: center; }
.pop-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 8, 9, .72), rgba(20, 8, 9, 0) 62%); pointer-events: none; }
.pop-hero-ph {
  position: absolute; left: 14px; top: 12px; display: inline-flex; align-items: center; gap: 6px;
  font: 600 11px var(--font); color: rgba(255, 255, 255, .72);
}
.pop-hero-ph svg { width: 14px; height: 14px; }
.pop-hero-meta { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 11px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pop-num { font: 700 26px/1 var(--font-head); letter-spacing: -.02em; color: var(--on-brand); text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.pop-st {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 7px; border-radius: 13px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24); color: var(--on-brand);
  font: 700 11.5px var(--font); white-space: nowrap; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pop-content { padding: 13px 16px 16px; }
.pop-addr { font: 600 14px/1.35 var(--font); color: var(--ink); }
.pop-type { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pop-dl { display: grid; grid-template-columns: 18px 1fr; gap: 9px 10px; margin: 12px 0 0; }
.pop-dl dt { color: var(--muted); padding-top: 1px; }
.pop-dl dt svg { width: 16px; height: 16px; display: block; }
.pop-dl dd { margin: 0; color: var(--ink); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.pop-dl dd span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.pop-dl dd b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pop-term { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.pop-term-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.pop-term-row b { color: var(--ink); }
.pop-term.is-ending .pop-term-row b { color: var(--dash-ending-text); }
.pop-term-track { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.pop-term-track i { display: block; height: 100%; border-radius: 3px; background: var(--tone); }
.pop-free { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.leaflet-container a.pop-open, .pop-open { width: 100%; margin-top: 14px; height: 40px; color: var(--on-brand); box-shadow: 0 6px 16px rgba(179, 19, 41, .28); }
.leaflet-container a.pop-open:hover { color: var(--on-brand); }
.pop-open .pop-arrow { width: 16px; height: 16px; transform: rotate(180deg); }

/* ============ Фильтры ============ */
.fp .search-input svg { width: 17px; height: 17px; }
.fp-search .input { height: 42px; border-radius: 12px; background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.fp .input { background: var(--surface-2); color: var(--ink); }
.fp .chips { gap: 6px; }
.fp .chip {
  height: 30px; padding: 0 11px; gap: 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2);
  font: 600 12px var(--font); transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.fp .chip:hover { border-color: var(--muted); color: var(--ink); }
.fp .chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.fp .chip .dot { width: 8px; height: 8px; box-shadow: none; }
.fp .chip[data-quick=free], .fp .chip[data-status=free] { --tone: var(--st-free); }
.fp .chip[data-quick=le30], .fp .chip[data-status=ending] { --tone: var(--st-ending); }
.fp .chip[data-status=occupied] { --tone: var(--st-occupied); }
.fp .chip[data-status=reserved] { --tone: var(--st-reserved); }
.fp .chip[data-status=active] { --tone: var(--st-active); }
.fp .chip.on-free, .fp .chip.on-ending, .fp .chip[data-status].on {
  background: color-mix(in srgb, var(--tone) 14%, var(--surface-2)); border-color: var(--tone); color: var(--ink);
}
.fp .chip.on-free .dot, .fp .chip.on-ending .dot, .fp .chip[data-status].on .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 25%, transparent); }
.fp .chip.fp-toggle.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.fp .chip svg { width: 13px; height: 13px; }
.fp-chev { transition: transform .2s; }
.fp-chev.up { transform: rotate(180deg); }
.fp-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700;
}
.fp-n {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--track); color: var(--muted); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.fp .chip.on .fp-n { background: color-mix(in srgb, var(--tone, var(--ink)) 20%, transparent); color: var(--ink); }
.fp .more-filters { padding-top: 2px; animation: dashFade .2s ease; }
.fp .filters-grid select { height: 36px; border-radius: 10px; }
.fp-reset .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.fp-reset .link-btn svg { width: 12px; height: 12px; }

/* ============ Истекающие договоры ============ */
.dash-exp { margin-top: 18px; overflow: hidden; }
.exp-head { padding: 16px 20px; }
.exp-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.exp-title h2 { font-size: 17px; }
.exp-title .muted { font-size: 12.5px; }
.exp-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-100); }
.exp-ic svg { width: 20px; height: 20px; }
.exp-body { padding: 16px 20px 8px; }
.dash-exp .warn-tiles { gap: 12px; }
.dash-exp .warn-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); text-align: left; cursor: pointer;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, border-color .2s;
}
.dash-exp .warn-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.dash-exp .warn-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.dash-exp .warn-tile b { font: 700 34px/1 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wt-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wt-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.wt-on { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--card); }
.dash-exp .warn-tile .wt-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.wt-bar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.wt-bar i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.dash-exp .warn-30 { background: var(--card); }
.dash-exp .warn-30 .wt-label { color: var(--ink-2); }
.dash-exp .warn-30 .wt-bar i { background: color-mix(in srgb, var(--brand) 45%, var(--track)); }
.dash-exp .warn-15 { background: var(--brand-50); border-color: var(--brand-100); }
.dash-exp .warn-15 .wt-label, .dash-exp .warn-15 b { color: var(--dash-ending-text); }
.dash-exp .warn-15 .wt-bar { background: var(--brand-100); }
.dash-exp .warn-7 { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); }
.dash-exp .warn-7 .wt-sub, .dash-exp .warn-7 .wt-label { color: rgba(255, 255, 255, .86); }
.dash-exp .warn-7 .wt-bar { background: rgba(255, 255, 255, .2); }
.dash-exp .warn-7 .wt-bar i { background: var(--on-brand); }
.dash-exp .warn-7 .wt-on { background: var(--on-brand); color: var(--brand-700); }
.dash-exp .warn-tile.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow-hover); }

.exp-list { list-style: none; margin: 0; padding: 6px 12px 14px; }
.exp-item { position: relative; }
.exp-item::before { content: ''; position: absolute; left: 39px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.exp-item:first-child::before { top: 50%; }
.exp-item:last-child::before { bottom: 50%; }
.exp-item:only-child::before { display: none; }
.exp-link {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto 18px; align-items: center; gap: 16px;
  padding: 8px 12px 8px 12px; border-radius: 12px; color: var(--ink); text-decoration: none !important;
  transition: background .15s;
}
.exp-link:hover { background: var(--hover); }
.exp-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.exp-days {
  position: relative; z-index: 1; width: 56px; height: 52px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink);
}
.exp-days b { font: 700 19px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.exp-days small { font-size: 10px; font-weight: 600; opacity: .8; }
.lvl-warn .exp-days { background: var(--brand-50); border-color: var(--brand-100); color: var(--dash-ending-text); }
.lvl-crit .exp-days { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); box-shadow: 0 4px 12px rgba(179, 19, 41, .3); }
.exp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exp-row1 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.exp-row1 b { font: 700 15px var(--font-head); white-space: nowrap; }
.exp-co { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-addr { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.exp-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.exp-sum { font: 700 14px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 96px; text-align: right; }
.exp-go { color: var(--muted); display: grid; place-items: center; transition: transform .15s, color .15s; }
.exp-go svg { width: 16px; height: 16px; transform: rotate(180deg); }
.exp-link:hover .exp-go { color: var(--brand); transform: translateX(3px); }

/* ============ Анимации ============ */
@keyframes dashUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes dashFade { from { opacity: 0; } }
@keyframes dashPop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes dashPing { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes pinPulse { 0% { transform: scale(.35); opacity: .95; } 100% { transform: scale(1.5); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dash-kpis.enter .kpi, .dash-hero, .pop, .fp .more-filters { animation: none !important; }
  .hero-fact.is-alert i::after { animation: none; opacity: .5; transform: scale(1.1); }
  .rpin-pulse { animation: none; opacity: .7; transform: scale(1.1); }
  .rpin, .dash-kpis .kpi, .dash-map .result, .dash-exp .warn-tile { transition: none !important; }
}

/* ============ Адаптив ============ */
@media (max-width: 1280px) {
  .dash-kpis .kpi { min-height: 132px; }
}
@media (max-width: 1100px) {
  .dash-map { grid-template-columns: 320px 1fr; }
  .exp-meta { display: none; }
  .exp-link { grid-template-columns: 56px minmax(0, 1fr) auto 18px; }
}

@media (max-width: 900px) {
  .dash-hero { min-height: 0; padding: 14px 16px; margin-bottom: 12px; gap: 10px; }
  .dash-hero-actions { display: none; }
  .dash-hero-title { font-size: 18px; white-space: normal; }
  .dash-hero-date { font-size: 10.5px; }
  .dash-hero-facts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .dash-hero-facts::-webkit-scrollbar { display: none; }
  .hero-fact { height: 28px; font-size: 12px; }
  .dash-hero-art { width: 100%; opacity: .7; }

  /* Показатели — горизонтальная лента */
  .dash-kpis {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px 12px; padding: 2px 16px 8px; scroll-padding: 0 16px;
  }
  .dash-kpis::-webkit-scrollbar { display: none; }
  .dash-kpis .kpi { flex: 0 0 156px; min-height: 124px; padding: 12px; gap: 8px; scroll-snap-align: start; }
  .dash-kpis .kpi:hover { transform: none; }
  .dash-kpis .kpi-value { font-size: 28px; }
  .dash-kpis .kpi-sub { display: block; font-size: 11px; }
  .dash-kpis .kpi-label { font-size: 12px; }
  .dash-kpis .kpi-icon { width: 28px; height: 28px; border-radius: 9px; }
  .dash-kpis .kpi-icon svg { width: 15px; height: 15px; }
  .kpi-ring { width: 38px; height: 38px; }

  /* Карта на всю ширину, список — шторка снизу */
  .dash-map {
    display: block; position: relative; height: calc(100dvh - 140px); min-height: 460px;
    margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; overflow: hidden;
    scroll-margin-top: 68px;
  }
  .dash-map .map-wrap { position: absolute; inset: 0; min-height: 0; }
  .dash-map .map-side {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100; height: 82%;
    display: flex; flex-direction: column; border: 0; border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0; background: var(--card);
    box-shadow: 0 -10px 30px rgba(20, 8, 9, .18);
    transform: translateY(calc(100% - var(--dash-sheet-peek)));
    transition: transform .32s cubic-bezier(.2, .8, .3, 1);
  }
  .dash-map .map-side.open { transform: none; }
  .sheet-handle {
    display: grid; place-items: center; flex: none; width: 100%; height: 22px; padding: 0;
    border: 0; background: none; cursor: grab; touch-action: none;
  }
  .sheet-handle i { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .sheet-handle:focus-visible { outline: none; }
  .sheet-handle:focus-visible i { box-shadow: 0 0 0 3px var(--focus); }
  .map-side-head { border-bottom: 1px solid var(--line); }
  .dash-map .map-side-filters { padding: 0 14px 8px; }
  .dash-map .map-side:not(.open) .fp-quick,
  .dash-map .map-side:not(.open) .more-filters,
  .dash-map .map-side:not(.open) .fp-reset { display: none !important; }
  .dash-map .map-side-count { padding: 4px 16px 8px; }
  .dash-map .map-side-list { max-height: none; overscroll-behavior: contain; }
  .dash-map .map-side:not(.open) .map-side-list { overflow: hidden; }
  .dash-map .result:hover { transform: none; }

  .dash-map .leaflet-control-zoom { display: none; }
  .dash-map .leaflet-bottom { bottom: calc(var(--dash-sheet-peek) - 4px); }
  .dash-map .leaflet-control-attribution { font-size: 9px; }
  .dash-map .map-geo { top: 10px; right: 10px; width: calc(100% - 68px); }
  .dash-map .map-legend {
    top: 60px; bottom: auto; left: 10px; right: 10px; max-width: none;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding: 6px 10px; gap: 12px; font-size: 11px; border-radius: 10px;
  }
  .dash-map .map-legend::-webkit-scrollbar { display: none; }
  .dash-map .map-legend span { white-space: nowrap; }
  .rpop .leaflet-popup-content { width: 268px !important; }

  .dash-exp { margin-top: 14px; }
  .exp-head { padding: 14px 16px; flex-wrap: wrap; }
  .exp-body { padding: 14px 14px 6px; }
  .dash-exp .warn-tiles { gap: 8px; }
  .dash-exp .warn-tile { padding: 12px; }
  .dash-exp .warn-tile b { font-size: 26px; }
  .dash-exp .warn-tile .wt-sub { display: none; }
  .exp-list { padding: 4px 6px 10px; }
  .exp-link { grid-template-columns: 50px minmax(0, 1fr) 16px; gap: 12px; padding: 8px; }
  .exp-item::before { left: 32px; }
  .exp-days { width: 50px; height: 48px; }
  .exp-sum, .exp-meta { display: none; }
}
@media (max-width: 380px) {
  .dash-exp .warn-tile .wt-label { font-size: 11px; }
}

/* Рамка фокуса у карты — только при навигации с клавиатуры, не при клике мышью */
.leaflet-container:focus:not(:focus-visible) { outline: none; box-shadow: none; }
