/*
 * AR-Factory — Enterprise shell layer.
 * Компоненты оболочки, портированные из эталона ar-factory-enterprise:
 * rail (аккаунт сверху, сворачиваемые группы, профиль снизу), topbar
 * (breadcrumbs, command palette, уведомления), статус-бар, popover-меню,
 * тосты с отменой. Токены — из ar-brand.css (те же значения).
 */

/* ---------- Базовые элементы ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

kbd {
    display: inline-block;
    border: 1px solid var(--border-default);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    padding: 0 5px;
    font: 10px/18px var(--font-ui);
    background: var(--surface-1);
    color: var(--text-dim);
    white-space: nowrap;
}

.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    flex: none;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); }
.icon-btn:active:not(:disabled) { background: var(--surface-3); }
.icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }

/* Рельса следует теме (--rail-surface) — вариант логотипа переключает
   общее правило ar-brand.css по data-ar-logo-variant. */

@media (max-width: 1024px) {
    .sidebar-logo.ar-rail__brand { justify-content: space-between; }
}

.btn {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: inline-flex;
    justify-content: center; align-items: center;
    gap: 8px;
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
    line-height: 1.4;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active:not(:disabled) { background: var(--surface-3); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { border-color: transparent; }
.btn-small { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.btn-link {
    border: 0; padding: 4px 0;
    background: transparent; color: var(--primary);
    font-weight: 650; min-height: 32px; font-size: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Topbar: breadcrumbs + actions ---------- */
/* Identity-блок шапки — горизонтальный ряд: гамбургер + divider + крошки.
   В ar-brand.css он grid (вертикальный), из-за чего видимый гамбургер
   при свёрнутой рельсе/на мобильном раздувал шапку до ~100px. */
.ar-topbar__identity { display: flex; align-items: center; gap: 8px; min-width: 0; }

.topbar-divider {
    height: 20px; width: 1px;
    background: var(--border-default);
    margin: 0 4px;
    flex: none;
}
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-dim); font-size: 12px;
    min-width: 0; white-space: nowrap; overflow: hidden;
}
.breadcrumb button {
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-dim);
    background: none; border: 0; cursor: pointer;
}
.breadcrumb button:hover { color: var(--primary); }
.breadcrumb svg { width: 13px; height: 13px; color: var(--text-dim); flex: none; }
.breadcrumb strong {
    color: var(--text-primary); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis;
}

.command-trigger {
    display: flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 10px;
    color: var(--text-dim); font-size: 11px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    cursor: pointer;
    transition: border-color var(--motion-fast), color var(--motion-fast);
}
.command-trigger:hover { border-color: var(--border-strong); color: var(--text-primary); }
.command-trigger svg { width: 15px; height: 15px; }
.command-trigger kbd { margin-left: 16px; line-height: 16px; font-size: 9px; }

.notification-trigger { position: relative; }
.notification-dot {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    right: 10px; top: 8px;
    box-shadow: 0 0 0 2px var(--surface-0);
}

/* ---------- Rail: аккаунт сверху ---------- */
.rail-account {
    padding: 0 12px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--rail-text) 10%, transparent);
    margin-bottom: 8px;
}
.account-button {
    display: flex; gap: 10px; align-items: center;
    width: 100%; min-height: 56px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--rail-text) 18%, transparent);
    border-radius: var(--radius-md);
    background: var(--rail-surface-raised);
    color: var(--rail-text);
    text-align: left;
    cursor: pointer;
    transition: background var(--motion-fast), border-color var(--motion-fast);
}
.account-button:hover { background: var(--rail-surface-raised); border-color: color-mix(in srgb, var(--rail-text) 22%, transparent); }
.account-button[aria-expanded="true"] { border-color: var(--nav-active-edge); }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong {
    font-size: 13px; display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--rail-text);
}
.account-copy small {
    display: block; font-size: 11px;
    color: var(--rail-muted);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-arrow { color: var(--rail-muted); flex: none; display: inline-flex; }
.account-arrow svg { width: 14px; height: 14px; }

/* ---------- Rail: сворачиваемые группы ---------- */
.nav-scroll {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}
.factory-nav-group { margin-bottom: 8px; }
.nav-items { display: grid; gap: 4px; }
.group-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    color: var(--rail-muted);
    padding: 0 12px;
    min-height: 32px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .055em;
    font-weight: 650;
    text-align: left;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: color var(--motion-fast), background var(--motion-fast);
}
.group-toggle:hover { color: var(--rail-text); background: color-mix(in srgb, var(--rail-text) 5%, transparent); }
.group-toggle svg {
    width: 13px; height: 13px; flex: none;
    transition: transform var(--motion-fast);
}
.group-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.nav-count {
    font-size: 10px;
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--rail-text) 20%, transparent);
    border-radius: var(--radius-sm);
    padding: 0 5px;
    font-variant-numeric: tabular-nums;
    color: inherit;
}

/* ---------- Rail: нижний блок ---------- */
.rail-bottom {
    flex: none;
    padding: 8px 12px 12px;
    border-top: 1px solid color-mix(in srgb, var(--rail-text) 10%, transparent);
    anchor-name: --rail-bottom;
}
.rail-utility {
    font-size: 11px;
    gap: 10px;
}
.rail-utility kbd {
    margin-left: auto;
    color: var(--rail-muted);
    border-color: color-mix(in srgb, var(--rail-text) 20%, transparent);
    background: transparent;
}
.profile-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 12px 0 0;
    margin-top: 8px;
    text-align: left;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--rail-text) 10%, transparent);
    background: transparent;
    color: var(--rail-text);
    cursor: pointer;
}
.profile-row:hover .profile-copy strong { text-decoration: underline; text-underline-offset: 3px; }
.profile-avatar {
    display: inline-flex; justify-content: center; align-items: center;
    flex: none;
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    font-weight: 750; font-size: 12px;
    background: var(--rail-surface-raised); color: var(--rail-text);
    border: 1px solid color-mix(in srgb, var(--rail-text) 12%, transparent);
    overflow: hidden;
    text-transform: uppercase;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy strong { display: block; font-size: 12px; font-weight: 650; }
.profile-copy small {
    font-size: 10px; color: var(--rail-muted);
    display: block; margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-gear { color: var(--rail-muted); flex: none; display: inline-flex; }
.profile-gear svg { width: 16px; height: 16px; }

/* ---------- Icon-rail (rail свёрнут) ---------- */
.factory-shell[data-rail-open="false"] .rail-account { padding: 0 8px 12px; }
.factory-shell[data-rail-open="false"] .account-button { min-height: 48px; padding: 7px; justify-content: center; }
.factory-shell[data-rail-open="false"] .account-copy,
.factory-shell[data-rail-open="false"] .account-arrow,
.factory-shell[data-rail-open="false"] .nav-count,
.factory-shell[data-rail-open="false"] .profile-copy,
.factory-shell[data-rail-open="false"] .profile-gear { display: none; }
.factory-shell[data-rail-open="false"] .group-toggle {
    height: 9px; min-height: 9px;
    border-top: 1px solid color-mix(in srgb, var(--rail-text) 10%, transparent);
    margin: 8px 8px 0;
    width: calc(100% - 16px);
    padding: 0;
    pointer-events: none;
}
.factory-shell[data-rail-open="false"] .group-toggle > * { display: none; }
.factory-shell[data-rail-open="false"] .nav-items { display: grid !important; }
.factory-shell[data-rail-open="false"] .rail-utility .nav-label,
.factory-shell[data-rail-open="false"] .rail-utility kbd { display: none; }
.factory-shell[data-rail-open="false"] .rail-utility { justify-content: center; }
.factory-shell[data-rail-open="false"] .profile-row { justify-content: center; }

/* ---------- Статус-бар ---------- */
.app-status {
    min-height: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 24px;
    gap: 12px;
    border-top: 1px solid var(--border-default);
    background: var(--surface-0);
    font-size: 10px;
    color: var(--text-dim);
}
.app-status > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.app-status svg { width: 12px; height: 12px; flex: none; }
.app-status .btn-link { min-height: 20px; font-size: 10px; font-weight: 550; }
.state-pill {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    color: var(--text-muted);
    white-space: nowrap;
}
.state-pill.is-offline {
    border-color: var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 650;
}
.dot-separator { color: var(--text-dim); }

/* ---------- Popover / меню ---------- */
.fx-popover {
    position: fixed;
    z-index: 320;
    border: 1px solid var(--border-default);
    padding: 6px;
    background: var(--surface-0);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    width: 284px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    animation: fx-pop-in var(--motion-base) var(--ease-standard);
}
@keyframes fx-pop-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.fx-popover--right { right: 16px; top: calc(var(--topbar-height) + 8px); }
/* Меню профиля открывается НАД блоком rail-bottom: bottom:12px перекрывало
   .profile-row, и повторный клик по кнопке попадал на пункт «Выйти».
   Fallback 148px — для браузеров без anchor positioning. */
.fx-popover--rail { left: 12px; bottom: 148px; }
@supports (position-anchor: --a) {
    .fx-popover--rail {
        position-anchor: --rail-bottom;
        bottom: calc(anchor(top) + 8px);
    }
}
.popover-heading {
    padding: 12px 12px 8px;
    font-size: 10px; letter-spacing: .04em;
    text-transform: uppercase; font-weight: 650;
    color: var(--text-dim);
}
.popover-note {
    padding: 0 12px 12px;
    color: var(--text-dim); font-size: 11px; line-height: 1.6;
}
.menu-item {
    padding: 9px 10px;
    min-height: 40px;
    display: flex; align-items: center; gap: 10px;
    text-align: left; width: 100%;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-primary);
    background: transparent;
    border: 0; cursor: pointer;
    transition: background var(--motion-fast);
}
.menu-item:hover, .menu-item[aria-selected="true"] { background: var(--surface-2); }
.menu-item.current { background: var(--surface-active); color: var(--primary); }
.menu-item.danger { color: var(--danger); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-item svg { width: 16px; height: 16px; flex: none; }
.menu-item .menu-copy { flex: 1; min-width: 0; }
.menu-item strong { font-size: 12px; display: block; font-weight: 600; }
.menu-item small { color: var(--text-dim); font-size: 10px; display: block; margin-top: 3px; }
.menu-item kbd { margin-left: auto; }
.menu-item .check { margin-left: auto; color: var(--primary); display: inline-flex; }
.menu-item .check svg { width: 14px; height: 14px; }
.menu-divider { height: 1px; background: var(--border-subtle); margin: 6px; }

.notification-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; gap: 10px;
    width: 100%; text-align: left;
    background: transparent; border-left: 0; border-right: 0; border-top: 0;
    color: var(--text-primary); cursor: default;
}
.notification-item:hover { background: var(--surface-1); }
.notification-item:last-of-type { border-bottom: 0; }
.notification-item__icon { color: var(--warning); margin-top: 2px; width: 16px; height: 16px; flex: none; display: inline-flex; }
.notification-item__icon svg { width: 16px; height: 16px; }
.notification-item.error .notification-item__icon { color: var(--danger); }
.notification-item.success .notification-item__icon { color: var(--success); }
.notification-item__body { flex: 1; min-width: 0; }
.notification-item strong { font-size: 12px; font-weight: 600; display: block; }
.notification-item p { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; line-height: 1.6; }
.notification-item small { display: block; font-size: 10px; margin-top: 6px; color: var(--text-dim); }
.notification-item.is-link { cursor: pointer; }
.notification-item.is-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.notification-item.is-unread .notification-item__body strong { color: var(--primary); }
.notification-item__dot {
    flex: none; width: 7px; height: 7px; margin-top: 6px;
    border-radius: 50%; background: var(--primary);
}
.notification-item__dismiss {
    flex: none; align-self: flex-start;
    width: 22px; height: 22px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-dim);
    font-size: 14px; line-height: 1; cursor: pointer;
    opacity: 0; transition: opacity var(--motion-fast);
}
.notification-item:hover .notification-item__dismiss,
.notification-item__dismiss:focus-visible { opacity: 1; }
.notification-item__dismiss:hover { background: var(--surface-2); color: var(--text-primary); }
.notification-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.notification-mark-all {
    border: 0; background: transparent; padding: 0;
    font-size: 11px; font-weight: 600; color: var(--primary);
    cursor: pointer; text-transform: none; letter-spacing: 0;
}
.notification-mark-all:hover { text-decoration: underline; }
.notification-tabs {
    display: flex; gap: 4px;
    padding: 0 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
}
.notification-tabs button {
    border: 0; border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 11px; font-weight: 600;
    background: transparent; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.notification-tabs button:hover { background: var(--surface-1); color: var(--text-primary); }
.notification-tabs button.active { background: var(--surface-2); color: var(--text-primary); }
.notification-tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.notification-tab-count {
    min-width: 16px; padding: 0 4px;
    border-radius: 999px;
    background: var(--primary); color: #fff;
    font-size: 9.5px; line-height: 16px; text-align: center;
}
.fx-freshness {
    align-self: center;
    font-size: 11px; color: var(--text-dim);
    white-space: nowrap;
}

/* ---------- Command palette ---------- */
.cmdk-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 11, 10, .54);
    z-index: 340;
    animation: cmdk-fade 200ms ease;
}
@keyframes cmdk-fade { from { opacity: 0; } to { opacity: 1; } }
.command-dialog {
    position: fixed;
    top: 16vh;
    left: 50%;
    /* translate-свойство, не transform: анимация transform'ом центрирование не затирает */
    translate: -50% 0;
    z-index: 350;
    width: 620px;
    max-width: calc(100vw - 32px);
    max-height: 70dvh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-default);
    background: var(--surface-0);
    color: var(--text-primary);
    box-shadow: var(--shadow-pop);
    border-radius: 10px;
    overflow: hidden;
    animation: cmdk-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cmdk-in {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.command-input-row {
    display: flex; align-items: center;
    padding: 12px 20px; gap: 12px;
    border-bottom: 1px solid var(--border-default);
    flex: none;
}
.command-input-row > svg { color: var(--text-dim); width: 18px; height: 18px; flex: none; }
.command-input-row input {
    border: 0 !important;
    background: transparent !important;
    padding: 8px 0 !important;
    outline: none !important;
    font-size: 15px !important;
    color: var(--text-primary);
    flex: 1; min-width: 0;
}
.command-input-row button {
    font-size: 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    color: var(--text-dim);
    background: transparent;
    cursor: pointer;
}
.command-results {
    padding: 8px;
    max-height: 48vh;
    overflow: auto;
    flex: 1;
}
.command-option {
    display: flex; align-items: center; gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    font-size: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
}
.command-option__icon { color: var(--text-muted); width: 18px; height: 18px; flex: none; display: inline-flex; }
.command-option__icon svg { width: 18px; height: 18px; }
.command-option__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-option[aria-selected="true"] { background: var(--surface-active); color: var(--primary); }
.command-option[aria-selected="true"] .command-option__icon { color: var(--primary); }
.command-option small { font-size: 10px; color: var(--text-dim); margin-left: auto; }
.command-option:disabled { opacity: .45; cursor: not-allowed; }
.command-footer {
    padding: 10px 20px;
    background: var(--surface-1);
    border-top: 1px solid var(--border-subtle);
    display: flex; gap: 16px;
    font-size: 10px; color: var(--text-dim);
    flex: none;
}
.command-empty {
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
}
.command-empty h3 { font-size: 13px; margin: 0 0 8px; font-weight: 650; }
.command-empty p { font-size: 11px; color: var(--text-dim); margin: 0; }
.command-group {
    padding: 10px 12px 4px;
    font-size: 10px; font-weight: 650;
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-dim);
}

.command-dialog.help-dialog { top: 14vh; width: min(480px, calc(100vw - 32px)); }
.help-body { padding: 4px 20px 18px; overflow: auto; }

/* ---------- Тосты: действие (undo) ---------- */
.top-toasts .toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.top-toasts .toast .toast-body { flex: 1; min-width: 0; }
.top-toasts .toast__action {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 11px;
    font-weight: 650;
    min-height: 24px;
    cursor: pointer;
}
.top-toasts .toast__action:hover { text-decoration: underline; text-underline-offset: 3px; }
.top-toasts .toast__close {
    flex: none;
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    margin: -4px -6px 0 0;
}
.top-toasts .toast__close:hover { background: var(--surface-2); color: var(--text-primary); }

/* ---------- Настройки (профиль popover, help) ---------- */
.setting-row {
    display: flex; align-items: center; gap: 16px;
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row > div { flex: 1; min-width: 0; }
.setting-row strong { font-size: 12px; font-weight: 600; display: block; }
.setting-row small {
    font-size: 11px; line-height: 1.6;
    color: var(--text-dim); display: block; margin-top: 4px;
}

.segment {
    display: flex;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    gap: 3px;
}
.segment button {
    min-height: 32px;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    border: 0; background: transparent; cursor: pointer;
}
.segment button[aria-pressed="true"] {
    background: var(--surface-0);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin: 16px 0;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Notice / empty-state (общие примитивы) ---------- */
.notice {
    display: flex; gap: 8px; align-items: flex-start;
    font-size: 11px; color: var(--text-muted);
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    line-height: 1.7;
}
.notice svg { margin-top: 1px; width: 15px; height: 15px; flex: none; }
.notice.warning { color: var(--warning); background: var(--warning-bg, color-mix(in srgb, var(--warning) 8%, var(--surface-0))); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.notice.error { color: var(--danger); background: var(--danger-bg, color-mix(in srgb, var(--danger) 8%, var(--surface-0))); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.notice.info { color: var(--info); background: var(--info-bg, color-mix(in srgb, var(--info) 8%, var(--surface-0))); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.notice strong { font-weight: 650; }

.empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 56px 24px;
    min-height: 340px;
    background: var(--surface-0);
}
.empty-icon {
    width: 52px; height: 52px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--surface-1);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h2 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 8px; }
.empty-state p { max-width: 410px; font-size: 12px; color: var(--text-muted); line-height: 1.8; margin: 0; }
.empty-actions {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px;
    margin-top: 24px;
}
.empty-meta { font-size: 10px !important; color: var(--text-dim) !important; margin-top: 20px !important; }

/* ---------- Page-head / eyebrow (принимается вьюхами) ---------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; margin-bottom: 24px;
}
.eyebrow {
    font-size: 10px; font-weight: 650;
    color: var(--text-dim);
    letter-spacing: .05em; text-transform: uppercase;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.eyebrow::before {
    content: "";
    display: block; height: 8px; width: 3px;
    border-radius: 1px;
    background: var(--primary);
}
.page-head h1 { font-size: 27px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.025em; }
.page-description {
    font-size: 12px; color: var(--text-muted);
    margin-top: 9px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
}
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 16px; }

.summary {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px;
    background: var(--surface-0);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}
.summary-icon { color: var(--warning); padding-top: 2px; display: inline-flex; }
.summary-icon svg { width: 18px; height: 18px; }
.summary-content { min-width: 0; flex: 1; }
.summary-content h2 { font-size: 13px; margin: 0 0 4px; }
.summary-content p { font-size: 11px; line-height: 1.6; color: var(--text-muted); max-width: 720px; margin: 0; }
.summary .btn { margin: auto 0; min-height: 36px; font-size: 11px; }
.summary .dismiss { width: 28px; height: 28px; margin: -4px -8px 0 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 1280px) {
    .command-label { display: none; }
    .command-trigger kbd { margin-left: 0; }
    .command-trigger { border: 0; background: transparent; padding: 0 4px; }
}
@media (max-width: 1024px) {
    .command-label { display: initial; }
    .command-trigger { border: 1px solid var(--border-default); padding: 0 8px; background: var(--surface-1); }
    .breadcrumb { font-size: 11px; }
    .breadcrumb button { font-size: 11px; }
    .app-status { padding: 4px 16px; }
    .fx-popover--rail { left: 12px; right: 12px; width: auto; }
}
@media (max-width: 768px) {
    .breadcrumb button, .breadcrumb > svg { display: none; }
    .breadcrumb strong { font-size: 12px; }
    .command-label, .command-trigger kbd { display: none; }
    .command-trigger { width: 40px; height: 40px; border: 0; background: none; justify-content: center; padding: 0; }
    .icon-btn { height: 44px; width: 44px; }
    .app-status { font-size: 9px; gap: 6px; }
    .app-status .status-right { display: none; }
    .fx-popover { left: 12px !important; right: 12px !important; width: auto; }
    .command-dialog { top: 10vh; }
}
@media (max-width: 400px) {
    .breadcrumb strong { max-width: 95px; }
    .notification-trigger { display: none; }
    .app-status { padding: 4px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .fx-popover, .command-dialog, .cmdk-backdrop { animation: none; }
}

/* ---------- Канонический спиннер загрузки ---------- */
.fx-spinner {
    width: 22px; height: 22px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: fx-spin .8s linear infinite;
    flex: none;
}
@keyframes fx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .fx-spinner { animation-duration: 1.8s; }
}

/* ---------- Печать: только контент ---------- */
@media print {
    .factory-rail, .ar-topbar, .app-status, .fx-head-actions, .fx-toolbar,
    .fx-pager, .top-toasts, dialog, .fx-popover, .pwa-tabbar { display: none !important; }
    html, body, .factory-shell, .main-area, .main-body, .ar-workspace {
        display: block; height: auto; overflow: visible; max-width: none;
        background: #fff; color: #251714;
    }
    .main-body { padding: 0; }
    .fx-panel, .fx-kpi-strip { break-inside: avoid; }
    .fx-table-scroll { overflow: visible; }
}
