/* Portaler — кастомные стили поверх React-бандла */

:root {
  --pa-map-info-left: 74px;
}

/* --- UI-патчи --- */
.style_userBlockWrapper__KgEBq {
  display: none !important;
}

.p-hidden {
  display: none !important;
}

/* --- Кнопка админа в сайдбаре (как остальные вкладки) --- */
body.pa-open .style_sidebarNavigationWrapper__d2pEW,
body.pa-open .style_sidebarNavigationWrapper__d2pEW *,
body.pa-open .style_sidebarTabs__dOgnG,
body.pa-open .style_sidebarTabs__dOgnG * {
  transition: none !important;
}

body.pa-open .style_sidebarTabs__dOgnG .style_sidebarButtonWrapper__BR-Di:not(#pa-tab) {
  background-color: transparent !important;
}

body.pa-open .style_sidebarTabs__dOgnG .style_sidebarButtonWrapper__BR-Di:not(#pa-tab).style_tabActive__04Rrf {
  background-color: transparent !important;
}

body.pa-open .style_sidebarTabs__dOgnG .style_sidebarButtonWrapper__BR-Di:not(#pa-tab) img {
  opacity: 0.72;
}

body.pa-open .style_sidebarTabs__dOgnG .style_sidebarButtonWrapper__BR-Di:not(#pa-tab) .style_tabDot__fFh4W,
body.pa-open .style_sidebarTabs__dOgnG .style_sidebarButtonWrapper__BR-Di:not(#pa-tab) .style_tabDotActive__rxk4P {
  height: 5px !important;
  opacity: 0 !important;
  width: 5px !important;
}

#pa-tab.style_sidebarButtonWrapper__BR-Di {
  align-items: center;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 55px;
  justify-content: center;
  margin: 8px 0;
  position: relative;
  width: 55px;
}

#pa-tab.style_sidebarButtonWrapper__BR-Di:not(.style_tabActive__04Rrf):hover {
  background-color: #262729;
}

#pa-tab.style_sidebarButtonWrapper__BR-Di:not(.style_tabActive__04Rrf):hover .style_tabDot__fFh4W {
  opacity: 1;
}

#pa-tab.style_tabActive__04Rrf.style_sidebarButtonWrapper__BR-Di {
  background-color: #262729;
}

#pa-tab .style_tabDot__fFh4W {
  background-color: #b6bac3;
  border-radius: 50%;
  bottom: -2px;
  height: 5px;
  opacity: 0;
  position: absolute;
  width: 5px;
}

#pa-tab.style_tabActive__04Rrf .style_tabDot__fFh4W,
#pa-tab.style_tabActive__04Rrf .style_tabDotActive__rxk4P {
  border-radius: 8px;
  height: 4px;
  opacity: 1;
  width: 30px;
}

#pa-tab.style_sidebarButtonWrapper__BR-Di img {
  display: block;
  flex-shrink: 0;
  height: 28px;
  pointer-events: none;
  width: 28px;
}

body.pa-open .style_layoutContent__UeBIV {
  pointer-events: none !important;
  visibility: hidden !important;
}

body.pa-open .style_sidebarContentWrapper__UvPw6 > .style_wrapper__vOo7h {
  display: flex !important;
  flex-shrink: 0;
}

/* Скрываем только React-панель вкладки (Add Connection и т.д.), не логотип Portaler */
body.pa-open .style_sidebarContentWrapper__UvPw6 {
  transition: none !important;
}

body.pa-open .style_sidebarContentWrapper__UvPw6 > div:not(#pa-list-mount):not(.style_wrapper__vOo7h) {
  display: none !important;
}

#pa-list-mount {
  box-sizing: border-box;
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px 0 12px;
  width: 100%;
}

#pa-list-mount,
#pa-list-mount *,
#pa-list-mount .pa__list-host {
  animation: none !important;
  transition: none !important;
}

body.pa-open #pa-list-mount {
  display: flex;
  -webkit-user-select: text !important;
  user-select: text !important;
}

#pa-list-mount .pa--sidebar,
#pa-list-mount .pa__btn,
#pa-list-mount .pa__input {
  -webkit-user-select: text !important;
  user-select: text !important;
}

#pa-list-mount .pa__server-row,
#pa-list-mount .pa__server-row * {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none !important;
  user-select: none !important;
}

#pa-list-mount .pa__server-sub {
  -webkit-user-select: text !important;
  cursor: text;
  user-select: text !important;
}

#pa-list-mount .pa__list-pane {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

body.pa-open .style_layoutHeader__mgptw {
  display: none !important;
}

#pa-mount {
  background: #262729;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 16px 20px;
  scrollbar-gutter: stable;
  z-index: 100;
}

body.pa-open #pa-mount {
  display: flex;
  -webkit-user-select: text !important;
  user-select: text !important;
}

#pa-mount .pa,
#pa-mount .pa__detail,
#pa-mount .pa__detail-pane,
#pa-mount .pa__access-card,
#pa-mount .pa__map-card {
  -webkit-user-select: text !important;
  user-select: text !important;
}

.pa__server-name,
.pa__server-sub,
.pa__detail-title,
.pa__detail-id,
.pa__access-card-id,
.pa__access-card-name,
.pa__map-card-name {
  -webkit-user-select: text !important;
  user-select: text !important;
  cursor: text;
}

/* Правая колонка + футер до низа экрана */
.style_background__XYI0I {
  min-height: 100vh !important;
}

.style_background__XYI0I > .ant-layout {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}

.style_layoutHeader__mgptw {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  height: 10vh !important;
  min-height: 56px !important;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  width: 100% !important;
}

.style_layoutContent__UeBIV {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.style_mapContainer__QbUhS {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  height: 100% !important;
  justify-content: flex-end !important;
  min-height: 0 !important;
  width: 100% !important;
}

.style_mapGraph__SR3hG {
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding-bottom: 48px !important;
  position: relative !important;
  width: 100% !important;
}

.style_mapInfo__4RvNZ {
  background-color: #262729 !important;
  border-top: 1px solid #313338;
  bottom: 0 !important;
  box-sizing: border-box !important;
  left: var(--pa-map-info-left, 74px) !important;
  padding: 12px 16px !important;
  position: fixed !important;
  right: 0 !important;
  z-index: 50 !important;
}

body.pa-open .style_mapInfo__4RvNZ {
  pointer-events: none !important;
  visibility: hidden !important;
}

body:not(.pa-open) .style_layoutContent__UeBIV {
  pointer-events: auto !important;
  visibility: visible !important;
}

body:not(.pa-open) .style_mapInfo__4RvNZ {
  display: block !important;
  visibility: visible !important;
}

/* Сайдбар: вкладка Location — без наложения блоков */
.style_sidebarContentWrapper__UvPw6 > div[style*="paddingBottom"] {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 24px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_styledBlockWrapper__CnihF {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.style_sidebarContentWrapper__UvPw6 .style_styledBlockWrapper__CnihF > div {
  flex-wrap: wrap;
}

/* Zone Map: без POI-маркеров на заглушке «No data (yet)» */
.style_sidebarContentWrapper__UvPw6 div[style*="aspect-ratio"]:has(img[src*="no-data-map"]) > div[style*="z-index: 2"] {
  display: none !important;
  pointer-events: none !important;
}

/* Zone Map: POI-маркеры (иконка + тултип как в оригинале) */
.style_sidebarContentWrapper__UvPw6 [data-pa-zone-markers] {
  pointer-events: none;
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker {
  cursor: pointer;
  pointer-events: auto;
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker img {
  display: block;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker-tip {
  background: rgba(31, 31, 31, 0.96);
  border-radius: 8px;
  bottom: calc(100% + 8px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  color: #fff;
  display: none;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  left: 50%;
  line-height: 1.45;
  min-width: 160px;
  padding: 8px 12px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 20;
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker-tip::after {
  border: 6px solid transparent;
  border-top-color: rgba(31, 31, 31, 0.96);
  content: "";
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker-tip-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.style_sidebarContentWrapper__UvPw6 .pa-zone-marker:hover .pa-zone-marker-tip,
.style_sidebarContentWrapper__UvPw6 .pa-zone-marker.pa-zone-marker-open .pa-zone-marker-tip {
  display: block;
}

.style_layoutFooter__byknc {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  height: auto !important;
  margin-top: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.style_layoutFooter__byknc .style_background__P\+sTA,
.style_layoutFooter__byknc [class*="background__"] {
  align-items: flex-end !important;
  min-height: 0 !important;
  padding-bottom: 0 !important;
}

body.pa-open #pa-mount .pa--main {
  flex: 1;
  margin: 0;
  max-width: none;
  min-height: 0;
  width: 100%;
}

.pa--sidebar {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.pa--main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.pa--main .pa__detail-pane {
  background: transparent;
  border: none;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* --- Селектор серверов (Settings → User Info) --- */
.style_sidebarContentWrapper__UvPw6 .ant-select,
.style_sidebarContentWrapper__UvPw6 .ant-select * {
  transition: none !important;
}

/* Ant Design inline-panel: убирает paddingBottom при открытии — из-за него всё прыгает */
.style_sidebarContentWrapper__UvPw6 div:has(> .ant-select.style_input__IrLoR) {
  min-width: unset !important;
  padding-bottom: 0 !important;
  width: 100%;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR.ant-select {
  display: block;
  width: 100%;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-selector,
.p-server-select .ant-select-selector {
  align-items: center !important;
  background-color: #262729 !important;
  border: 1px solid #313338 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  height: 52px !important;
  max-height: 52px !important;
  min-height: 52px !important;
  padding: 8px 12px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR.ant-select-open .ant-select-selector,
.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR.ant-select-focused .ant-select-selector,
.p-server-select.ant-select-open .ant-select-selector,
.p-server-select.ant-select-focused .ant-select-selector {
  border-color: #9c2020 !important;
  box-shadow: none !important;
  height: 52px !important;
  max-height: 52px !important;
  min-height: 52px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-selection-item,
.p-server-select .ant-select-selection-item {
  align-items: center !important;
  color: #9ca3af !important;
  display: flex !important;
  font-weight: 500 !important;
  gap: 8px;
  line-height: 1.2 !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-selection-item img,
.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-item-option-content img,
.p-server-select .ant-select-selection-item img,
.p-server-select .ant-select-item-option-content img {
  flex-shrink: 0;
  height: 32px !important;
  max-height: 32px !important;
  max-width: 32px !important;
  object-fit: contain;
  width: 32px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-arrow,
.p-server-select .ant-select-arrow {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  height: auto;
  line-height: 0;
  width: auto;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-arrow img,
.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-suffix img,
.p-server-select .ant-select-arrow img,
.p-server-select .ant-select-suffix img {
  flex-shrink: 0;
  height: 14px !important;
  max-height: 14px !important;
  max-width: 14px !important;
  object-fit: contain;
  width: 14px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-arrow .anticon,
.p-server-select .ant-select-arrow .anticon {
  display: none !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-item-option-state img,
.p-server-select .ant-select-item-option-state img {
  flex-shrink: 0;
  height: 14px !important;
  max-height: 14px !important;
  max-width: 14px !important;
  width: 14px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-dropdown,
.p-server-dropdown.ant-select-dropdown {
  background: #262729 !important;
  border-radius: 8px !important;
  padding: 4px !important;
  position: absolute !important;
  z-index: 30 !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-item,
.p-server-dropdown .ant-select-item {
  align-items: center !important;
  box-sizing: border-box !important;
  height: 52px !important;
  max-height: 52px !important;
  min-height: 52px !important;
  padding: 8px 12px !important;
}

.style_sidebarContentWrapper__UvPw6 .style_input__IrLoR .ant-select-item-option-content,
.p-server-dropdown .ant-select-item-option-content {
  align-items: center !important;
  display: flex !important;
  font-weight: 500 !important;
  gap: 8px;
  line-height: 1.2 !important;
}

.p-server-select {
  width: 100%;
}

/* --- Админ-панель --- */
.pa {
  --pa-accent: #5865f2;
  --pa-accent-hover: #4752c4;
  --pa-accent-soft: rgba(88, 101, 242, 0.14);
  --pa-surface: #18191c;
  --pa-surface-2: #1e1f22;
  --pa-border: #2b2d31;
  --pa-text-muted: #949ba4;
  box-sizing: border-box;
  color: #f7f7f7;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, sans-serif;
  gap: 12px;
  height: 100%;
  margin: 0;
  max-width: none;
  min-height: 0;
  padding: 0;
  width: 100%;
}

.pa *,
.pa *::before,
.pa *::after {
  box-sizing: border-box;
}

.pa__search {
  align-items: stretch;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.pa__error {
  background: #3d1a1a;
  border: 1px solid #5c1a1a;
  border-radius: 8px;
  color: #f7a0a0;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
}

.pa__error[hidden] {
  display: none;
}

.pa__placeholder {
  align-items: center;
  color: #717886;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 100px;
  padding: 16px 12px;
  text-align: center;
}

.pa__placeholder-icon {
  color: #4a4d55;
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}

.pa__placeholder-title {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
}

.pa__placeholder-hint {
  font-size: 12px;
  line-height: 1.45;
  max-width: 220px;
}

.pa__placeholder .pa__btn--block {
  margin-top: 8px;
}

.pa__server-row {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  box-sizing: border-box;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr);
  height: 48px;
  margin: 0;
  max-height: 48px;
  min-height: 48px;
  padding: 8px 10px 8px 12px;
  pointer-events: auto;
  text-align: left;
  width: 100%;
}

#pa-list-mount .pa__server-row {
  contain: layout size style;
  flex: 0 0 48px;
  height: 48px !important;
  max-height: 48px !important;
  min-height: 48px !important;
  transform: none !important;
}

#pa-list-mount .pa__server-row:hover,
#pa-list-mount .pa__server-row:active,
#pa-list-mount .pa__server-row[aria-selected='true'] {
  height: 48px !important;
  max-height: 48px !important;
  min-height: 48px !important;
  padding: 8px 10px 8px 12px !important;
  transform: none !important;
}

.pa__server-row:focus,
.pa__server-row:focus-visible,
.pa__server-row:active {
  box-shadow: none !important;
  outline: none !important;
}

.pa__server-row .pa__server-icon,
.pa__server-row .pa__server-icon--sm,
.pa__server-row img.pa__server-icon {
  display: block;
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  height: 32px !important;
  max-height: 32px !important;
  max-width: 32px !important;
  min-height: 32px !important;
  min-width: 32px !important;
  object-fit: cover;
  width: 32px !important;
}

.pa__server-row .pa__server-meta {
  align-self: center;
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.pa__server-row .pa__server-name,
.pa__server-row .pa__server-sub {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  transform: none;
}

.pa__server-row .pa__server-sub {
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

.pa__search-input {
  flex: 1;
  min-width: 0;
}

.pa__search .pa__btn--primary {
  flex-shrink: 0;
  min-width: 110px;
}

.pa__layout {
  display: grid;
  flex: 1 1 0;
  gap: 12px;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.pa__list-pane,
.pa__detail-pane {
  background: #1e1f22;
  border: 1px solid #313338;
  border-radius: 12px;
  min-height: 0;
  overflow-x: hidden;
  padding: 10px;
}

.pa__list-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.pa__list-title {
  color: #949ba4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.pa__list-pane .pa__search {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 6px;
}

.pa__list-pane .pa__search .pa__btn--primary {
  min-width: 0;
  width: 100%;
}

.pa__list-host {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.pa__list-host::-webkit-scrollbar {
  width: 6px;
}

.pa__list-host::-webkit-scrollbar-thumb {
  background: #3f4147;
  border-radius: 3px;
}

.pa__list-host > .pa__server-row {
  flex-shrink: 0;
}

.pa__server-row[aria-selected='true'] {
  background: var(--pa-accent-soft);
}

.pa__server-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pa__server-row[aria-selected='true']:hover {
  background: var(--pa-accent-soft);
}

.pa__detail-pane {
  display: flex;
  flex-direction: column;
  min-height: 120px;
  min-width: 0;
  overflow: hidden;
  padding: 12px 14px;
}

.pa__detail-pane .pa__detail {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

#pa-mount .pa__server-row,
#pa-mount .pa__btn,
#pa-mount .pa__input {
  pointer-events: auto;
}

#pa-mount .pa__btn,
#pa-mount .pa__perm-btn,
#pa-mount .pa__map-order-btn,
#pa-mount .pa__access-card-close,
#pa-mount .pa__map-card-btn,
#pa-mount .pa__map-card-close,
#pa-mount .pa__modal-close {
  -webkit-user-select: none !important;
  user-select: none !important;
  cursor: pointer;
}

.pa__block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pa__label {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pa__hint {
  color: #717886;
  font-size: 12px;
  margin: -4px 0 0;
}

.pa__form,
.pa__access-form,
.pa__map-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa__actions {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 480px) {
  .pa__actions {
    align-items: center;
    flex-direction: row;
  }

  .pa__actions .pa__perm {
    flex: 1;
    min-width: 0;
  }

  .pa__actions .pa__btn--primary {
    flex-shrink: 0;
    min-width: 100px;
  }
}

.pa__input {
  background: #18191c;
  border: 1px solid #313338;
  border-radius: 8px;
  color: #f7f7f7;
  font-family: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.pa__input::placeholder {
  color: #717886;
}

.pa__input--sm {
  font-size: 13px;
  min-height: 36px;
  padding: 7px 10px;
}

.pa__input:focus {
  border-color: var(--pa-accent);
  box-shadow: 0 0 0 2px var(--pa-accent-soft);
  outline: none;
}

/* Сегментный выбор: Чтение / Редактирование */
.pa__perm {
  background: #18191c;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
  width: 100%;
}

.pa__perm-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  padding: 6px 8px;
  transition: background 0.15s, color 0.15s;
}

.pa__perm-btn:hover {
  color: #f7f7f7;
}

.pa__perm-btn--active {
  background: var(--pa-accent-soft);
  color: #eef0ff;
  font-weight: 600;
}

.pa__perm--sm {
  padding: 3px;
}

.pa__perm--sm .pa__perm-btn {
  font-size: 11px;
  min-height: 30px;
  padding: 4px 6px;
}

.pa__btn--sm {
  font-size: 13px;
  min-height: 36px;
  padding: 7px 12px;
}

.pa__btn--danger-sm {
  background: transparent;
  border: 1px solid #5c1a1a;
  color: #ea4949;
  flex-shrink: 0;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
}

.pa__btn--danger-sm:hover:not(:disabled) {
  background: #5c1a1a;
  color: #f7f7f7;
}

.pa__btn {
  background: #313338;
  border: none;
  border-radius: 8px;
  color: #f7f7f7;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 10px 14px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.pa__btn:hover:not(:disabled) {
  background: #3d3f45;
}

.pa__btn:active:not(:disabled) {
  transform: translateY(1px);
}

.pa__modal .pa__btn:active:not(:disabled) {
  transform: none;
}

.pa__btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pa__btn--primary {
  background: linear-gradient(180deg, #6b77f7 0%, var(--pa-accent) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 2px 8px rgba(88, 101, 242, 0.28);
  color: #fff;
  font-weight: 600;
}

.pa__btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #7b86f8 0%, var(--pa-accent-hover) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 4px 14px rgba(88, 101, 242, 0.35);
}

.pa__btn--danger {
  background: transparent;
  border: 1px solid #5c1a1a;
  color: #ea4949;
  margin-top: 4px;
}

.pa__btn--danger:hover:not(:disabled) {
  background: #5c1a1a;
  color: #f7f7f7;
}

.pa__btn--ghost {
  background: transparent;
  color: #9ca3af;
  flex-shrink: 0;
  font-size: 12px;
  min-height: auto;
  padding: 4px 8px;
}

.pa__btn--ghost:hover:not(:disabled) {
  background: #313338;
  color: #f87171;
}

.pa__btn--block {
  width: 100%;
}

/* Детали сервера */
.pa__detail {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.pa__detail-head {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 12px;
}

.pa__detail-head-meta {
  flex: 1;
  min-width: 0;
}

.pa__detail-title {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__detail-id {
  color: #717886;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__detail-grid {
  align-items: stretch;
  display: grid;
  flex: 1 1 0;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}

.pa__detail-grid > .pa__section--card {
  min-height: 0;
  overflow: hidden;
}

.pa__detail-grid .pa__section-title,
.pa__detail-grid .pa__access-add {
  flex-shrink: 0;
}

.pa__detail-grid .pa__access-cards {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.pa__detail-grid .pa__access-cards > .pa__access-card,
.pa__detail-grid .pa__access-cards > .pa__empty {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .pa__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .pa__list-pane {
    max-height: 160px;
  }

  .pa__detail-grid {
    grid-template-columns: 1fr;
  }
}

.pa__section--card {
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
}

.pa__section-title {
  color: var(--pa-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.pa__section--maps {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pa__section--maps .pa__section-title,
.pa__section--maps .pa__access-add {
  flex-shrink: 0;
}

.pa__map-cards {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.pa__map-cards > .pa__map-card,
.pa__map-cards > .pa__empty {
  flex-shrink: 0;
}

.pa__access-cards::-webkit-scrollbar,
.pa__map-cards::-webkit-scrollbar {
  width: 6px;
}

.pa__access-cards::-webkit-scrollbar-thumb,
.pa__map-cards::-webkit-scrollbar-thumb {
  background: #3f4147;
  border-radius: 3px;
}

.pa__map-card {
  background: #1e1f22;
  border: 1px solid #2f3136;
  border-radius: 8px;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
}

.pa__map-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
}

.pa__map-card-order {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
}

.pa__map-order-btn {
  background: #2b2d31;
  border: none;
  border-radius: 4px;
  color: #b5bac1;
  cursor: pointer;
  font-size: 11px;
  height: 18px;
  line-height: 1;
  padding: 0;
  width: 22px;
}

.pa__map-order-btn:hover:not(:disabled) {
  background: #313338;
  color: #f2f3f5;
}

.pa__map-order-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

.pa__map-card-line {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.pa__map-card-name {
  color: #f2f3f5;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__map-card-actions {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.pa__map-card-btn,
.pa__map-card-close {
  background: transparent;
  border: none;
  color: #949ba4;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.pa__map-card-btn:hover,
.pa__map-card-close:hover {
  color: #f2f3f5;
}

.pa__map-card--expanded {
  border-color: #404249;
}

.pa__map-card-body {
  border-top: 1px solid #2f3136;
  margin-top: 8px;
  padding-top: 8px;
}

.pa__map-card-body--hidden {
  display: none;
}

.pa__map-access-toggle {
  align-items: center;
  color: #b5bac1;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 6px;
  margin-bottom: 8px;
}

.pa__map-access-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 0;
}

.pa__map-access-hint {
  font-size: 11px;
  padding: 2px 0 4px;
}

.pa__map-access-panel {
  min-width: 0;
  overflow: hidden;
}

.pa__section--compact {
  background: #25262a;
  border: 1px solid #2f3136;
  border-radius: 6px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 8px;
}

.pa__section--compact .pa__section-title {
  font-size: 12px;
  margin: 0 0 6px;
}

.pa__section--compact .pa__access-cards {
  max-height: 140px;
  overflow-x: hidden;
  overflow-y: auto;
}

.pa__section--compact .pa__access-card {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.pa__section--compact .pa__access-card-line {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.pa__section--compact .pa__access-card-sep {
  display: none;
}

.pa__section--compact .pa__access-card-id {
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa__section--compact .pa__access-card-name {
  font-size: 12px;
  max-width: 100%;
}

.pa__section--compact .pa__perm--card .pa__perm-btn {
  font-size: 10px;
  line-height: 1.2;
  min-height: 24px;
  padding: 4px 2px;
  white-space: normal;
}

@media (max-width: 720px) {
  .pa__map-access-grid {
    grid-template-columns: 1fr;
  }
}

.pa__access-form--compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa__access-bottom {
  align-items: stretch;
  display: flex;
  gap: 6px;
}

.pa__access-bottom .pa__perm {
  flex: 1;
  min-width: 0;
}

.pa__access-bottom .pa__btn--sm {
  flex-shrink: 0;
  min-width: 36px;
  padding: 7px 10px;
}

.pa__list--scroll {
  max-height: 140px;
  overflow-y: auto;
}

.pa__maps-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa__maps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.pa__map-chip {
  align-items: center;
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  padding: 6px 10px 6px 12px;
}

.pa__map-chip .pa__map-name {
  font-weight: 500;
}

.pa__map-name--editable {
  cursor: pointer;
}

.pa__map-name--editable:hover {
  color: #c7cdff;
}

.pa__map-name-input {
  max-width: 140px;
  min-width: 80px;
}

.pa__perm--inline {
  flex-shrink: 0;
  gap: 2px;
}

.pa__perm--inline .pa__perm-btn {
  font-size: 10px;
  min-height: 24px;
  padding: 2px 6px;
}

.pa__row--compact {
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
}

.pa__row--access {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
}

.pa__row-access-top {
  align-items: center;
  display: flex;
  gap: 6px;
  width: 100%;
}

.pa__row--access .pa__row-id {
  flex: 1;
  min-width: 0;
}

.pa__row--access .pa__perm--inline {
  width: 100%;
}

.pa__map-chip .pa__btn--ghost {
  border-radius: 999px;
  color: var(--pa-text-muted);
  min-height: 22px;
  padding: 2px 6px;
}

.pa__map-create {
  width: 100%;
}

.pa__map-create-row {
  align-items: stretch;
  display: flex;
  gap: 8px;
  width: 100%;
}

.pa__map-create-row .pa__input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.pa__map-create-row .pa__btn--primary {
  flex-shrink: 0;
  min-width: 96px;
}

.pa__map-form--inline {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.pa__map-form--inline .pa__input {
  width: 140px;
}

.pa__server-icon {
  border-radius: 50%;
  flex-shrink: 0;
  height: 40px;
  object-fit: cover;
  width: 40px;
}

.pa__server-icon--sm {
  height: 32px;
  width: 32px;
}

.pa__server-icon--placeholder {
  align-items: center;
  background: linear-gradient(135deg, #9c2020, #6b1515);
  color: #fff;
  display: flex;
  font-size: 16px;
  font-weight: 600;
  justify-content: center;
}

.pa__server-meta {
  flex: 1;
  min-width: 0;
}

.pa__server-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__server-sub {
  color: #717886;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa__row {
  align-items: center;
  background: #18191c;
  border: 1px solid #262729;
  border-radius: 8px;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding: 10px 12px;
}

.pa__row--compact .pa__row-id {
  font-size: 11px;
}

.pa__row--compact .pa__btn--ghost {
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
}

.pa__row--map {
  padding: 10px 10px 10px 12px;
}

.pa__row--map .pa__map-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__row-id {
  flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__badge {
  background: #313338;
  border-radius: 6px;
  color: #c4c8d0;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
}

.pa__badge--edit {
  background: var(--pa-accent-soft);
  color: #c7cdff;
}

/* --- Доступ: карточки и модалка --- */
.pa__access-add {
  margin-bottom: 6px;
}

.pa__btn--access-add {
  align-self: flex-start;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  height: 28px;
  line-height: 1;
  min-height: 0;
  padding: 0 12px;
  width: auto;
}

.pa__access-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa__access-card {
  background: #1e1f22;
  border: 1px solid #2f3136;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
}

.pa__access-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.pa__access-card-line {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.pa__access-card-id {
  color: #b5bac1;
  flex-shrink: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.pa__access-card-sep {
  color: #4e5058;
  flex-shrink: 0;
}

.pa__access-card-name {
  color: #f2f3f5;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__access-card-close {
  background: transparent;
  border: none;
  color: #949ba4;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.pa__access-card-close:hover {
  color: #f2f3f5;
}

.pa__perm--card,
.pa__perm--modal {
  width: 100%;
}

.pa__perm--card .pa__perm-btn,
.pa__perm--modal .pa__perm-btn {
  min-height: 28px;
  white-space: nowrap;
}

body.pa-modal-open {
  overflow: hidden;
}

.pa__modal-overlay {
  --pa-accent: #5865f2;
  --pa-accent-hover: #4752c4;
  --pa-accent-soft: rgba(88, 101, 242, 0.14);
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: fixed;
  z-index: 10000;
  -webkit-user-select: text;
  user-select: text;
}

.pa__modal button {
  -webkit-user-select: none;
  user-select: none;
}

.pa__modal {
  background: #1e1f22;
  border: 1px solid #2f3136;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
  color: #f2f3f5;
  flex-shrink: 0;
  font-family: Inter, system-ui, sans-serif;
  padding: 14px 16px;
  width: 340px;
}

.pa__modal--map-access {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 680px);
  overflow: hidden;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
}

.pa__modal--map-access .pa__modal-head {
  border-bottom: 1px solid #2f3136;
  margin-bottom: 0;
  padding: 14px 16px;
}

.pa__modal--map-access .pa__modal-title {
  font-size: 14px;
}

.pa__modal--map-access .pa__modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 16px;
}

.pa__modal--map-access .pa__modal-actions {
  border-top: 1px solid #2f3136;
  margin-top: 0;
  padding: 12px 16px;
}

.pa__modal--map-access .pa__btn--primary.pa__btn--modal {
  background: #5865f2;
  color: #fff;
  font-weight: 600;
  height: 34px;
  min-width: 96px;
}

.pa__modal--map-access .pa__btn--primary.pa__btn--modal:hover:not(:disabled) {
  background: #4752c4;
}

.pa__map-access-switch {
  align-items: flex-start;
  background: #25262a;
  border: 1px solid #2f3136;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.pa__map-access-switch-check {
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  padding-top: 2px;
}

.pa__map-access-switch-check input {
  accent-color: #5865f2;
  cursor: pointer;
  height: 16px;
  width: 16px;
}

.pa__map-access-switch-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pa__map-access-switch-label {
  color: #f2f3f5;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.pa__map-access-switch-hint {
  color: #949ba4;
  font-size: 11px;
  line-height: 1.35;
}

.pa__map-access-hint-box {
  background: #25262a;
  border: 1px dashed #3f4147;
  border-radius: 8px;
  color: #949ba4;
  font-size: 12px;
  line-height: 1.45;
  padding: 14px;
  text-align: center;
}

.pa__modal--map-access .pa__map-access-grid--modal {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}

.pa__modal-access-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pa__modal-access-col-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.pa__modal-access-col-title {
  color: #949ba4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
  text-transform: uppercase;
}

.pa__modal--map-access .pa__btn--access-add {
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  height: 26px;
  line-height: 1;
  min-height: 26px;
  padding: 0;
  width: 26px;
}

.pa__modal--map-access .pa__access-cards {
  background: #18191c;
  border: 1px solid #2f3136;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  min-height: 72px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
}

.pa__modal--map-access .pa__access-card {
  background: #1e1f22;
  border: 1px solid #2f3136;
  border-radius: 6px;
  flex-shrink: 0;
  gap: 6px;
  padding: 8px;
}

.pa__modal--map-access .pa__access-card-head {
  align-items: flex-start;
  gap: 4px;
}

.pa__modal--map-access .pa__access-card-line {
  align-items: flex-start;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.pa__modal--map-access .pa__access-card-sep {
  display: none;
}

.pa__modal--map-access .pa__access-card-name {
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.25;
  order: -1;
  white-space: normal;
}

.pa__modal--map-access .pa__access-card-id {
  color: #717886;
  font-size: 10px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa__modal--map-access .pa__access-card-close {
  font-size: 14px;
  margin-top: -2px;
  padding: 0 4px;
}

.pa__modal--map-access .pa__perm--card {
  padding: 2px;
}

.pa__modal--map-access .pa__perm--card .pa__perm-btn {
  font-size: 11px;
  min-height: 26px;
  padding: 4px 6px;
}

.pa__modal--map-access .pa__empty {
  color: #717886;
  font-size: 12px;
  padding: 20px 8px;
  text-align: center;
}

@media (max-width: 520px) {
  .pa__modal--map-access .pa__map-access-grid--modal {
    grid-template-columns: 1fr;
  }
}

.pa__modal * {
  box-sizing: border-box;
}

.pa__modal-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pa__modal-title {
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.pa__modal-close {
  background: transparent;
  border: none;
  color: #949ba4;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.pa__modal-close:hover {
  color: #f2f3f5;
}

.pa__modal .pa__input {
  font-size: 13px;
  height: 36px;
  line-height: 36px;
  margin-bottom: 10px;
  min-height: 0;
  padding: 0 10px;
  width: 100%;
}

.pa__modal-label {
  color: #949ba4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.pa__modal .pa__perm {
  padding: 3px;
}

.pa__modal .pa__perm-btn {
  font-size: 12px;
  min-height: 32px;
  padding: 4px 8px;
}

.pa__modal-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.pa__btn--modal {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  min-height: 0;
  padding: 0 14px;
}

.pa__modal .pa__btn--modal {
  height: 32px;
}

.pa__modal .pa__btn--primary.pa__btn--modal {
  background: var(--pa-accent);
  box-shadow: none;
  font-weight: 600;
}

.pa__modal .pa__btn--primary.pa__btn--modal:hover:not(:disabled) {
  background: var(--pa-accent-hover);
  box-shadow: none;
}

.pa__modal .pa__btn--modal:not(.pa__btn--primary) {
  background: transparent;
  color: #b5bac1;
}

.pa__modal .pa__btn--modal:not(.pa__btn--primary):hover:not(:disabled) {
  background: #2b2d31;
  color: #f2f3f5;
}

.pa__empty {
  color: #717886;
  font-size: 13px;
  padding: 4px 0;
}
