/**
 * Оболочка CRM: левое меню, верхняя панель, контент.
 * Референс: CRM-подобная плотность, контраст для WCAG AA.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('./user-menu.css');
@import url('./notifications.css');

:root {
  --color-bg: #eef2f4;
  --color-surface: #ffffff;
  --color-sidebar: #525c69;
  --color-sidebar-hover: #6a737f;
  --color-sidebar-active: #3bc8f6;
  --color-text: #333333;
  --color-text-muted: #6a737f;
  --color-border: #dfe3e6;
  --color-accent: #2fc6f6;
  --color-accent-dark: #1fa6d6;
  --font-sans: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 56px;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --color-bg-subtle: #f6f8fa;
  --btn-gold-gradient: linear-gradient(135deg, #b47f2a 0%, #d4a74a 55%, #f1cf79 100%);
  --btn-gold-gradient-hover: linear-gradient(135deg, #9f6f22 0%, #c8973e 55%, #e6c068 100%);
  --btn-gold-gradient-active: linear-gradient(135deg, #8e611b 0%, #b88733 55%, #d9b255 100%);
  --btn-gold-text: #ffffff;
}

:root[data-theme='dark'] {
  --color-bg: #12161c;
  --color-surface: #1a2028;
  --color-sidebar: #1a1f27;
  --color-sidebar-hover: #242d38;
  --color-sidebar-active: #3bc8f6;
  --color-text: #e7edf5;
  --color-text-muted: #a6b0bc;
  --color-border: #2b3440;
  --color-accent: #42caf6;
  --color-accent-dark: #7bdcff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.38);
  --color-bg-subtle: #202833;
}

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

html {
  font-size: 14px;
  line-height: 1.45;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-feature-settings: 'cv01' 1, 'cv02' 1, 'cv03' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-text);
  background: var(--color-bg);
}

/* Более ровный вертикальный ритм в контенте */
p,
li,
.kanban__card,
.data-table td,
.data-table th {
  line-height: 1.5;
}

/* Базовая пластика интерфейса */
button,
[role='button'],
input,
select,
textarea,
.crm-chip,
.view-switcher button,
.panel,
.kanban__card,
.data-table tr td {
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* Плавное появление попапов и выпадающих блоков */
.notifications-popover,
.user-menu__popover,
.crm-module-nav__dropdown,
.crm-module-nav__contacts-panel,
.crm-chips__dropdown,
.portal-module-tabs__more-list,
.crm-logo-menu__popover {
  transform-origin: top right;
  animation: crm-popover-in 0.22s ease;
}

@keyframes crm-popover-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Более мягкий скролл в контейнерах */
.app-content,
.app-sidebar__scroll,
.kanban,
.kanban__column-body,
.table-wrap,
.notifications-popover__list {
  scroll-behavior: smooth;
}

/* Уважение к настройкам доступности */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body,
.app-main,
.crm-top-bar,
.crm-module-nav,
.crm-toolbar,
.crm-stack {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*
 * Канбан (лиды, сделки, дела, объекты и т.д.): правила с display:flex для шапки колонки
 * перебивают стандартное скрытие по [hidden] — панель редактирования остаётся видимой после «Сохранить».
 */
.kanban__stage-head-info[hidden],
.kanban__stage-head-form[hidden],
.kanban__column-header-edit-panel[hidden],
.kanban__stage-head-sum[hidden] {
  display: none !important;
}

a {
  color: var(--color-accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Резерв места под иконки до инициализации lucide снижает CLS. */
i[data-lucide],
.lucide {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Резервируем место под пользовательское меню, чтобы шапка не прыгала. */
[data-user-menu-mount] {
  display: block;
  min-width: 190px;
  min-height: 34px;
}

/* Единый компонент мягкой золотой кнопки */
.crm-btn-gold,
.btn-create,
.tasks-create__summary,
.employees-invite,
.disk-add__summary,
.calendar-create__summary,
body[data-page='admin'] .admin-btn--primary {
  background: var(--btn-gold-gradient);
  color: var(--btn-gold-text);
  border: none;
  border-radius: 8px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 6px 14px rgba(185, 133, 44, 0.24);
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.crm-btn-gold:hover,
.btn-create:hover,
.tasks-create__summary:hover,
.employees-invite:hover,
.disk-add__summary:hover,
.calendar-create__summary:hover,
body[data-page='admin'] .admin-btn--primary:hover:not(:disabled) {
  background: var(--btn-gold-gradient-hover);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 10px 18px rgba(185, 133, 44, 0.32);
  transform: translateY(-1px);
}

.crm-btn-gold:active,
.btn-create:active {
  background: var(--btn-gold-gradient-active);
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(165, 118, 39, 0.28);
}

.btn-create-split__more {
  background: var(--btn-gold-gradient);
  color: var(--btn-gold-text);
}

.btn-create-split__more:hover {
  background: var(--btn-gold-gradient-hover);
}

.btn-create-split__more:active {
  background: var(--btn-gold-gradient-active);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ——— Левое меню (CRM-подобное, сворачивается) ——— */

.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width-collapsed);
  flex-shrink: 0;
  background: var(--color-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: width 0.2s ease;
  overflow: hidden;
}

:root[data-theme='dark'] .app-sidebar {
  border-right: 1px solid var(--color-border);
}

:root[data-theme='dark'] .app-main {
  background: var(--color-bg);
}

:root[data-theme='dark'] .crm-top-bar,
:root[data-theme='dark'] .crm-module-nav,
:root[data-theme='dark'] .crm-toolbar {
  background: var(--color-surface);
  border-color: var(--color-border);
}

:root[data-theme='dark'] .crm-filter-search,
:root[data-theme='dark'] .crm-filter-search--dark,
:root[data-theme='dark'] .view-switcher,
:root[data-theme='dark'] .crm-chip,
:root[data-theme='dark'] .kanban__card,
:root[data-theme='dark'] .data-table,
:root[data-theme='dark'] .table-wrap {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

:root[data-theme='dark'] .view-switcher button {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

:root[data-theme='dark'] .view-switcher button .lucide {
  color: inherit;
}

:root[data-theme='dark'] .view-switcher button:hover {
  background: #27303a;
  color: var(--color-text);
}

:root[data-theme='dark'] .view-switcher button.is-active,
:root[data-theme='dark'] .view-switcher button[aria-pressed='true'] {
  background: #2f3946;
  color: #ffffff;
}

:root[data-theme='dark'] .crm-btn-text,
:root[data-theme='dark'] .crm-toolbar__ghost,
:root[data-theme='dark'] .crm-toolbar__gear {
  color: var(--color-text-muted);
}

/*
 * Карточка сделки: вертикальные вкладки «Дело / Задание» (writing-mode + rotate).
 * Нативный стиль <button> и muted-текст дают почти невидимый контраст на тёмном фоне.
 */
:root[data-theme='dark'] .deal-entity-activity__rail-btn {
  appearance: none;
  -webkit-appearance: none;
  color: #eef4fb !important;
  -webkit-text-fill-color: #eef4fb;
}

:root[data-theme='dark'] .deal-entity-activity__rail-btn.is-active {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

:root[data-theme='dark'] .deal-entity-activity__rail-btn:hover {
  color: #bfe9ff !important;
  -webkit-text-fill-color: #bfe9ff;
}

:root[data-theme='dark'] .deal-entity-activity .crm-btn-text {
  color: #dce4ee !important;
}

:root[data-theme='dark'] .deal-entity-activity .crm-btn-text:hover {
  color: #ffffff !important;
}

:root[data-theme='dark'] .deal-entity-activity__muted,
:root[data-theme='dark'] .deal-entity-activity__panel .deal-entity-activity__muted {
  color: #c9d4e2 !important;
}

:root[data-theme='dark'] input,
:root[data-theme='dark'] select,
:root[data-theme='dark'] textarea {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.crm-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.crm-theme-toggle .lucide {
  width: 14px;
  height: 14px;
}

.crm-theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.app-sidebar--collapsed {
  width: var(--sidebar-width-collapsed);
}

.app-sidebar__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.app-sidebar__head {
  flex-shrink: 0;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-sidebar__brand-mark {
  flex: 1;
  min-width: 0;
  display: block;
  line-height: 0;
  text-decoration: none;
}

.app-sidebar__brand-mark:hover {
  opacity: 0.92;
}

.app-sidebar__brand-mark:focus-visible {
  outline: 2px solid var(--color-sidebar-active);
  outline-offset: 2px;
  border-radius: 4px;
}

.app-sidebar__logo {
  display: block;
  max-height: 48px;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.app-sidebar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.app-sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.app-sidebar__toggle:focus-visible {
  outline: 2px solid var(--color-sidebar-active);
  outline-offset: 2px;
}

.app-sidebar__toggle .lucide {
  width: 18px;
  height: 18px;
}

.app-sidebar--collapsed .app-sidebar__toggle .lucide {
  transform: scaleX(-1);
}

.app-sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 6px 0 8px;
}

.app-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-sidebar__item {
  margin: 0;
  position: relative;
}

.app-sidebar__item[draggable='true'] {
  cursor: grab;
}

.app-sidebar__item[draggable='true'].is-dragging {
  opacity: 0.55;
}

.app-sidebar__item.is-drop-target::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: var(--color-sidebar-active);
  border-radius: 2px;
}

.app-sidebar__details {
  border: none;
}

.app-sidebar__details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.95);
  user-select: none;
}

.app-sidebar__details > summary::-webkit-details-marker {
  display: none;
}

.app-sidebar__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.app-sidebar__chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.app-sidebar__details[open] .app-sidebar__chevron {
  transform: rotate(0deg);
}

.app-sidebar__details:not([open]) .app-sidebar__chevron {
  transform: rotate(-90deg);
}

.app-sidebar__subnav {
  list-style: none;
  margin: 0;
  padding: 2px 0 6px 0;
}

.app-sidebar__subnav a {
  display: block;
  padding: 7px 14px 7px 36px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.app-sidebar__subnav a:hover {
  background: var(--color-sidebar-hover);
  text-decoration: none;
}

.app-sidebar__subnav a.is-active {
  background: rgba(0, 0, 0, 0.2);
  border-left-color: var(--color-sidebar-active);
  font-weight: 500;
}

.app-sidebar__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.92;
}

.app-sidebar__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.app-sidebar__link:hover {
  background: var(--color-sidebar-hover);
  text-decoration: none;
}

.app-sidebar__link:focus-visible {
  outline: 2px solid var(--color-sidebar-active);
  outline-offset: -2px;
}

.app-sidebar__link.is-active {
  background: rgba(0, 0, 0, 0.15);
  border-left-color: var(--color-sidebar-active);
  font-weight: 500;
}

.app-sidebar__stub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  cursor: default;
  border-left: 3px solid transparent;
}

.app-sidebar__footer {
  flex-shrink: 0;
  padding: 8px 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidebar__show-all {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.app-sidebar__show-all:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.app-sidebar__show-all .lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.app-sidebar__link--settings {
  margin-top: 2px;
}

/* Свернуто: только иконки + подсказки по title */
.app-sidebar--collapsed .app-sidebar__logo {
  max-height: 36px;
  max-width: 44px;
  margin: 0 auto;
}

.app-sidebar--collapsed .app-sidebar__brand-mark {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
}

.app-sidebar--collapsed .app-sidebar__label,
.app-sidebar--collapsed .app-sidebar__chevron {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-sidebar--collapsed .app-sidebar__head {
  padding: 10px 8px;
}

.app-sidebar--collapsed .app-sidebar__brand-row {
  justify-content: center;
}

.app-sidebar--collapsed .app-sidebar__toggle {
  margin: 0 auto;
}

.app-sidebar--collapsed .app-sidebar__details > ul.app-sidebar__subnav {
  display: none;
}

.app-sidebar--collapsed .app-sidebar__summary {
  justify-content: center;
  padding: 9px 8px;
}

.app-sidebar--collapsed .app-sidebar__link,
.app-sidebar--collapsed .app-sidebar__stub {
  justify-content: center;
  padding: 9px 8px;
}

.app-sidebar--collapsed .app-sidebar__item--details .app-sidebar__details > summary {
  justify-content: center;
  padding: 9px 8px;
}

.app-sidebar--collapsed .app-sidebar__footer {
  align-items: center;
  padding: 8px 6px 12px;
}

.app-sidebar--collapsed .app-sidebar__show-all {
  justify-content: center;
  padding: 9px 8px;
}


.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #2c313a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.app-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #e8eaed;
}

.app-header__search {
  flex: 1;
  max-width: 420px;
}

.app-header__search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  font: inherit;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
}

.app-header__search input::placeholder {
  color: #9aa0a8;
}

.app-header__search input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: rgba(47, 198, 246, 0.45);
}

/* Профиль в шапке главной / админки — как в crm-top-bar */
.app-header .user-menu__trigger {
  color: #e8eaed;
}

.app-header .user-menu__trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.app-header .user-menu__trigger-name {
  color: #e8eaed;
}

.app-header .user-menu__trigger-chevron {
  color: #9aa0a8;
}

.app-header .user-menu__trigger-avatar {
  background: rgba(255, 255, 255, 0.15);
  color: #dce3ea;
}

.app-content {
  flex: 1;
  padding: 20px;
  overflow: auto;
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.panel__title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.muted {
  color: var(--color-text-muted);
}

/* Канбан-заглушка (лиды) */
.kanban {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban__column {
  flex: 0 0 240px;
  min-width: 220px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
}

.kanban__column-header {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kanban__column-body {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.kanban__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: default;
  box-shadow: var(--shadow-sm);
}

.kanban__card-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.kanban__card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Таблица-заглушка */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-muted);
}

.data-table tr:hover td {
  background: #f7f9fa;
}

:root[data-theme='dark'] .data-table tr:hover td {
  background: #1c2633;
}

/* Вкладки модулей портала (Лента · Мессенджер · Календарь · …) — общая сетка */
.portal-module-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  min-height: 46px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  list-style: none;
  margin: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.portal-module-tabs__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.portal-module-tabs__link:hover {
  color: var(--color-text);
  background: rgba(47, 198, 246, 0.06);
}

.portal-module-tabs__link.is-active {
  color: var(--color-accent-dark);
  font-weight: 600;
  border-bottom-color: var(--color-accent);
  background: rgba(47, 198, 246, 0.08);
}

.portal-module-tabs__more {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  list-style: none;
}

.portal-module-tabs__more summary::marker {
  content: '';
  font-size: 0;
}

.portal-module-tabs__more-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
  white-space: nowrap;
}

.portal-module-tabs__more-summary::-webkit-details-marker {
  display: none;
}

.portal-module-tabs__more-summary:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.portal-module-tabs__more[open] .portal-module-tabs__more-summary {
  color: var(--color-accent-dark);
}

.portal-module-tabs__more-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Унифицированные контейнеры с попапами/дропдаунами */
.notifications-popover,
.user-menu__popover,
.crm-module-nav__dropdown,
.crm-module-nav__contacts-panel,
.crm-chips__dropdown,
.crm-logo-menu__popover {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.portal-module-tabs__more-list a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
}

.portal-module-tabs__more-list a:hover {
  background: var(--color-bg);
}
