/* Кнопки, бейджи, меню и полоса вкладок карточки заявки и оболочки проекта.
   Подключать до request_card.css: более поздние уточнения карточки остаются там.
   Вид вкладки задан здесь один раз. */
.lg-app .lg-muted, .lg-shell .lg-muted { color:var(--lg-muted) }
.lg-app .lg-danger, .lg-shell .lg-danger { color:var(--lg-danger) }
.lg-app .lg-success, .lg-shell .lg-success { color:var(--lg-success) }
.lg-app .lg-mono, .lg-shell .lg-mono { font-family:ui-monospace,Consolas,monospace }
.lg-app .lg-nums, .lg-shell .lg-nums { font-variant-numeric:tabular-nums }
.lg-app .lg-sr, .lg-shell .lg-sr { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0 }
.lg-app .lg-ico, .lg-shell .lg-ico { width:var(--lg-icon-size, 18px);height:var(--lg-icon-size, 18px);stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;vertical-align:middle }
.lg-app .lg-ico.lg-ico-fill, .lg-shell .lg-ico.lg-ico-fill { fill:currentColor;stroke:none }
.lg-app .lg-btn, .lg-shell .lg-btn { display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:7px 12px;border:1px solid var(--lg-border);border-radius:var(--lg-radius);background:var(--lg-surface);color:var(--lg-text);text-decoration:none;line-height:20px;font-size:14px;font-weight:500;white-space:normal }
.lg-app .lg-btn:hover, .lg-shell .lg-btn:hover { background:var(--lg-hover);text-decoration:none }
.lg-app .lg-btn:disabled, .lg-shell .lg-btn:disabled { opacity:.45;pointer-events:none }
.lg-app .lg-btn.lg-primary, .lg-shell .lg-btn.lg-primary { color:var(--lg-on-primary);background:var(--lg-primary);border-color:var(--lg-primary) }
.lg-app .lg-btn.lg-primary:hover, .lg-shell .lg-btn.lg-primary:hover { background:var(--lg-primary-hover) }
.lg-app .lg-btn.lg-ghost, .lg-shell .lg-btn.lg-ghost { border-color:transparent;background:transparent }
.lg-app .lg-btn.lg-ghost:hover, .lg-shell .lg-btn.lg-ghost:hover { background:var(--lg-hover) }
.lg-app .lg-btn.lg-info, .lg-shell .lg-btn.lg-info,
.lg-app .lg-btn.lg-info:hover, .lg-shell .lg-btn.lg-info:hover,
.lg-app .lg-btn.lg-info:focus, .lg-shell .lg-btn.lg-info:focus,
.lg-app .lg-btn.lg-info:focus-visible, .lg-shell .lg-btn.lg-info:focus-visible { color:var(--lg-primary);background:var(--lg-primary-soft);border-color:transparent }
.lg-app .lg-btn.lg-warning, .lg-shell .lg-btn.lg-warning,
.lg-app .lg-btn.lg-warning:hover, .lg-shell .lg-btn.lg-warning:hover,
.lg-app .lg-btn.lg-warning:focus, .lg-shell .lg-btn.lg-warning:focus,
.lg-app .lg-btn.lg-warning:focus-visible, .lg-shell .lg-btn.lg-warning:focus-visible { color:var(--lg-warning);background:var(--lg-warning-soft);border-color:var(--lg-signal-wait-border) }
.lg-app .lg-btn.lg-chip, .lg-shell .lg-btn.lg-chip,
.lg-app .lg-btn.lg-chip:hover, .lg-shell .lg-btn.lg-chip:hover,
.lg-app .lg-btn.lg-chip:focus, .lg-shell .lg-btn.lg-chip:focus,
.lg-app .lg-btn.lg-chip:focus-visible, .lg-shell .lg-btn.lg-chip:focus-visible { color:var(--lg-chip-fg);background:var(--lg-chip-bg);border-color:transparent }
.lg-app .lg-btn.lg-danger, .lg-shell .lg-btn.lg-danger,
.lg-app .lg-btn.lg-danger:focus, .lg-shell .lg-btn.lg-danger:focus,
.lg-app .lg-btn.lg-danger:focus-visible, .lg-shell .lg-btn.lg-danger:focus-visible { color:var(--lg-danger);background:var(--lg-danger-soft);border-color:transparent }
.lg-app .lg-btn.lg-danger:hover, .lg-shell .lg-btn.lg-danger:hover { color:var(--lg-danger);background:var(--lg-danger-hover) }
.lg-app .lg-btn.lg-icon, .lg-shell .lg-btn.lg-icon { width:36px;min-width:36px;padding:7px }
.lg-app .lg-btn.lg-icon.lg-small-btn, .lg-shell .lg-btn.lg-icon.lg-small-btn { width:32px;min-width:32px;min-height:32px;padding:5px }
.lg-shell .pe-page-header__actions .lg-btn.lg-icon { border-color:var(--lg-control-border) }
#favorits-btn.is-favorite .lg-ico,
#favorits-btn .bi-star-fill,
#favorits-btn .bxs-star { color:var(--bs-warning);fill:currentColor }
.lg-app .lg-btn.lg-icon.lg-row-btn .lg-ico, .lg-shell .lg-btn.lg-icon.lg-row-btn .lg-ico,
.lg-app .lg-btn.lg-sm .lg-ico, .lg-shell .lg-btn.lg-sm .lg-ico { width:14px;height:14px }
.lg-app .lg-btn.lg-small-btn, .lg-shell .lg-btn.lg-small-btn { min-height:32px;padding:5px 9px;font-size:13px }
.lg-app .lg-btn.lg-row-btn, .lg-shell .lg-btn.lg-row-btn,
.lg-app .lg-btn.lg-sm, .lg-shell .lg-btn.lg-sm { height:27px;min-height:27px;padding:4px 8px;font-size:0.7109375rem;line-height:1.5;white-space:nowrap }
.lg-app .lg-btn.lg-icon.lg-row-btn, .lg-shell .lg-btn.lg-icon.lg-row-btn,
.lg-app .lg-btn.lg-icon.lg-sm, .lg-shell .lg-btn.lg-icon.lg-sm { width:27px;min-width:27px;padding:4px }
.lg-app .lg-tag, .lg-shell .lg-tag { display:inline-flex;align-items:center;gap:5px;padding:3px 7px;border-radius:var(--lg-radius-tag, 4px);background:var(--lg-chip-bg);color:var(--lg-chip-fg);font-size:12px;font-weight:500;line-height:18px }
.lg-app .lg-tag.lg-blue, .lg-shell .lg-tag.lg-blue { background:var(--lg-primary-soft);color:var(--lg-primary) }
.lg-app .lg-tag.lg-warn, .lg-shell .lg-tag.lg-warn { background:var(--lg-warning-soft);color:var(--lg-warning) }
.lg-app .lg-tag.lg-red, .lg-shell .lg-tag.lg-red { background:var(--lg-danger-soft);color:var(--lg-danger) }
.lg-app .lg-tag.lg-green, .lg-shell .lg-tag.lg-green { background:var(--lg-success-soft);color:var(--lg-success) }
.lg-app .lg-badge, .lg-shell .lg-badge { font-size:12px;font-variant-numeric:tabular-nums;padding:0 5px;min-width:18px;border-radius:var(--lg-radius-tag, 4px);background:var(--lg-chip-bg);color:var(--lg-chip-fg);font-weight:500 }
.lg-app details.lg-pop, .lg-shell details.lg-pop { position:relative;flex:none }
.lg-app details.lg-pop>summary, .lg-shell details.lg-pop>summary { list-style:none }
.lg-app details.lg-pop>summary::-webkit-details-marker, .lg-shell details.lg-pop>summary::-webkit-details-marker { display:none }
.lg-app .lg-popover, .lg-shell .lg-popover { position:absolute;right:0;top:calc(100% + 5px);background:var(--lg-surface);border:1px solid var(--lg-border);border-radius:var(--lg-radius-menu, 12px);padding:6px;box-shadow:var(--lg-shadow-menu, 0 12px 36px #202b3d24);min-width:230px;max-width:min(300px,88vw);z-index:30;max-height:min(60dvh,calc(100dvh - 240px));overflow:auto }
.lg-app .lg-popover button, .lg-shell .lg-popover button,
.lg-app .lg-popover a, .lg-shell .lg-popover a { display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;min-height:36px;text-align:left;border:0;border-radius:var(--lg-radius-tag, 4px);background:transparent;color:var(--lg-text);font-size:14px;font-weight:500;line-height:20px;text-decoration:none }
.lg-app .lg-popover button:hover, .lg-shell .lg-popover button:hover,
.lg-app .lg-popover a:hover, .lg-shell .lg-popover a:hover,
.lg-app .lg-popover a:focus, .lg-shell .lg-popover a:focus,
.lg-app .lg-popover a:focus-visible, .lg-shell .lg-popover a:focus-visible { background:var(--lg-hover);color:var(--lg-text);text-decoration:none }
.lg-app .lg-popover button.lg-danger, .lg-shell .lg-popover button.lg-danger,
.lg-app .lg-popover a.lg-danger, .lg-shell .lg-popover a.lg-danger { color:var(--lg-danger) }
.lg-app .lg-popover button.lg-danger:hover, .lg-shell .lg-popover button.lg-danger:hover,
.lg-app .lg-popover button.lg-danger:focus, .lg-shell .lg-popover button.lg-danger:focus,
.lg-app .lg-popover button.lg-danger:focus-visible, .lg-shell .lg-popover button.lg-danger:focus-visible,
.lg-app .lg-popover a.lg-danger:hover, .lg-shell .lg-popover a.lg-danger:hover,
.lg-app .lg-popover a.lg-danger:focus, .lg-shell .lg-popover a.lg-danger:focus,
.lg-app .lg-popover a.lg-danger:focus-visible, .lg-shell .lg-popover a.lg-danger:focus-visible { background:var(--lg-danger-soft);color:var(--lg-danger) }
.lg-app .lg-popover hr, .lg-shell .lg-popover hr { border:0;border-top:1px solid var(--lg-border);margin:6px }
.lg-app .lg-menu-label, .lg-shell .lg-menu-label { display:block;color:var(--lg-muted);font-size:0.8125rem;font-weight:600;line-height:1.125rem;padding:5px 10px }
.lg-app .lg-drop, .lg-shell .lg-drop { display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;border:1px dashed var(--lg-control-border);border-radius:var(--lg-radius);background:var(--lg-surface);color:var(--lg-muted);font-size:13px }
.lg-app .lg-drop .lg-ico, .lg-shell .lg-drop .lg-ico { width:var(--lg-icon-size-menu, 16px);height:var(--lg-icon-size-menu, 16px) }
.lg-app .lg-skeleton, .lg-shell .lg-skeleton { display:grid;gap:8px }
.lg-app .lg-skeleton span, .lg-shell .lg-skeleton span { display:block;height:12px;border-radius:var(--lg-radius-tag, 4px);background:var(--lg-border);animation:lg-skeleton-pulse 1.3s ease-in-out infinite alternate }
@keyframes lg-skeleton-pulse { from { opacity:.52 } to { opacity:1 } }
.lg-app .lg-action-list, .lg-shell .lg-action-list { display:flex;flex-direction:column;gap:2px;margin-top:10px }
.lg-app .lg-action-list button, .lg-shell .lg-action-list button { display:flex;align-items:center;gap:9px;padding:8px 10px;min-height:36px;text-align:left;border-radius:var(--lg-radius-tag, 4px) }
.lg-app .lg-action-list button:hover, .lg-shell .lg-action-list button:hover { background:var(--lg-primary-soft) }
.lg-app .lg-action-list button .lg-ico, .lg-shell .lg-action-list button .lg-ico,
.lg-app .lg-popover button .lg-ico, .lg-shell .lg-popover button .lg-ico,
.lg-app .lg-popover a .lg-ico, .lg-shell .lg-popover a .lg-ico,
.lg-app .lg-context-menu button .lg-ico, .lg-shell .lg-context-menu button .lg-ico { width:var(--lg-icon-size-menu, 16px);height:var(--lg-icon-size-menu, 16px) }


/* Меню оболочки не попадает под сброс кнопок карточки заявки. */
.lg-shell .lg-popover button,
.lg-shell .lg-action-list > a,
.lg-shell .lg-action-list > button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.lg-shell .lg-popover button {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.lg-shell .pe-project-status .lg-popover button {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.lg-shell .pe-project-status .lg-popover button.active {
  font-weight: 600;
}
.lg-shell .lg-action-list > .lg-danger:hover {
  background: var(--lg-danger-soft);
}
@media (pointer: coarse) {
  .lg-shell .lg-btn,
  .lg-shell .lg-popover button,
  .lg-shell .lg-action-list > a,
  .lg-shell .lg-action-list > button {
    min-height: 44px;
  }
  .lg-shell .lg-btn.lg-icon {
    width: 44px;
    min-width: 44px;
  }
}

/* Статус рядом с названием — тот же lg-tag, что в строке заявки. Отдельной пилюли нет. */
.lg-shell summary.lg-tag {
  list-style: none;
  cursor: pointer;
}
.lg-shell summary.lg-tag::-webkit-details-marker {
  display: none;
}
.lg-shell .pe-project-status .lg-tag .lg-ico {
  width: var(--lg-icon-size-meta, 14px);
  height: var(--lg-icon-size-meta, 14px);
}
.lg-shell .lg-tag[data-status-color="primary"],
.lg-shell .lg-tag[data-status-color="info"],
.lg-shell .lg-tag[data-status-color="primary"]:hover,
.lg-shell .lg-tag[data-status-color="info"]:hover,
.lg-shell .lg-tag[data-status-color="primary"]:focus,
.lg-shell .lg-tag[data-status-color="info"]:focus {
  background: var(--lg-status-primary-bg);
  color: var(--lg-primary);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="success"],
.lg-shell .lg-tag[data-status-color="success"]:hover,
.lg-shell .lg-tag[data-status-color="success"]:focus {
  background: var(--lg-status-success-bg);
  color: var(--lg-success);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="warning"],
.lg-shell .lg-tag[data-status-color="warning"]:hover,
.lg-shell .lg-tag[data-status-color="warning"]:focus {
  background: var(--lg-status-warning-bg);
  color: var(--lg-warning);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="danger"],
.lg-shell .lg-tag[data-status-color="danger"]:hover,
.lg-shell .lg-tag[data-status-color="danger"]:focus {
  background: var(--lg-status-danger-bg);
  color: var(--lg-danger);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="secondary"],
.lg-shell .lg-tag[data-status-color="secondary"]:hover,
.lg-shell .lg-tag[data-status-color="secondary"]:focus {
  background: var(--lg-bg);
  color: var(--lg-muted);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="dark"],
.lg-shell .lg-tag[data-status-color="dark"]:hover,
.lg-shell .lg-tag[data-status-color="dark"]:focus {
  background: var(--lg-bg);
  color: var(--lg-text);
  border-color: transparent;
}
.lg-shell .lg-tag[data-status-color="light"],
.lg-shell .lg-tag[data-status-color="light"]:hover,
.lg-shell .lg-tag[data-status-color="light"]:focus {
  background: var(--lg-surface);
  color: var(--lg-muted);
  border-color: transparent;
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color]:hover,
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color]:focus {
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="success"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="success"]:hover {
  background: var(--lg-success-soft);
  color: var(--lg-success);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="warning"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="warning"]:hover {
  background: var(--lg-warning-soft);
  color: var(--lg-warning);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="danger"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="danger"]:hover {
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="secondary"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="secondary"]:hover {
  background: var(--lg-primary-soft);
  color: var(--lg-muted);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="dark"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="dark"]:hover {
  background: var(--lg-primary-soft);
  color: var(--lg-text);
}
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="light"],
html[data-bs-theme="dark"] .lg-shell .lg-tag[data-status-color="light"]:hover {
  background: var(--lg-primary-soft);
  color: var(--lg-muted);
}
.lg-shell .pe-project-status .lg-popover {
  left: 0;
  right: auto;
}
.lg-shell .pe-project-status .lg-popover button.active {
  font-weight: 600;
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}

/* Контрол, у которого в разметке ещё класс Bootstrap: шрифт, фон и радиус.
   Высоту здесь не задаём. Переведённый контрол носит класс lg-* и берёт высоту из него.
   Радиус контроля — --lg-radius из tokens.css, 8px. */

/* Small controls and input groups get the same radius (Bootstrap -sm rules have equal specificity). */
.lg-shell .form-control-sm,
.lg-shell .form-select-sm,
.lg-shell .btn-sm,
.lg-shell .input-group-sm > .form-control,
.lg-shell .input-group-sm > .form-select,
.lg-shell .input-group-sm > .btn {
  border-radius: var(--lg-radius);
}

.lg-shell {
  font-family: var(--lg-font-body);
  color: var(--lg-text);
  background: var(--lg-bg);
}
.breadcrumb,
.pe-breadcrumb {
  --bs-breadcrumb-divider: "›";
  --bs-breadcrumb-divider-color: var(--lg-muted, #566174);
  --bs-breadcrumb-item-active-color: var(--lg-text, #202b3d);
  --bs-breadcrumb-padding-y: 0;
  --bs-breadcrumb-padding-x: 0;
  --bs-breadcrumb-item-padding-x: 0;
  --bs-breadcrumb-margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  background: transparent;
  font-size: var(--lg-type-meta, 0.8125rem);
  line-height: var(--lg-line-meta, 1.125rem);
  color: var(--lg-muted, #566174);
}
.breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
  float: none;
  padding-right: 0;
  color: var(--lg-muted, #566174);
}
.breadcrumb-item > a,
.pe-breadcrumb a {
  color: var(--lg-muted, #566174);
  text-decoration: none;
}
.breadcrumb-item > a:hover,
.breadcrumb-item > a:focus-visible,
.pe-breadcrumb a:hover,
.pe-breadcrumb a:focus-visible {
  color: var(--lg-primary, #2457c5);
  text-decoration: none;
}
.breadcrumb-item.active,
.pe-breadcrumb__current,
.pe-breadcrumb__sep {
  color: var(--lg-text, #202b3d);
}
.pe-breadcrumb__sep,
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--lg-muted, #566174);
  opacity: 1;
}
.breadcrumb-item.active,
.pe-breadcrumb__current {
  font-weight: 500;
}
html[data-bs-theme="dark"] .breadcrumb,
html[data-bs-theme="dark"] .pe-breadcrumb,
html[data-bs-theme="dark"] .breadcrumb-item > a,
html[data-bs-theme="dark"] .pe-breadcrumb a,
html[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before,
html[data-bs-theme="dark"] .pe-breadcrumb__sep {
  color: var(--lg-muted, #8a8f9e);
}
html[data-bs-theme="dark"] .breadcrumb-item > a:hover,
html[data-bs-theme="dark"] .breadcrumb-item > a:focus-visible,
html[data-bs-theme="dark"] .pe-breadcrumb a:hover,
html[data-bs-theme="dark"] .pe-breadcrumb a:focus-visible {
  color: var(--lg-primary, #6b8fb5);
}
html[data-bs-theme="dark"] .breadcrumb-item.active,
html[data-bs-theme="dark"] .pe-breadcrumb__current {
  color: var(--lg-text, #d0d3db);
}
.lg-shell .btn,
.lg-shell .pe-icon-btn {
  font-family: inherit;
  border-radius: var(--lg-radius);
  background: var(--lg-surface);
  color: var(--lg-text);
  border-color: var(--lg-control-border);
}
.lg-shell .btn:hover,
.lg-shell .pe-icon-btn:hover {
  background: var(--lg-hover);
  color: var(--lg-text);
  border-color: var(--lg-control-border);
}
.lg-shell #deleteModal #confirmDelete:focus,
.lg-shell #deleteModal #confirmDelete:focus-visible {
  color: var(--lg-danger);
  background: var(--lg-danger-soft);
  border-color: transparent;
  box-shadow: none;
}
.lg-shell #deleteModal #confirmDelete:hover,
.lg-shell #deleteModal #confirmDelete:active {
  color: var(--lg-danger);
  background: var(--lg-danger-hover);
  border-color: transparent;
  box-shadow: none;
}
.lg-shell .form-control,
.lg-shell .form-select {
  font-family: inherit;
  border-radius: var(--lg-radius);
  /* Только цвет: сокращённая запись background стирала стрелку списка Bootstrap (background-image). */
  background-color: var(--lg-surface);
  color: var(--lg-text);
  border-color: var(--lg-control-border);
}
.lg-shell .pe-panel,
.lg-shell .pe-ov-kpi,
.lg-shell .pe-side-nav {
  background: var(--lg-surface);
  border-color: var(--lg-border);
  border-radius: var(--lg-radius-section);
}
.lg-shell .pe-side-nav__link {
  font-family: inherit;
  border-radius: var(--lg-radius);
}
.lg-shell .pe-pill {
  font-family: inherit;
  border-radius: var(--lg-radius);
}
.lg-shell .dropdown-menu {
  font-family: inherit;
  border-radius: var(--lg-radius-menu);
}
.lg-shell .pe-side-nav__link.is-active,
.lg-shell .pe-pill.is-active {
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
  border-color: transparent;
  font-weight: 600;
}

/* План. Совещания, поручения и финансы берут те же заголовок, бейдж и primary.
   Цвет заголовка плана здесь не задаём. Высоту кнопок не меняем. */
.lg-shell .pe-overview,
.lg-shell .pe-planning,
.lg-shell .pe-gantt,
.lg-shell .pe-meetings,
.lg-shell .pe-assignments,
.lg-shell .pe-task-control,
.lg-shell .pe-team,
.lg-shell .pe-plan-grid,
.lg-shell .pe-rates,
.lg-shell .pe-resources,
.lg-shell .pe-add-resource,
.lg-shell .pe-economy,
.lg-shell .pe-finance,
.lg-shell .pe-income-plan,
.lg-shell .pe-from-team,
.lg-shell .pe-import,
.lg-shell .pe-team-member,
.lg-shell .pe-rate-cards,
.lg-shell .pe-risks,
.lg-shell .pe-documents,
.lg-shell .pe-knowledge,
.lg-shell .pe-week-approvals,
.lg-shell .pe-timesheet {
  color: var(--lg-text);
}
.lg-shell .pe-overview .pe-page-header__title,
.lg-shell .pe-planning .pe-page-header__title,
.lg-shell .pe-meetings .pe-page-header__title,
.lg-shell .pe-meetings h1.h4,
.lg-shell .pe-assignments .pe-page-header__title,
.lg-shell .pe-task-control .pe-tc-top__title,
.lg-shell .pe-team .pe-page-header__title,
.lg-shell .pe-team .pe-page-title,
.lg-shell .pe-plan-grid .pe-page-header__title,
.lg-shell .pe-plan-grid .pe-page-title,
.lg-shell .pe-rates .pe-page-title,
.lg-shell .pe-resources .pe-page-title,
.lg-shell .pe-add-resource .pe-page-title,
.lg-shell .pe-economy .pe-page-header__title,
.lg-shell .pe-economy .pe-page-title,
.lg-shell .pe-finance .pe-page-header__title,
.lg-shell .pe-finance .pe-page-title,
.lg-shell .pe-income-plan .card-title,
.lg-shell .pe-from-team .pe-page-title,
.lg-shell .pe-from-team .pe-panel__title,
.lg-shell .pe-import .pe-page-title,
.lg-shell .pe-import .pe-panel__title,
.lg-shell .pe-team-member .card-title,
.lg-shell .pe-rate-cards h5,
.lg-shell .pe-risks .pe-page-header__title,
.lg-shell .pe-risks .pe-panel__title,
.lg-shell .pe-risks .modal-title,
.lg-shell .pe-documents .pe-page-header__title,
.lg-shell .pe-documents .pe-docs-toolbar__title,
.lg-shell .pe-documents .pe-docs-detail__name,
.lg-shell .pe-knowledge .pe-page-header__title,
.lg-shell .pe-knowledge h1.h5,
.lg-shell .pe-knowledge .pe-panel__title,
.lg-shell .pe-week-approvals .pe-page-header__title,
.lg-shell .pe-week-approvals .pe-page-title,
.lg-shell .pe-timesheet .pe-page-title,
.lg-shell.pe-indicators .page-header h4,
.lg-shell.ps-page .ps-header__title,
.lg-shell.baseline-approvals .page-title-box h4,
.lg-shell.rc-hub .pe-page-title,
.lg-shell.rc-rate-create .pe-page-title,
.lg-shell.reports-page h1.h3 {
  font-weight: 600;
}
.lg-shell .pe-planning .pe-badge,
.lg-shell .pe-meetings .pe-badge,
.lg-shell .pe-assignments .pe-badge,
.lg-shell .pe-finance .pe-badge,
.lg-shell .pe-risks .pe-badge,
.lg-shell .pe-documents .pe-badge,
.lg-shell .pe-knowledge .pe-badge,
.lg-shell .pe-week-approvals .pe-badge,
.lg-shell .pe-timesheet .pe-badge,
.lg-shell.pe-indicators .pe-badge {
  font-weight: 500;
}
.lg-shell .pe-economy .pe-badge {
  font-weight: 500;
}
.lg-shell .pe-planning .pe-badge--primary,
.lg-shell .pe-planning .pe-badge--info,
.lg-shell .pe-meetings .pe-badge--primary,
.lg-shell .pe-meetings .pe-badge--info,
.lg-shell .pe-assignments .pe-badge--primary,
.lg-shell .pe-assignments .pe-badge--info,
.lg-shell .pe-finance .pe-badge--primary,
.lg-shell .pe-finance .pe-badge--info,
.lg-shell .pe-risks .pe-badge--primary,
.lg-shell .pe-risks .pe-badge--info,
.lg-shell .pe-documents .pe-badge--primary,
.lg-shell .pe-documents .pe-badge--info,
.lg-shell .pe-knowledge .pe-badge--primary,
.lg-shell .pe-knowledge .pe-badge--info,
.lg-shell .pe-week-approvals .pe-badge--primary,
.lg-shell .pe-week-approvals .pe-badge--info,
.lg-shell .pe-timesheet .pe-badge--primary,
.lg-shell .pe-timesheet .pe-badge--info {
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}
.lg-shell .pe-planning .pe-badge--success,
.lg-shell .pe-meetings .pe-badge--success,
.lg-shell .pe-assignments .pe-badge--success,
.lg-shell .pe-finance .pe-badge--success,
.lg-shell .pe-risks .pe-badge--success,
.lg-shell .pe-documents .pe-badge--success,
.lg-shell .pe-knowledge .pe-badge--success,
.lg-shell .pe-week-approvals .pe-badge--success,
.lg-shell .pe-timesheet .pe-badge--success {
  background: var(--lg-success-soft);
  color: var(--lg-success);
}
.lg-shell .pe-planning .pe-badge--warning,
.lg-shell .pe-meetings .pe-badge--warning,
.lg-shell .pe-assignments .pe-badge--warning,
.lg-shell .pe-economy .pe-badge--warning,
.lg-shell .pe-finance .pe-badge--warning,
.lg-shell .pe-risks .pe-badge--warning,
.lg-shell .pe-documents .pe-badge--warning,
.lg-shell .pe-knowledge .pe-badge--warning,
.lg-shell .pe-week-approvals .pe-badge--warning,
.lg-shell .pe-timesheet .pe-badge--warning,
.lg-shell.pe-indicators .pe-badge--warning {
  background: var(--lg-warning-soft);
  color: var(--lg-warning);
}
.lg-shell .pe-planning .pe-badge--danger,
.lg-shell .pe-meetings .pe-badge--danger,
.lg-shell .pe-assignments .pe-badge--danger,
.lg-shell .pe-finance .pe-badge--danger,
.lg-shell .pe-risks .pe-badge--danger,
.lg-shell .pe-documents .pe-badge--danger,
.lg-shell .pe-knowledge .pe-badge--danger,
.lg-shell .pe-week-approvals .pe-badge--danger,
.lg-shell .pe-timesheet .pe-badge--danger {
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
}
.lg-shell .pe-planning .pe-badge--secondary,
.lg-shell .pe-meetings .pe-badge--secondary,
.lg-shell .pe-assignments .pe-badge--secondary,
.lg-shell .pe-finance .pe-badge--secondary,
.lg-shell .pe-risks .pe-badge--secondary,
.lg-shell .pe-documents .pe-badge--secondary,
.lg-shell .pe-knowledge .pe-badge--secondary,
.lg-shell .pe-week-approvals .pe-badge--secondary,
.lg-shell .pe-timesheet .pe-badge--secondary {
  background: var(--lg-bg);
  color: var(--lg-muted);
}
/* Полоса вкладок. Один вид: черта заявки. Классы lg-tabs — новый экран.
   pe-subtabs, pe-pill-tabs и nav-tabs — прежняя разметка внутри .lg-shell. */
.lg-app .lg-tabs,
.lg-shell .pe-subtabs,
.lg-shell .pe-pill-tabs,
.lg-shell .nav-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--lg-border);
}
.lg-app .lg-tabs .lg-tab,
.lg-shell .pe-subtabs .nav-link,
.lg-shell .pe-pill-tabs .pe-pill,
.lg-shell .nav-tabs .nav-link {
  margin-bottom: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--lg-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  min-height: 36px;
  padding: 7px 8px;
  text-decoration: none;
}
.lg-app .lg-tabs .lg-tab:hover,
.lg-shell .pe-subtabs .nav-link:hover,
.lg-shell .pe-pill-tabs .pe-pill:hover,
.lg-shell .nav-tabs .nav-link:hover {
  background: var(--lg-hover);
  color: var(--lg-muted);
  border-color: transparent;
  border-bottom-color: transparent;
}
.lg-app .lg-tabs .lg-tab[aria-selected="true"],
.lg-shell .pe-subtabs .nav-link.active,
.lg-shell .pe-pill-tabs .pe-pill.is-active,
.lg-shell .nav-tabs .nav-link.active {
  background: transparent;
  color: var(--lg-primary);
  font-weight: 600;
  border-color: transparent;
  border-bottom-color: var(--lg-primary);
}
.lg-app .lg-tabs .lg-tab[aria-selected="true"]:hover,
.lg-shell .pe-subtabs .nav-link.active:hover,
.lg-shell .pe-pill-tabs .pe-pill.is-active:hover,
.lg-shell .nav-tabs .nav-link.active:hover {
  background: var(--lg-hover);
  color: var(--lg-primary);
  border-bottom-color: var(--lg-primary);
}
.lg-app .lg-tabs .lg-tab[aria-selected="true"] .lg-badge,
.lg-shell .pe-subtabs .nav-link.active .lg-badge,
.lg-shell .pe-pill-tabs .pe-pill.is-active .lg-badge,
.lg-shell .nav-tabs .nav-link.active .lg-badge {
  background: var(--lg-primary);
  color: var(--lg-on-primary);
}
.lg-app .lg-tabs .lg-tab .lg-badge,
.lg-shell .pe-subtabs .nav-link .lg-badge,
.lg-shell .pe-pill-tabs .pe-pill .lg-badge,
.lg-shell .nav-tabs .nav-link .lg-badge {
  font-size: 11px;
  line-height: 14px;
  min-width: 14px;
  margin-left: 4px;
  padding: 0 4px;
}
.lg-shell .pe-planning .btn-primary,
.lg-shell .pe-meetings .btn-primary,
.lg-shell .pe-assignments .btn-primary,
.lg-shell .pe-task-control .btn-primary,
.lg-shell .pe-team .btn-primary,
.lg-shell .pe-plan-grid .btn-primary,
.lg-shell .pe-rates .btn-primary,
.lg-shell .pe-resources .btn-primary,
.lg-shell .pe-add-resource .btn-primary,
.lg-shell .pe-economy .btn-primary,
.lg-shell .pe-finance .btn-primary,
.lg-shell .pe-income-plan .btn-primary,
.lg-shell .pe-from-team .btn-primary,
.lg-shell .pe-import .btn-primary,
.lg-shell .pe-team-member .btn-primary,
.lg-shell .pe-rate-cards .btn-primary,
.lg-shell .pe-risks .btn-primary,
.lg-shell .pe-documents .btn-primary,
.lg-shell .pe-knowledge .btn-primary,
.lg-shell .pe-week-approvals .btn-primary,
.lg-shell .pe-timesheet .btn-primary,
.lg-shell .ceo-dash .btn-primary,
.lg-shell.ceo-dash .btn-primary,
.lg-shell.projects-registry-layout .btn-primary,
.lg-shell.registry-filters-offcanvas .btn-primary,
.lg-shell.pe-indicators .btn-primary,
.lg-shell.ps-page .btn-primary,
.lg-shell.baseline-approvals .btn-primary,
.lg-shell.rc-hub .btn-primary,
.lg-shell.rc-rate-create .btn-primary,
.lg-shell.rc-drawer .btn-primary,
.lg-shell.project-wizard-page .btn-primary,
.lg-shell.card .btn-primary {
  background: var(--lg-primary);
  border-color: var(--lg-primary);
  color: var(--lg-on-primary);
}
.lg-shell .pe-planning .btn-primary:hover,
.lg-shell .pe-planning .btn-primary:focus,
.lg-shell .pe-meetings .btn-primary:hover,
.lg-shell .pe-meetings .btn-primary:focus,
.lg-shell .pe-assignments .btn-primary:hover,
.lg-shell .pe-assignments .btn-primary:focus,
.lg-shell .pe-task-control .btn-primary:hover,
.lg-shell .pe-task-control .btn-primary:focus,
.lg-shell .pe-team .btn-primary:hover,
.lg-shell .pe-team .btn-primary:focus,
.lg-shell .pe-plan-grid .btn-primary:hover,
.lg-shell .pe-plan-grid .btn-primary:focus,
.lg-shell .pe-rates .btn-primary:hover,
.lg-shell .pe-rates .btn-primary:focus,
.lg-shell .pe-resources .btn-primary:hover,
.lg-shell .pe-resources .btn-primary:focus,
.lg-shell .pe-add-resource .btn-primary:hover,
.lg-shell .pe-add-resource .btn-primary:focus,
.lg-shell .pe-economy .btn-primary:hover,
.lg-shell .pe-economy .btn-primary:focus,
.lg-shell .pe-finance .btn-primary:hover,
.lg-shell .pe-finance .btn-primary:focus,
.lg-shell .pe-income-plan .btn-primary:hover,
.lg-shell .pe-income-plan .btn-primary:focus,
.lg-shell .pe-from-team .btn-primary:hover,
.lg-shell .pe-from-team .btn-primary:focus,
.lg-shell .pe-import .btn-primary:hover,
.lg-shell .pe-import .btn-primary:focus,
.lg-shell .pe-team-member .btn-primary:hover,
.lg-shell .pe-team-member .btn-primary:focus,
.lg-shell .pe-rate-cards .btn-primary:hover,
.lg-shell .pe-rate-cards .btn-primary:focus,
.lg-shell .pe-risks .btn-primary:hover,
.lg-shell .pe-risks .btn-primary:focus,
.lg-shell .pe-documents .btn-primary:hover,
.lg-shell .pe-documents .btn-primary:focus,
.lg-shell .pe-knowledge .btn-primary:hover,
.lg-shell .pe-knowledge .btn-primary:focus,
.lg-shell .pe-week-approvals .btn-primary:hover,
.lg-shell .pe-week-approvals .btn-primary:focus,
.lg-shell .pe-timesheet .btn-primary:hover,
.lg-shell .pe-timesheet .btn-primary:focus,
.lg-shell .ceo-dash .btn-primary:hover,
.lg-shell .ceo-dash .btn-primary:focus,
.lg-shell.ceo-dash .btn-primary:hover,
.lg-shell.ceo-dash .btn-primary:focus,
.lg-shell.projects-registry-layout .btn-primary:hover,
.lg-shell.projects-registry-layout .btn-primary:focus,
.lg-shell.registry-filters-offcanvas .btn-primary:hover,
.lg-shell.registry-filters-offcanvas .btn-primary:focus,
.lg-shell.pe-indicators .btn-primary:hover,
.lg-shell.pe-indicators .btn-primary:focus,
.lg-shell.ps-page .btn-primary:hover,
.lg-shell.ps-page .btn-primary:focus,
.lg-shell.baseline-approvals .btn-primary:hover,
.lg-shell.baseline-approvals .btn-primary:focus,
.lg-shell.rc-hub .btn-primary:hover,
.lg-shell.rc-hub .btn-primary:focus,
.lg-shell.rc-rate-create .btn-primary:hover,
.lg-shell.rc-rate-create .btn-primary:focus,
.lg-shell.rc-drawer .btn-primary:hover,
.lg-shell.rc-drawer .btn-primary:focus,
.lg-shell.project-wizard-page .btn-primary:hover,
.lg-shell.project-wizard-page .btn-primary:focus,
.lg-shell.card .btn-primary:hover,
.lg-shell.card .btn-primary:focus {
  background: var(--lg-primary-hover);
  border-color: var(--lg-primary-hover);
  color: var(--lg-on-primary);
}

/* Плановое поступление. Высоту кнопок не меняем.
   min-height только у отдельной страницы, не у диалога. */
.pe-income-plan-page {
  min-height: 100vh;
  padding: 24px 16px;
}
.pe-income-plan-page > .pe-income-plan > .card {
  max-width: 880px;
  margin-inline: auto;
  box-shadow: var(--lg-shadow-section);
}
.pe-finance-modal .modal-dialog.lg-shell {
  background: transparent;
  max-height: calc(100vh - 2rem);
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.pe-finance-modal .modal-content {
  background: var(--lg-surface);
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-dialog);
  color: var(--lg-text);
  overflow: hidden;
  max-height: calc(100vh - 2rem);
}
.pe-finance-modal .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.pe-finance-modal .modal-content > form > .lg-dialog-body {
  overflow-y: auto;
  min-height: 0;
}
.lg-shell .pe-income-plan .lg-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: var(--lg-surface);
  border-bottom: 1px solid var(--lg-border);
}
.lg-shell .pe-income-plan .lg-dialog-head > strong {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--lg-text);
}
.lg-shell .pe-income-plan .lg-dialog-body {
  padding: 20px 22px;
}
.lg-shell.lg-dialog.pe-income-plan .lg-dialog-footer,
.lg-shell .pe-income-plan .lg-dialog-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid var(--lg-border);
  background: var(--lg-surface);
}
/* HTMX снимает класс, которым select2 прячет исходный select. */
.lg-shell .pe-income-plan select.select2 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.lg-shell .pe-income-plan .modal-header,
.lg-shell .pe-income-plan .modal-footer,
.lg-shell .pe-income-plan .card-footer {
  border-color: var(--lg-border);
}
.lg-shell .pe-income-plan .btn,
.lg-shell .pe-from-team .btn,
.lg-shell .pe-import .btn,
.lg-shell .pe-team-member .btn,
.lg-shell .pe-rate-cards .btn {
  white-space: nowrap;
}
.lg-shell .pe-team-member .page-title-box h4 {
  font-weight: 600;
  color: var(--lg-text);
}
.lg-shell .pe-team-member .pe-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.lg-shell .pe-income-plan .card,
.lg-shell .pe-team-member .card,
.lg-shell .pe-rate-cards .card {
  background: var(--lg-surface);
  border-color: var(--lg-border);
  border-radius: var(--lg-radius-section);
  color: var(--lg-text);
}
.lg-shell .pe-rate-cards .table thead th,
.lg-shell .pe-rate-cards .table td {
  padding: 8px 12px;
  border-color: var(--lg-border);
}
.lg-shell .pe-rate-cards .table thead th {
  background: var(--lg-bg);
  color: var(--lg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.lg-shell .pe-rate-cards .table td {
  color: var(--lg-text);
  font-weight: 400;
}
.lg-shell .pe-rate-cards .table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.lg-shell .pe-income-plan .card-title {
  color: var(--lg-text);
}
.lg-shell .pe-income-plan label {
  color: var(--lg-muted);
}
.lg-shell .pe-income-plan #id_amount {
  font-variant-numeric: tabular-nums;
}
.lg-shell .pe-income-plan .select2-container .select2-selection--single,
.lg-shell.pe-income-plan .select2-container .select2-selection--single {
  height: 36px;
  box-sizing: border-box;
  background: var(--lg-surface);
  border-color: var(--lg-control-border);
  border-radius: var(--lg-radius);
  color: var(--lg-text);
  font-family: inherit;
}
.lg-shell .pe-income-plan .select2-container--default .select2-selection--single .select2-selection__rendered,
.lg-shell.pe-income-plan .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px;
}
.lg-shell .pe-income-plan .select2-container--default .select2-selection--single .select2-selection__arrow,
.lg-shell.pe-income-plan .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 34px;
}
.lg-shell .pe-income-plan select.lg-input,
.lg-shell.pe-income-plan select.lg-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-color: var(--lg-input-bg, #fff);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23202b3d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 12px;
}
html[data-bs-theme="dark"] .lg-shell .pe-income-plan select.lg-input,
html[data-bs-theme="dark"] .lg-shell.pe-income-plan select.lg-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d0d3db' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.lg-shell .pe-income-plan .btn-soft-primary,
.lg-shell .pe-income-plan .btn-soft-primary:hover,
.lg-shell .pe-income-plan .btn-soft-primary:focus {
  background: var(--lg-primary-soft);
  border-color: transparent;
  color: var(--lg-primary);
}
.lg-shell .pe-income-plan .btn-label .label-icon {
  background: var(--lg-bg);
  border-right-color: var(--lg-border);
  color: var(--lg-text);
  border-radius: var(--lg-radius) 0 0 var(--lg-radius);
}
.lg-shell .pe-income-plan .comment-composer {
  background: var(--lg-surface);
  border-color: var(--lg-control-border);
  border-radius: var(--lg-radius);
}
.lg-shell .pe-income-plan .comment-editor[contenteditable="true"]:focus {
  outline: 2px solid var(--lg-primary);
  outline-offset: -2px;
}
.lg-shell .pe-income-plan .pe-income-plan-saved {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--lg-radius);
  background: var(--lg-success-soft);
  color: var(--lg-success);
}
.lg-shell .pe-income-plan .row > [class*='col'] {
  min-width: 0;
}
.lg-shell .pe-income-plan .select2-container {
  width: 100% !important;
}
@media (max-width: 575.98px) {
  .pe-finance-modal .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100dvh - 1rem);
  }
  .pe-finance-modal .modal-content {
    max-height: calc(100dvh - 1rem);
  }
  .pe-finance-modal .lg-dialog-footer,
  .lg-shell .pe-income-plan .lg-dialog-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .pe-finance-modal .lg-dialog-footer .lg-btn,
  .lg-shell .pe-income-plan .lg-dialog-footer .lg-btn {
    width: 100%;
  }
}

/* Project module tables share one type scale: meta size for cells and headers.
   .registry-table is shared with other modules, so only the projects registry is aligned. */
.lg-shell :is(.pe-sheet-table, .ceo-table, .table-financial) :is(td, th),
.lg-shell.projects-registry-layout .registry-table :is(td, th) { font-size: 0.8125rem; }
.lg-shell :is(.pe-sheet-table, .ceo-table, .table-financial) thead,
.lg-shell.projects-registry-layout .registry-table thead {
  background: var(--lg-bg);
}
.lg-shell :is(.pe-sheet-table, .ceo-table, .table-financial) thead th,
.lg-shell.projects-registry-layout .registry-table thead th {
  color: var(--lg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--lg-bg);
  border-bottom: 1px solid var(--lg-border);
  letter-spacing: normal;
}
.lg-shell.projects-registry-layout .registry-table thead th {
  padding: 8px 12px;
}
.lg-shell.projects-registry-layout .registry-table th.sortable:hover {
  background: var(--lg-hover);
}
.lg-shell.projects-registry-layout .registry-table th.sortable.active i {
  color: var(--lg-muted);
  opacity: 1;
}
.lg-shell.projects-registry-layout .registry-table .btn-soft-warning {
  background: var(--lg-warning-soft);
  color: var(--lg-warning);
  border-color: transparent;
}
.lg-shell.projects-registry-layout .registry-table .btn-soft-danger {
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
  border-color: transparent;
}
.lg-shell.projects-registry-layout .registry-table .btn-soft-danger:hover {
  background: var(--lg-danger-hover);
  color: var(--lg-danger);
}
.lg-shell.projects-registry-layout .registry-table .btn-soft-primary,
.lg-shell.projects-registry-layout .registry-table .btn-soft-info {
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
  border-color: transparent;
}
.lg-shell.projects-registry-layout .registry-table .btn-soft-secondary {
  background: var(--lg-chip-bg);
  color: var(--lg-chip-fg);
  border-color: transparent;
}
.lg-shell :is(.pe-sheet-table, .ceo-table, .table-financial) td :is(.small, small),
.lg-shell.projects-registry-layout .registry-table td :is(.small, small) { font-size: inherit; }

/* ABC class badges (abc_badges filter): one look everywhere, the projects dashboard «Top-5» is the reference. */
.lg-shell .pe-abc { display: inline-flex; align-items: center; gap: 0.12rem; white-space: nowrap; vertical-align: middle; }
.lg-shell .pe-abc .badge {
  margin: 0 !important;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
}
.lg-shell .pe-abc .badge.bg-danger { background-color: var(--lg-danger-soft, #fff1f1) !important; color: var(--lg-danger, #a82626) !important; }
.lg-shell .pe-abc .badge.bg-warning { background-color: var(--lg-warning-soft, #fff7e6) !important; color: var(--lg-warning, #805009) !important; }
.lg-shell .pe-abc .badge.bg-secondary { background-color: var(--lg-bg, #f5f6f8) !important; color: var(--lg-muted, #566174) !important; }

/* Окно вопроса на страницах оболочки. Само окно несёт lg-shell, чтобы токены и кнопки работали вне карточки заявки. */
.lg-shell.lg-dialog {
  font-family: var(--lg-font-body);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-dialog, 14px);
  padding: 0;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  color: var(--lg-text);
  background: var(--lg-surface);
  box-shadow: 0 16px 60px #17233730;
}
.lg-shell.lg-dialog::backdrop { background: var(--lg-overlay); }
.lg-shell.lg-dialog .lg-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: var(--lg-surface);
  border-bottom: 1px solid var(--lg-border);
}
.lg-shell.lg-dialog .lg-dialog-head > strong,
.lg-shell.lg-dialog .lg-dialog-head .modal-title,
.lg-shell.lg-dialog .lg-confirm-title > strong {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--lg-text);
}
.lg-shell.lg-dialog .lg-dialog-body { padding: 20px 22px; }
.lg-shell.lg-dialog select.lg-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-color: var(--lg-input-bg, #fff);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23202b3d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 12px;
}
.lg-shell.lg-dialog #lg-confirm-text { margin: 0; line-height: 1.6; }
.lg-shell.lg-dialog .lg-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 20px 0 0;
  border: 0;
  background: transparent;
  flex-wrap: wrap;
}
.lg-shell .lg-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--lg-control-border);
  border-radius: var(--lg-radius);
  padding: 7px 10px;
  background: var(--lg-input-bg);
  color: var(--lg-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.lg-app .lg-input.lg-sm,
.lg-shell .lg-input.lg-sm {
  height: 27px;
  min-height: 27px;
  padding: 4px 8px;
  font-size: 0.7109375rem;
  line-height: 1.5;
}
.lg-app .lg-input.lg-small-btn,
.lg-shell .lg-input.lg-small-btn {
  height: 32px;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
  line-height: 20px;
}
.lg-shell .lg-input::placeholder { color: var(--lg-placeholder); opacity: 1; }
.lg-shell textarea.lg-input { resize: vertical; min-height: 96px; line-height: 1.55; }
.lg-shell .lg-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  min-height: 30px;
  color: var(--lg-text);
}
.lg-shell .lg-check input,
.lg-shell .lg-check > input,
.lg-shell.lg-dialog .lg-check > input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: var(--lg-primary);
  flex: none;
  float: none;
  appearance: auto;
  -webkit-appearance: auto;
  background: none;
  border: 0;
  box-shadow: none;
}
.lg-shell .lg-attention {
  border: 1px solid #ead8b2;
  border-left: 3px solid #b07418;
  padding: 12px;
  background: var(--lg-warning-soft);
  border-radius: 5px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--lg-text);
}
.lg-shell .lg-attention.lg-error {
  background: var(--lg-danger-soft);
  border-color: #ebc9c9;
  border-left-color: var(--lg-danger);
}
.lg-shell .lg-attention ul { margin: 8px 0 0; padding-left: 18px; }
.lg-shell.lg-dialog .form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lg-muted);
}
.lg-shell.lg-dialog .plan-hint {
  display: block;
  margin-top: 4px;
  color: var(--lg-muted);
  font-size: 13px;
}
.lg-shell.lg-dialog .plan-req { color: var(--lg-danger); font-weight: 600; }
.lg-shell.lg-dialog .plan-dialog-note,
.lg-shell.lg-dialog .alert-info {
  background: transparent;
  border: 0;
  color: var(--lg-text);
  padding: 0;
  margin: 0 0 14px;
}
.lg-shell.lg-dialog .plan-bs-ico,
.lg-shell.lg-dialog .plan-bs-search { display: none; }
.btn-close > .lg-ico { display: none; }
.lg-shell.lg-dialog .btn-close {
  background-image: none;
  opacity: 1;
  box-shadow: none;
}
.lg-shell.lg-dialog .btn-close > .lg-ico { display: block; }
.lg-shell.lg-dialog .plan-dialog-table-wrap {
  max-height: min(50vh, 320px);
  overflow: auto;
  margin-bottom: 8px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius);
}
.lg-shell.lg-dialog .plan-dialog-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: var(--lg-surface);
}
.lg-shell.lg-dialog .plan-dialog-table th,
.lg-shell.lg-dialog .plan-dialog-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--lg-border);
  border-right: 1px solid var(--lg-border);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  color: var(--lg-text);
  background: transparent;
}
.lg-shell.lg-dialog .plan-dialog-table th:last-child,
.lg-shell.lg-dialog .plan-dialog-table td:last-child { border-right: 0; }
.lg-shell.lg-dialog .plan-dialog-table th {
  position: sticky;
  top: 0;
  color: var(--lg-muted);
  font-weight: 600;
  background: var(--lg-bg);
}
.lg-shell.lg-dialog .plan-dialog-table tr:last-child td { border-bottom: 0; }
.lg-shell.lg-dialog .plan-dialog-table a { color: var(--lg-primary); text-decoration: none; }
.lg-shell.lg-dialog .plan-dialog-table a:hover { text-decoration: underline; }
.lg-shell.lg-dialog .plan-dialog-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-shell.lg-dialog .plan-dialog-empty { margin: 12px 0; color: var(--lg-muted); text-align: left; }
.lg-shell.lg-dialog .badge.lg-tag {
  border: 0;
  border-radius: var(--lg-radius-tag, 4px);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}
.lg-shell.lg-dialog .badge.lg-tag.lg-green {
  background-color: var(--lg-success-soft) !important;
  color: var(--lg-success) !important;
}
.lg-shell.lg-dialog .badge.lg-tag.lg-blue {
  background-color: var(--lg-primary-soft) !important;
  color: var(--lg-primary) !important;
}
.lg-shell.lg-dialog .badge.lg-tag.lg-warn {
  background-color: var(--lg-warning-soft) !important;
  color: var(--lg-warning) !important;
}
.lg-shell.lg-dialog .plan-dialog-search {
  position: relative;
  margin-bottom: 16px;
}
.lg-shell.lg-dialog .plan-dialog-search > .lg-ico {
  display: block;
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 16px;
  color: var(--lg-muted);
  pointer-events: none;
}
.lg-shell.lg-dialog .plan-dialog-search .lg-input { padding-left: 34px; padding-right: 40px; }
.lg-shell.lg-dialog .plan-dialog-search #clearSearchBtn {
  position: absolute;
  right: 2px;
  top: 2px;
}
.lg-shell.lg-dialog .lg-confirm-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
}
.lg-confirm-mark { display: none; }
.lg-shell.lg-dialog .lg-confirm-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--lg-radius);
  background: var(--lg-warning-soft);
  color: var(--lg-warning);
}
.lg-shell.lg-dialog .lg-confirm-mark.is-info {
  background: var(--lg-primary-soft);
  color: var(--lg-primary);
}
.lg-shell.lg-dialog .lg-confirm-mark.is-danger {
  background: var(--lg-danger-soft);
  color: var(--lg-danger);
}
.lg-shell.lg-dialog .lg-confirm-mark .lg-ico { width: 18px; height: 18px; }
.lg-shell.lg-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 12px 18px;
  max-width: min(620px, calc(100vw - 32px));
  background: var(--lg-toast-bg);
  color: var(--lg-toast-fg);
  border-radius: var(--lg-radius);
  font-family: var(--lg-font-body);
  font-size: 13px;
  box-shadow: 0 6px 25px #17233730;
}
@media (max-width: 560px) {
  .lg-shell.lg-dialog .lg-dialog-footer { flex-direction: column; align-items: stretch; }
  .lg-shell.lg-dialog .lg-dialog-footer .lg-btn { width: 100%; }
}
.lg-shell.lg-dialog .lg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lg-shell.lg-dialog .lg-field + .lg-field { margin-top: 16px; }
.lg-shell.lg-dialog .lg-field > label,
.lg-shell.lg-dialog .lg-field > span { font-size: 13px; font-weight: 500; }
.lg-shell.lg-dialog .lg-input {
  width: 100%;
  min-height: var(--lg-control-height, 36px);
  border: 1px solid var(--lg-control-border);
  border-radius: var(--lg-radius);
  padding: 7px 10px;
  background: var(--lg-input-bg);
  color: var(--lg-text);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}
.lg-shell.lg-dialog textarea.lg-input { resize: vertical; min-height: 96px; line-height: 1.55; }
.lg-shell.lg-dialog .lg-input.lg-sm {
  height: 27px;
  min-height: 27px;
  padding: 4px 8px;
  font-size: 0.7109375rem;
  line-height: 1.5;
}
.lg-shell.lg-dialog .lg-input.lg-small-btn {
  height: 32px;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
  line-height: 20px;
}
.lg-shell.lg-dialog .lg-input::placeholder { color: var(--lg-placeholder); opacity: 1; }
.lg-shell.lg-dialog .lg-field small {
  font-size: var(--lg-type-meta);
  line-height: var(--lg-line-meta);
  color: var(--lg-muted);
}
.lg-shell.lg-dialog .lg-attention {
  border: 1px solid #ead8b2;
  border-left: 3px solid #b07418;
  padding: 12px;
  background: var(--lg-warning-soft);
  border-radius: 5px;
  margin: 0 0 16px;
  font-size: 13px;
}
.lg-shell.lg-dialog .lg-attention.lg-error {
  background: var(--lg-danger-soft);
  border-color: #ebc9c9;
  border-left-color: var(--lg-danger);
}
.lg-shell.lg-dialog .lg-attention ul { margin: 8px 0 0; padding-left: 18px; }
.lg-shell.lg-dialog .lg-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 13px;
  line-height: 20px;
}
.lg-shell.lg-dialog .lg-check input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: var(--lg-primary);
  flex: none;
}
.lg-shell.lg-dialog .baseline-milestones { max-height: 300px; overflow: auto; }
.lg-shell.lg-dialog .baseline-milestones table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lg-shell.lg-dialog .baseline-milestones th,
.lg-shell.lg-dialog .baseline-milestones td {
  padding: 8px;
  border-bottom: 1px solid var(--lg-border);
  text-align: left;
  vertical-align: middle;
}
.lg-shell.lg-dialog .baseline-milestones th {
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--lg-muted);
  background: var(--lg-bg);
}
.tooltip {
  --bs-tooltip-bg: var(--lg-toast-bg, #172337);
  --bs-tooltip-color: var(--lg-toast-fg, #fff);
  --bs-tooltip-border-radius: var(--lg-radius-tag, 4px);
  --bs-tooltip-font-size: 13px;
  --bs-tooltip-padding-x: 8px;
  --bs-tooltip-padding-y: 4px;
  font-family: var(--lg-font-body, inherit);
}

/* Список согласований. Высоту кнопок задают классы lg-*. */
.lg-shell.baseline-approvals .page-title-box h4 {
  font-size: 1.35rem !important;
  font-weight: 600;
  text-transform: none;
  color: var(--lg-text);
}
.lg-shell.baseline-approvals .card {
  background: var(--lg-surface);
  border-color: var(--lg-border);
  border-radius: var(--lg-radius-section);
  color: var(--lg-text);
}
.lg-shell.baseline-approvals .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lg-text);
}
.lg-shell.baseline-approvals .baseline-approvals__count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lg-shell.baseline-approvals .baseline-approvals__section {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lg-text);
}
.lg-shell.baseline-approvals .baseline-approvals__meta,
.lg-shell.baseline-approvals .baseline-approvals__empty {
  color: var(--lg-muted);
  font-size: 0.8125rem;
}
.lg-shell.baseline-approvals .baseline-approvals__empty {
  margin: 0;
}
.lg-shell.baseline-approvals .baseline-approvals__empty + .baseline-approvals__empty {
  margin-top: 4px;
}
.lg-shell.baseline-approvals .table :is(td, th) {
  padding: 8px 12px;
  border-color: var(--lg-border);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--lg-text);
  letter-spacing: normal;
}
.lg-shell.baseline-approvals .table thead th {
  background: var(--lg-bg);
  color: var(--lg-muted);
  font-weight: 600;
  text-transform: none;
  border-bottom: 1px solid var(--lg-border);
}
.lg-shell.baseline-approvals .table thead th:not(:last-child),
.lg-shell.baseline-approvals .table td:not(:last-child) {
  border-right: 1px solid var(--lg-border);
}
.lg-shell.baseline-approvals .table a:not(.lg-btn) {
  color: var(--lg-primary);
  text-decoration: none;
}
.lg-shell.baseline-approvals .table a:not(.lg-btn):hover,
.lg-shell.baseline-approvals .table a:not(.lg-btn):focus-visible {
  text-decoration: underline;
}
.lg-shell.baseline-approvals .table-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  opacity: 1;
}
.lg-shell.baseline-approvals .table-row-actions form {
  display: inline-flex;
  margin: 0;
}

/* Multi-select registry filter (templates/includes/multi_select_filter.html). */
.lg-multi-select { display: inline-block; }
.lg-multi-select__toggle { width: auto; min-width: 140px; max-width: 220px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-multi-select__toggle.is-active { border-color: var(--lg-primary, #2457c5); color: var(--lg-primary, #2457c5); }
.lg-multi-select__menu { max-height: 320px; overflow-y: auto; min-width: 220px; }
.lg-multi-select__item { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; white-space: normal; }
.lg-multi-select__item .form-check-input { flex: none; margin: 0; }
.lg-multi-select__search { position: sticky; top: -0.5rem; z-index: 1; padding: 0.25rem 0.5rem 0.5rem; background: var(--bs-dropdown-bg, var(--bs-body-bg, #fff)); }
.lg-multi-select__clear { color: var(--lg-muted, #566174); font-size: 0.85rem; }

.lg-shell select.lg-input,
.lg-shell select.lg-input.lg-sm,
.lg-shell select.lg-input.lg-small-btn,
.lg-shell.lg-dialog select.lg-input,
.lg-shell.lg-dialog select.lg-input.lg-sm,
.lg-shell.lg-dialog select.lg-input.lg-small-btn {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-color: var(--lg-input-bg, #fff);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23202b3d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 8px;
}
html[data-bs-theme="dark"] .lg-shell select.lg-input,
html[data-bs-theme="dark"] .lg-shell.lg-dialog select.lg-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d0d3db' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.lg-shell input[type="file"].lg-input:not(.lg-sm):not(.lg-small-btn),
.lg-shell.lg-dialog input[type="file"].lg-input:not(.lg-sm):not(.lg-small-btn) {
  height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
}
