/* ==========================================================================
   Base
   ========================================================================== */
:root {
    --bg: #090D15;
    --accent: #CFF01C;
    --text: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);

    --container-max: 1440px;

    --side-nav-collapsed: 56px;
    --side-nav-expanded: 210px;
    --side-nav-pad-x: 6px;
    --side-nav-pad-y: 6px;
    --side-nav-gap: 10px;
    --side-item-h: 36px;
    --side-icon: 30px;
    --side-text-size: 14px;

    --nav-bg: rgba(247, 248, 250, 0.72);
    --nav-hover-bg: #e9edf3;
    --nav-active-bg: #e9edf3;
    --nav-text: rgb(55, 65, 81);
    --nav-muted: rgba(55, 65, 81, 0.65);
    --nav-accent: #7c3aed;

    --tooltip-bg: rgba(17, 24, 39, 0.96);
    --tooltip-text: #ffffff;

    --page-bg: #f7f8fa;
    --card: #ffffff;
    --line: #e5e7eb;
    --muted: #6b7280;
    --primary: #7c3aed;
    --primary-soft: #f3efff;
    --danger: #ef4444;

    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-lg: 8px;

    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.10);

    --layout-gap: 18px;
    --panel-h: 780px;
    --preview-col: 320px;

    --table-min-width: 640px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

html,
body {
    height: 100%;
}

html {
    background: var(--bg);
    visibility: visible;
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background: transparent;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.4;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(93, 0, 207, 0.6) 0%,
        rgba(10, 13, 36, 1) 70%
    );
}

.opacity:hover {
    opacity:0.5;
}

audio, canvas, iframe, img, svg, video { vertical-align: middle; }
img { max-width: 100%; }
figure img { width: auto; max-width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; }
textarea { resize: vertical; }

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 1em 0;
    padding: 0;
}

.hidden, [hidden] { display: none !important; }
.invisible { visibility: hidden; }
.centered { text-align: center; }
._ns {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ==========================================================================
   Selection
   ========================================================================== */
::-moz-selection { background: var(--accent); text-shadow: none; }
::selection { background: var(--accent); text-shadow: none; }

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5 {
    font-family: "Unbounded", Arial, Helvetica, sans-serif;
    font-style: normal;
    color: #fff;
}

h1 { font-weight: 600; font-size: 48px; line-height: 120%; }
h2 { font-weight: 500; font-size: 20px; line-height: 130%; }
h3 { font-weight: 500; font-size: 20px; line-height: 140%; letter-spacing: 0.01em; }
h4 { font-weight: 500; font-size: 18px; line-height: 150%; letter-spacing: 0.01em; margin-top: 12px; color: #A788FF; }
h5 { font-weight: 500; font-size: 14px; line-height: 140%; letter-spacing: 0.01em; padding-bottom: 8px; color: #A788FF; }

p { font-size: 14px; line-height: 140%; color: var(--text-muted); }

a, a:link, a:hover, a:visited, a:active { text-decoration: none; }

.success { color: #DCFC28; }
.fail { color: rgba(255, 82, 76, 1); }

/* ==========================================================================
   Layout
   ========================================================================== */
#layout {
    margin: 0 auto;
    /* кабинет и суперадминка на всю ширину окна (решение владельца 29.10.2026) */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 20px 24px 32px;
    margin: 0;
}

footer {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding: 10px 32px;
}

.flex {
    display: flex;
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 1001;
    width: 100%;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7f8fa;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

header .btn-small {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    opacity: 0.7;
}

header .btn-small:hover { color: var(--primary); }

/* Суперадмин в кабинете клиента: плашка на всю ширину окна, темное матовое стекло.
   #layout отступает под меню, шапку растягиваем под него отрицательным отступом. */
header.is-adm {
    margin-left: calc(-1 * var(--side-nav-collapsed));
    width: calc(100% + var(--side-nav-collapsed));
    padding-left: calc(var(--side-nav-collapsed) + 12px);
    background: rgba(10, 12, 18, 0.9);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(10, 12, 20, 0.18);
}
header.is-adm::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03) 35%, rgba(255,255,255,0) 60%);
}
header.is-adm > * { position: relative; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-small {
    font-family: "Unbounded", Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0A0D24;
    line-height: 100%;
    letter-spacing: 0.02em;
    padding: 11px 20px;
    background-color: var(--accent);
    border-radius: 72px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    border: none;
    user-select: none;
}

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { filter: brightness(0.98); }

.btn-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.btn-create:hover { background: #6d28d9; }

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}

.icon-btn:hover { background: #f3f4f6; color: #6b7280; }
.icon-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   Forms
   ========================================================================== */
#asproform {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#asproform hgroup { padding: 12px 0 60px; }
#asproform .form-row { position: relative; padding-bottom: 40px; }

label.error {
    display: block;
    position: absolute;
    margin: 8px 0 0 16px;
    font-size: 12px;
    line-height: 120%;
    color: rgba(255, 82, 76, 1);
}

input, select, textarea, option {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 150%;
    padding: 12px 16px;
}

input, select, textarea {
    width: 100%;
    background-color: transparent !important;
    border-radius: 72px;
    border: 1.5px solid rgba(148, 116, 255, 1);
}

input, textarea { color: black; }

input:focus, select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    border-color: black;
    outline: none;
    color: black;
}

select, input::placeholder, textarea::placeholder {
    color: #888;
}

select {
    background-position: 98% center;
    background-repeat: no-repeat;
    border-radius: 72px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea { border-radius: 20px; resize: none; }

/* ==========================================================================
   Auth
   ========================================================================== */
.auth-wrapper {
    width: 100%;
    max-width: 520px;
    position: relative;
}

.auth-form {
    animation: authIn 700ms cubic-bezier(.2, .9, .2, 1) both;
    transform-origin: 50% 40%;
}

.auth-form input {
    color:white!important;
    border-color: white!important;
}

.auth-form hgroup {
    text-align: center;
    margin-bottom: 0;
    animation: authFade 900ms ease both;
    animation-delay: 120ms;
}

.auth-form h1 { margin-bottom: 12px; }
.auth-form h4 { color: var(--text-muted); }
.auth-form .form-row:nth-of-type(1) { animation: authUp 700ms cubic-bezier(.2, .9, .2, 1) both; animation-delay: 160ms; }
.auth-form .form-row:nth-of-type(2) { animation: authUp 700ms cubic-bezier(.2, .9, .2, 1) both; animation-delay: 240ms; }
/* Сообщение о неудачном входе. До 27.09.2026 форма молча возвращала пустой экран,
   и отличить неверный пароль от поломки входа было нечем. */
.auth-error {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #fca5a5;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    animation: authUp 700ms cubic-bezier(.2, .9, .2, 1) both;
    animation-delay: 120ms;
}

.auth-form .btn { 
    font-family: "Unbounded", Arial, Helvetica, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-size: 16px;
    color: #0A0D24;
    line-height: 100%;
    letter-spacing: 2%;
    text-decoration: none;
    padding: 20px 40px;
    background-color: #CFF01C;
    border-radius: 28px;
    border: none;
    width: 100%;
    padding: 25px
}

/* ==========================================================================
   Side nav
   ========================================================================== */
.side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-nav-collapsed);
    height: 100vh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--side-nav-gap);
    padding: var(--side-nav-pad-y) var(--side-nav-pad-x);
    background: rgba(247, 248, 250, 0.72) !important;
    backdrop-filter: blur(14px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.10);
    overflow: visible;
    transition: width 220ms ease;
}

.side-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,0.55), rgba(255,255,255,0.12) 35%, rgba(255,255,255,0) 60%);
    opacity: 0.35;
}

.side-nav:hover { width: var(--side-nav-expanded); }

.side-nav__top { position: relative; z-index: 2; flex: 0 0 auto; }

.side-nav__scroll {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: visible;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.side-nav__scroll::-webkit-scrollbar { display: none; }

.side-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--side-item-h);
    padding-left: 6px;
    padding-right: 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--nav-text);
    overflow: visible;
    user-select: none;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    transition: background-color 160ms ease, color 160ms ease;
}

.side-nav:hover .side-nav__item { padding-right: 24px; }
.side-nav__item:hover { background: var(--nav-hover-bg); }
.side-nav__item.is-active { background: var(--nav-active-bg); }

.side-nav__icon {
    width: var(--side-icon);
    min-width: var(--side-icon);
    height: var(--side-icon);
    display: grid;
    place-items: center;
    color: var(--nav-muted);
    transition: color 160ms ease;
}

.side-nav__icon svg { width: 70%; height: 70%; display: block; }

.side-nav__text {
    font-size: var(--side-text-size);
    line-height: 1;
    white-space: nowrap;
    color: var(--nav-text);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 180ms ease, transform 180ms ease, color 160ms ease;
}

.side-nav:hover .side-nav__text { opacity: 1; transform: translateX(0); }

.side-nav__item:hover .side-nav__icon,
.side-nav__item:hover .side-nav__text,
.side-nav__item.is-active .side-nav__icon,
.side-nav__item.is-active .side-nav__text {
    color: var(--nav-accent);
}

.side-nav__brand { font-weight: 600; }
.side-nav__brand:hover { background: transparent; }

.side-nav__divider {
    pointer-events: none;
    height: 30px;
    padding-left: 8px;
    background: transparent !important;
}

.side-nav__divider .side-nav__text {
    font-size: 12px;
    font-weight: 600;
    color: rgba(107, 114, 128, 1);
    opacity: 0 !important;
    transform: translateX(-6px) !important;
}

.side-nav:hover .side-nav__divider .side-nav__text {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.side-nav__divider::before,
.side-nav__divider::after { display: none !important; }

#minilogo { width: 26px; height: 26px; display: block; }

/* Светлый логотип клиента (белый знак на прозрачном фоне) на светлом меню не виден.
   Признак считается при загрузке файла (clients.logo_light), здесь только подложка. */
.side-nav__icon--plate {
    background: #1f2430;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
}
.side-nav__icon--plate #minilogo { width: 100%; height: 100%; object-fit: contain; }


#minifooterlogo {
    width: 26px;
    height: 26px;
    display: block;
    margin-right: 10px;
    position: relative;
    top: -4px;
}

/* ==========================================================================
   Tooltip
   ========================================================================== */
.side-nav__item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 5000;
}

.side-nav__item[data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid rgba(17, 24, 39, 0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 5000;
}

.side-nav:not(:hover) .side-nav__item[data-tooltip]:hover::after,
.side-nav:not(:hover) .side-nav__item[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.side-nav:not(:hover) .side-nav__item[data-tooltip]:hover::after {
    transform: translateY(-50%) translateX(0);
}

#nav-tooltip {
    position: fixed;
    z-index: 999999;
    display: none;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   Page / card
   ========================================================================== */
.page {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
    color: #111827;
    display: flex;
    overflow: auto;
    flex: 1 1 0;
}

.page__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page__title {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 2.5;
    font-weight: 700;
}

.card {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card__top {
    display: flex;
    justify-content: flex-end;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

.card__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    position: absolute;
    top: -2px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* ==========================================================================
   Preview block (avatar)
   ========================================================================== */
.avatar_col {
    width: 380px;
    min-width: 280px;
    max-width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-right: 10px;
    flex: 0 0 380px;
    overflow: hidden;
}

.avatar_bg {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 8px 8px 0 0;
    background-image: url('/web/img/avatar_bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
}

.avatar_img {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
    will-change: transform, filter;
}

/* Промт блок */
.prompt-box {
    flex-shrink: 0;
    background: url('/web/img/avatar_bg.png') center bottom / cover no-repeat;
    border-top: 1px solid rgba(207, 240, 28, 0.25);
    border-radius: 0 0 15px 15px;
    padding: 14px 16px;
    position: relative;
}

.prompt-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(9, 5, 25, 0.78);
    border-radius: 0 0 15px 15px;
    pointer-events: none;
}

.prompt-label {
    position: relative;
    z-index: 1;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(207, 240, 28, 0.7);
    margin-bottom: 8px;
    user-select: none;
}

.prompt-textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 60px;
}

.prompt-textarea::placeholder { color: rgba(255, 255, 255, 0.3) !important; }

.prompt-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    gap: 10px;
}

.prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 72px;
    border: none;
    background: #CFF01C;
    color: #0A0D24;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.prompt-btn:hover { filter: brightness(1.08); }
.prompt-btn:active { transform: scale(0.97); }

/* Прогресс бар */
.prompt-progress {
    position: relative;
    z-index: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(207, 240, 28, 0.12);
    margin: 10px 0 0;
    overflow: hidden;
}

.prompt-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #CFF01C);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* ==========================================================================
   Анимации генерации
   ========================================================================== */
@keyframes avatar-breathe {
    0%, 100% { transform: scale(1);    filter: blur(0px)   brightness(1); }
    50%       { transform: scale(1.07); filter: blur(2px)   brightness(1.2); }
}

@keyframes star-float {
    0%   { opacity: 0; transform: translate(0px, 0px) scale(0) rotate(0deg); }
    20%  { opacity: 1; transform: translate(var(--sx1), var(--sy1)) scale(1) rotate(60deg); }
    100% { opacity: 0; transform: translate(var(--sx2), var(--sy2)) scale(0) rotate(220deg); }
}

@keyframes btn-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.91); }
    70%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes btn-glow {
    0%, 100% { box-shadow: 0 0 6px 2px rgba(207, 240, 28, 0.4); }
    50%       { box-shadow: 0 0 20px 6px rgba(207, 240, 28, 0.85); }
}

@keyframes label-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

@keyframes progress-fill {
    0%   { width: 0%; }
    80%  { width: 88%; }
    100% { width: 100%; }
}

.avatar_bg.is-generating .avatar_img { animation: avatar-breathe 2.2s ease-in-out infinite; }
.prompt-btn.is-generating { animation: btn-pop 0.3s ease forwards, btn-glow 1.2s ease-in-out 0.3s infinite; pointer-events: none; opacity: 0.9; }
.prompt-label.is-generating { animation: label-pulse 1.2s ease-in-out infinite; color: #CFF01C; }
.prompt-progress__bar.is-running { animation: progress-fill 3s cubic-bezier(0.1, 0.4, 0.2, 1) forwards; }

.avatar-star {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: star-float 1.5s ease-out forwards;
}

/* ==========================================================================
   Table (base — avatars, clients)
   ========================================================================== */
.table-wrap {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: var(--table-min-width);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f7f8fa;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
    background: #fff;
}

.flex_center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.flex_center svg {
    width: 40px;
    height: 40px;
    cursor:pointer;
    opacity:0.5;
}

.col-img { width: 72px; }
.col-name { width: 140px; overflow: hidden; }
.col-level { width: 110px; white-space: nowrap; }
.col-role { width: 260px; }
.col-actions { width: 56px; text-align: center; }

.table-actions { text-align: center !important; }

.avatar-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
}

.col-role__list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.teg {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0 12px;
    border-radius: 8px;
    line-height: 32px;
    white-space: nowrap;
    background: rgba(41, 92, 201, 0.15);
}

/* ==========================================================================
   Editable name
   ========================================================================== */
.col-name__edit {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    outline: none;
    cursor: text;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.col-name__edit:hover { background: #f9fafb; }
.col-name__edit:focus { background: #ffffff; box-shadow: inset 0 0 0 1px #d1d5db; }
.col-name__edit.is-saving { opacity: 0.6; }
.col-name__edit:empty::before { content: "Без имени"; color: #9ca3af; }

/* ==========================================================================
   Level controls
   ========================================================================== */
.level-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.level-btn:hover { background: #e5e7eb; }

.level-value {
    display: inline-block;
    width: 24px;
    text-align: center;
    font-weight: 600;
}

/* ==========================================================================
   Row menu
   ========================================================================== */
.row-menu { position: relative; display: inline-block; }

.row-menu__btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
}

.row-menu__btn:hover { background: #f3f4f6; }
.row-menu__btn svg { width: 18px; height: 18px; fill: #6b7280; }

.row-menu__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    border: 1px solid #e5e7eb;
    display: none;
    z-index: 1000;
}

.row-menu.is-open .row-menu__dropdown { display: block; }

.row-menu__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    color: #111827;
}

.row-menu__option:hover { background: #f9fafb; }

.row-menu__option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 16px;
}

.row-menu__option span {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.row-menu__divider { height: 1px; margin: 8px 4px; background: #e5e7eb; }

.row-menu__delete {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
}
.row-menu__delete svg { width:20px; }

.row-menu__stop {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
}
.row-menu__stop svg { width:20px; }

.row-menu__stop:hover { background: var(--nav-hover-bg); }
.row-menu__delete:hover { background: var(--nav-hover-bg); }

/* ==========================================================================
   Misc
   ========================================================================== */
.row-actions { display: flex; justify-content: flex-end; gap: 14px; }

.link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
}

.link svg { width: 16px; height: 16px; }
.link--edit { color: var(--primary); }
.link--edit:hover { text-decoration: underline; }
.link--del { color: var(--danger); }
.link--del:hover { text-decoration: underline; }

.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.th-sort__icon { width: 16px; height: 16px; color: #9ca3af; }
.th-sort:hover .th-sort__icon { color: #6b7280; }

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 0 6px;
    font-size: 14px;
    color: var(--muted);
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-weight: 500;
    transition: color 140ms ease;
}

.breadcrumbs__item svg { width: 16px; height: 16px; }
.breadcrumbs__item:hover { color: var(--primary); }

.breadcrumbs__sep { color: #cbd5e1; }
.breadcrumbs__current { color: #111827; font-weight: 600; }

#copyright { display: flex; }

/* ==========================================================================
   Skeleton (base)
   ========================================================================== */
.sk {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 8px;
}

.sk::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeleton-shimmer 1.3s infinite;
}

.sk-avatar { width: 44px; height: 44px; border-radius: 10px; }
.sk-text { width: 100%; max-width: 120px; height: 16px; }
.sk-level { width: 78px; height: 26px; border-radius: 8px; }
.sk-role-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.sk-tag { height: 35px; border-radius: 8px; }
.sk-tag--1 { width: 72px; }
.sk-tag--2 { width: 108px; }
.sk-menu { width: 18px; height: 18px; margin-left: auto; border-radius: 4px; }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes authFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes authUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes skeleton-shimmer { 100% { transform: translateX(100%); } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* ── Desktop wide ── */
@media (min-width: 1600px) {
    :root {
        --container-max: 1660px;
        --preview-col: 360px;
        --panel-h: 820px;
    }
    main { padding: 24px; }
    .avatar_col { width: 400px; max-width: 400px; flex: 0 0 400px; }
}

/* ── Laptop ── */
@media (max-width: 1280px) {
    :root {
        --preview-col: 280px;
        --panel-h: 720px;
        --layout-gap: 16px;
    }
    main { padding: 16px; }
    .table { min-width: 620px; }
    .col-role { width: 230px; }
    .avatar_col { width: 320px; max-width: 320px; flex: 0 0 320px; }
}

/* ── Tablet landscape ── */
@media (max-width: 1080px) {
    :root { --preview-col: 240px; --panel-h: 680px; }
    .flex { gap: 14px; }
    .table { min-width: 590px; }
    .col-name { width: 130px; }
    .col-level { width: 96px; }
    .col-role { width: 210px; }
    .avatar_col { width: 280px; max-width: 280px; flex: 0 0 280px; min-width: 240px; }
}

/* ── Tablet portrait — stack ── */
@media (max-width: 900px) {
    #layout { height: auto; min-height: 100vh; overflow: auto; }
    main { flex: 1 0 auto; min-height: auto; }
    .flex { flex-direction: column; flex: 1 1 auto; overflow: visible; }
    .avatar_col { width: 100%; max-width: 100%; flex: 0 0 auto; height: auto; margin-right: 0; margin-bottom: 16px; }
    .avatar_bg { height: 320px; flex: 0 0 320px; }
    .page { height: auto; display: block; }
    .card { height: auto; display: block; }
    .table-wrap { height: auto; }
}

/* ── Mobile large ── */
@media (max-width: 720px) {
    :root { --side-nav-collapsed: 48px; --side-nav-expanded: 170px; --side-item-h: 34px; --side-icon: 26px; --side-text-size: 13px; }
    h1 { font-size: 28px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 15px; } h5 { font-size: 13px; }
    main { min-height: auto; padding: 12px; }
    footer { flex-direction: column; gap: 8px; padding: 10px 16px; }
    .avatar_col { width: 100%; max-width: 100%; height: auto; margin-right: 0; margin-bottom: 20px; }
    .avatar_bg { height: 320px; }
    .flex { display: block; }
    .card { border-radius: 12px; }
    .table { min-width: 560px; }
    .table thead th, .table tbody td { padding: 8px 10px; font-size: 13px; }
    .teg { padding: 0 10px; line-height: 30px; font-size: 12px; }
    .row-menu__dropdown { min-width: 190px; }
    .btn-create { min-width: 26px; height: 26px; padding: 0 8px; }
    .col-name__edit { padding: 4px 6px; }
}

/* ── Mobile ── */
@media (max-width: 560px) {
    main { padding: 10px; }
    .table-wrap { max-height: 65vh; }
    .table { min-width: 520px; }
    .table thead th, .table tbody td { padding: 8px 8px; }
    .col-img { width: 64px; } .col-name { width: 120px; } .col-level { width: 92px; } .col-role { width: 190px; } .col-actions { width: 48px; }
    .avatar-img, .sk-avatar { width: 40px; height: 40px; }
    .level-btn { width: 22px; height: 22px; }
    .level-value { width: 20px; }
    .avatar_bg { height: 260px; }
}

/* ── Small mobile ── */
@media (max-width: 420px) {
    :root { --side-nav-collapsed: 44px; --side-nav-expanded: 160px; --side-icon: 24px; }
    header { padding: 8px 10px; }
    header .btn-small { font-size: 13px; }
    .breadcrumbs { font-size: 12px; }
    .table-wrap { max-height: 62vh; }
    .table { min-width: 500px; }
    .row-menu__dropdown { right: -6px; min-width: 180px; }
    .btn-create { min-width: 24px; height: 24px; padding: 0 6px; font-size: 13px; }
    .col-name__edit { min-height: 26px; }
    .teg { font-size: 11px; line-height: 28px; padding: 0 8px; }
    .avatar_bg { height: 220px; }
}

/* ── Short viewport ── */
@media (max-height: 760px) {
    .table-wrap { height: min(72vh, 620px); }
}

/* ==========================================================================
   Auth page
   ========================================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Top tabs
   ========================================================================== */
.top-tabs-wrap { width: 100%; flex: 0 0 auto; margin-bottom: 8px; padding: 0; }

.top-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    padding: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.top-tabs::-webkit-scrollbar { display: none; }

.top-tab {
    position: relative;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 22px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: #4b5563;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.top-tab:hover, .top-tab:hover .top-tab__icon { color: var(--nav-accent); }

.top-tab--entity { padding-left: 10px; padding-right: 10px; font-weight: 600; }

.top-tab__icon {
    width: 30px; height: 30px; min-width: 30px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f3f4f6; color: #111827;
}

.top-tab__icon svg { width: 18px; height: 18px; }
.top-tab__label { display: inline-block; transform: translateY(-0.5px); }
.top-tab.is-active .top-tab__icon { color: var(--nav-accent); }
.top-tab.is-active .top-tab__label { color: var(--nav-accent); }


/* ==========================================================================
   Users table – grouped layout
   Scoped to .users-table so it doesn't break avatars/clients
   ========================================================================== */

/* ── Card header (shared) ── */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.card-header h2 {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.card-header .count {
    font-weight: 400;
    color: var(--muted);
}

/* ── Add button ── */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    transition: background 0.15s;
}

.btn-add:hover { background: #6d28d9; }

.btn-add svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ── Users table: override base .table ── */
.users-table {
    table-layout: auto !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    min-width: 900px !important;
}

/* ── Group header row ── */
.users-table .group-row th {
    background: #f0f1f4;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    padding: 7px 16px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
}

.users-table .group-row th.group-user  { color: var(--primary); }
.users-table .group-row th.group-metrics { color: #6b7280; }
.users-table .group-row th.group-empty {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

/* ── Column header row ── */
.users-table .col-row th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 10px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--line);
}

.users-table .col-row th.col-contacts  { min-width: 200px; }
.users-table .col-row th.col-dates     { min-width: 130px; }
.users-table .col-row th.col-role-head { min-width: 110px; }
.users-table .col-row th.col-point     { min-width: 100px; }
.users-table .col-row th.col-metric    { min-width: 80px; }
.users-table .col-row th.col-dots      { width: 48px; text-align: center; }

/* ── Shots sub-column headers ── */
.users-table .col-row th.col-shots {
    min-width: 80px;
    text-align: center;
    border-left: 1px solid var(--line);
    font-weight: 500;
    color: #9ca3af;
}

/* ── Vertical separator (group divider) ── */
.users-table th.col-sep,
.users-table td.col-sep {
    width: 2px !important;
    min-width: 2px !important;
    max-width: 2px !important;
    padding: 0 !important;
    background: var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
}

/* ── Body cells ── */
.users-table tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--line) !important;
    font-size: 14px;
    vertical-align: middle;
    background: #fff;
}

.users-table tbody tr:hover td {
    background: #fafbfc;
}

.users-table tbody tr:hover td.col-sep {
    background: var(--line) !important;
}

/* ── Shots body cells ── */
.users-table td.shots-col {
    text-align: center;
    border-left: 1px solid #f0f1f4;
}

/* ── Center helper ── */
.users-table td.center {
    text-align: center;
}

/* ── User cell (avatar + name + id) ── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* ── Dates cell ── */
.dates-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* ── Role cell ── */
.role-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* ── Actions dot button ── */
.actions-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    color: #9ca3af;
}

.actions-btn:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.actions-btn svg {
    width: 16px;
    height: 16px;
}

/* ── Users table skeleton shapes (pill style) ── */
.users-table .sk-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.sk-name {
    width: 100px;
    height: 14px;
    border-radius: 20px;
}

.sk-sub {
    width: 44px;
    height: 11px;
    border-radius: 20px;
}

.sk-text-xs {
    width: 56px;
    height: 12px;
    border-radius: 20px;
}

.sk-text-sm {
    width: 80px;
    height: 14px;
    border-radius: 20px;
}

.users-table .sk-tag {
    height: 28px;
    width: 64px;
    border-radius: 20px;
}

.sk-bar {
    width: 48px;
    height: 8px;
    border-radius: 20px;
}

.sk-num {
    width: 36px;
    height: 14px;
    border-radius: 20px;
    margin: 0 auto;
}

/* ── Stagger shimmer ── */
.users-table tbody tr:nth-child(2)  .sk { animation-delay: 0.05s; }
.users-table tbody tr:nth-child(3)  .sk { animation-delay: 0.10s; }
.users-table tbody tr:nth-child(4)  .sk { animation-delay: 0.15s; }
.users-table tbody tr:nth-child(5)  .sk { animation-delay: 0.20s; }
.users-table tbody tr:nth-child(6)  .sk { animation-delay: 0.25s; }
.users-table tbody tr:nth-child(7)  .sk { animation-delay: 0.30s; }
.users-table tbody tr:nth-child(8)  .sk { animation-delay: 0.35s; }
.users-table tbody tr:nth-child(9)  .sk { animation-delay: 0.40s; }
.users-table tbody tr:nth-child(10) .sk { animation-delay: 0.45s; }

/* ==========================================================================
   Shop
   ========================================================================== */
.shop-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px 24px;
}

.shop-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 14px;
}

.shop-cat-skeleton {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
}

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

/* ── Категория ── */
.shop-cat {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.shop-cat:hover { box-shadow: 0 2px 10px rgba(15,23,42,0.06); }
.shop-cat.is-dragging { opacity: 0.5; border-color: var(--primary); }

.shop-cat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.shop-cat__handle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: grab;
    flex-shrink: 0;
}
.shop-cat__handle:active { cursor: grabbing; }
.shop-cat__handle svg { width: 18px; height: 18px; }

.shop-cat__chevron {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.shop-cat__chevron svg { width: 16px; height: 16px; }
.shop-cat.is-open .shop-cat__chevron { transform: rotate(90deg); }

.shop-cat__name {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    min-width: 0;
}
.shop-cat__name:hover { background: #f9fafb; }
.shop-cat__name:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; cursor: text; }

.shop-cat__count {
    font-size: 12px;
    color: var(--muted);
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.shop-cat__add,
.shop-cat__delete {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}
.shop-cat__add:hover { background: #f3efff; color: var(--primary); }
.shop-cat__delete:hover { background: #fef2f2; color: var(--danger); }
.shop-cat__add svg, .shop-cat__delete svg { width: 16px; height: 16px; }

/* ── Тело категории ── */
.shop-cat__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.shop-cat.is-open .shop-cat__body {
    max-height: 4000px;
}

.shop-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 6px 16px 18px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

/* ── Карточка товара ── */
.shop-product {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, transform 0.1s;
}
.shop-product:hover { box-shadow: 0 4px 14px rgba(15,23,42,0.08); }

.shop-product__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
}

.shop-product__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}

.shop-product__name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding: 2px 4px;
    border-radius: 4px;
    outline: none;
    line-height: 1.3;
}
.shop-product__name:hover { background: #f9fafb; }
.shop-product__name:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }

.shop-product__desc {
    font-size: 12px;
    color: var(--muted);
    padding: 2px 4px;
    border-radius: 4px;
    outline: none;
    line-height: 1.4;
    flex: 1 1 auto;
}
.shop-product__desc:hover { background: #f9fafb; }
.shop-product__desc:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }

.shop-product__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.shop-product__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.shop-product__price .shop-edit {
    padding: 2px 4px;
    border-radius: 4px;
    outline: none;
}
.shop-product__price .shop-edit:hover { background: #f9fafb; }
.shop-product__price .shop-edit:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }

.shop-product__del {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.shop-product__del:hover { background: #fef2f2; color: var(--danger); }
.shop-product__del svg { width: 14px; height: 14px; }

/* ── Карточка "Добавить" ── */
.shop-product--add {
    border: 2px dashed var(--line);
    background: #fafbfc;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    transition: border-color 0.15s, background 0.15s;
}
.shop-product--add:hover {
    border-color: var(--primary);
    background: #f3efff;
}
.shop-product__plus {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 8px;
}
.shop-product__plus svg { width: 20px; height: 20px; }
.shop-product__addlabel {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.shop-product__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    transition: filter 0.15s;
}
.shop-product__img::after {
    content: 'Изменить фото';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.15s;
}
.shop-product__img:hover::after { opacity: 1; }

/* ── Cropper modal ── */
.cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.cropper-modal.is-open { display: flex; }

.cropper-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 21, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cropper-modal__dialog {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    width: min(560px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 1;
}

.cropper-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.cropper-modal__title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.cropper-modal__close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
}
.cropper-modal__close:hover { background: #f3f4f6; }

.cropper-modal__body {
    padding: 16px;
    background: #1a1f2e;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.cropper-modal__body img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.cropper-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.cropper-btn {
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.cropper-btn:disabled { opacity: 0.6; cursor: default; }
.cropper-btn--ghost {
    background: #f3f4f6;
    color: #374151;
}
.cropper-btn--ghost:hover { background: #e5e7eb; }
.cropper-btn--primary {
    background: var(--primary);
    color: #fff;
}
.cropper-btn--primary:hover { background: #6d28d9; }

.cropper-modal__body {
    padding: 16px;
    background: #1a1f2e;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.cropper-modal__body .cropper-container {
    background: #1a1f2e;
}

.cropper-modal__body .cropper-bg {
    background-image: none;
}

.cropper-modal__body .cropper-modal {
    background-color: #1a1f2e;
    opacity: 0.6;
}
/* ── Crop dialog ── */
.crop-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.crop-dialog.is-open { display: flex; }

.crop-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 21, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.crop-dialog__panel {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    width: min(560px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 1;
}

.crop-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.crop-dialog__title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.crop-dialog__close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
}
.crop-dialog__close:hover { background: #f3f4f6; }

.crop-dialog__body {
    padding: 16px;
    background: #1a1f2e;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.crop-dialog__body img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.crop-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.shop-product__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px 0;
}
.shop-badge { cursor: pointer; user-select: none; }
.shop-badge input { display: none; }
.shop-badge span {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #fff;
    color: #9ca3af;
    transition: all 0.12s;
}
.shop-badge:hover span { border-color: #d1d5db; }
.shop-badge--new  input:checked + span { background: #00e5ff; color: #000; border-color: #10b981; }
.shop-badge--hot  input:checked + span { background: #ff1744; color: #fff; border-color: #ef4444; }
.shop-badge--sale input:checked + span { background: #39ff14; color: #000; border-color: #f59e0b; }


/* ── Галерея товара (4 слота) ── */
.shop-product__gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px 4px 0;
}
.shop-gallery-cell {
    aspect-ratio: 1 / 1;
    border: 1px dashed var(--line);
    border-radius: 6px;
    background: #fafbfc;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1c5cc;
    cursor: pointer;
    position: relative;
    transition: border-color 0.12s, background-color 0.12s, color 0.12s;
}
.shop-gallery-cell:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: #f3efff;
}
.shop-gallery-cell.has-img {
    border-style: solid;
    border-color: var(--line);
    background-color: #f3f4f6;
}
.shop-gallery-cell svg {
    width: 16px;
    height: 16px;
}
.shop-gallery-cell__del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.shop-gallery-cell.has-img:hover .shop-gallery-cell__del {
    display: flex;
}
/* ── Кнопки в футере карточки ── */
.shop-product__actions {
    display: flex;
    gap: 2px;
}
.shop-product__preview {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.shop-product__preview:hover { background: #f3efff; color: var(--primary); }
.shop-product__preview svg { width: 16px; height: 16px; }

/* ── Preview modal (мобильный фрейм) ── */
.preview-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.preview-dialog.is-open { display: flex; }

.preview-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 2, 15, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.preview-dialog__phone {
    position: relative;
    width: 360px;
    height: 720px;
    max-height: 92vh;
    background: #0f0820;
    border-radius: 38px;
    border: 10px solid #000;
    box-shadow: 0 30px 80px rgba(168, 85, 247, 0.25), 0 0 0 1px rgba(168, 85, 247, 0.2);
    overflow: hidden;
    z-index: 1;
}

.preview-phone__notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 22px;
    background: #000;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    z-index: 10;
}

.preview-phone__screen {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: linear-gradient(180deg, #1a0b2e 0%, #0f0820 50%, #1a0b2e 100%);
    display: flex;
    flex-direction: column;
}
.preview-phone__screen::-webkit-scrollbar { width: 0; }

.preview-dialog__close {
    position: absolute;
    top: -42px;
    right: 0;
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}
.preview-dialog__close:hover { background: rgba(255,255,255,0.22); }

/* ── Хедер мобильного экрана ── */
.pv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 14px 10px;
    background: transparent;
    position: relative;
    z-index: 3;
}
.pv-header__btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
}
.pv-header__btn svg { width: 18px; height: 18px; }
.pv-header__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* ── Галерея ── */
.pv-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #1a0b2e;
    overflow: hidden;
    flex-shrink: 0;
}
.pv-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease;
    will-change: transform;
}
.pv-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.pv-dots {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.pv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.15s;
}
.pv-dot.is-active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.pv-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    z-index: 2;
}
.pv-badge--new  {
    background: #00e5ff;
    color: #000;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.7), 0 0 4px rgba(6, 182, 212, 0.9);
}
.pv-badge--hot  {
    background: #ff1744;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.7), 0 0 4px rgba(244, 63, 94, 0.9);
}
.pv-badge--sale {
    background: #39ff14;
    color: #000;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.7), 0 0 4px rgba(16, 185, 129, 0.9);
}

/* ── Контент ── */
.pv-content {
    padding: 22px 20px 110px;
    background: linear-gradient(180deg, #1a0b2e 0%, #15081f 100%);
    flex: 1 1 auto;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    margin-top: -22px;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 -8px 30px rgba(168, 85, 247, 0.15);
}
.pv-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 12px;
}
.pv-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}
.pv-price__current {
    font-size: 26px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}
.pv-price__old {
    font-size: 15px;
    color: #6b6580;
    text-decoration: line-through;
}
.pv-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a78bfa;
    margin-bottom: 8px;
}
.pv-desc {
    font-size: 14px;
    color: #c4b8d6;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* ── Кнопки действий ── */
.pv-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 18px 22px;
    background: linear-gradient(to top, #15081f 60%, rgba(21, 8, 31, 0.9) 85%, rgba(21, 8, 31, 0));
    z-index: 5;
    display: flex;
    gap: 10px;
}
.pv-action-btn {
    flex: 1 1 0;
    height: 52px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}
.pv-action-btn:active { transform: scale(0.97); }
.pv-action-btn svg { width: 18px; height: 18px; }

.pv-action-btn--buy {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.55), 0 4px 14px rgba(124, 58, 237, 0.4);
}
.pv-action-btn--buy:hover {
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.75), 0 4px 18px rgba(124, 58, 237, 0.5);
}

.pv-action-btn--gift {
    background: rgba(168, 85, 247, 0.08);
    color: #c4b5fd;
    border: 1.5px solid rgba(168, 85, 247, 0.5);
    box-shadow: inset 0 0 14px rgba(168, 85, 247, 0.1);
}
.pv-action-btn--gift:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: inset 0 0 14px rgba(168, 85, 247, 0.15), 0 0 14px rgba(168, 85, 247, 0.3);
}

/* ══════════════════════════════════════════════════════════
   ORG STRUCTURE
   ══════════════════════════════════════════════════════════ */

.org-wrap {
    font-family: var(--font-sans, -apple-system, sans-serif);
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.org-canvas {
    position: relative;
    background: #f7f7f5;
    border-radius: 16px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: auto;
    cursor: grab;
    user-select: none;
}
.org-canvas.is-dragging {
    cursor: grabbing;
}

.org-canvas.is-dragging * {
    cursor: grabbing !important;
    user-select: none !important;
}
.org-scroll {
    /* больше не нужен как отдельный скролл-контейнер,
       но если ты его оставил в HTML — пусть просто не мешает */
    width: 100%;
    min-width: max-content;
}

.org-svg-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.org-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    width: max-content;
    min-width: 100%;
    padding: 32px;
    box-sizing: border-box;
    z-index: 2;
}
/* ── HQ (главный юнит) ──────────────────────────────────── */
.org-hq {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 16px 28px;
    min-width: 240px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 3;
}

.org-hq__label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    font-weight: 500;
}

.org-hq__name {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

/* ── Ряд точек ──────────────────────────────────────────── */
.org-points {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: nowrap;
    justify-content: center;
    position: relative;
    z-index: 2;
    /* убираем overflow-x и max-width — скролл теперь у холста */
}

/* ── Точка ──────────────────────────────────────────────── */
.org-point {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px;
    width: 240px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.org-point:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.org-point.dragging {
    opacity: 0.4;
}

.org-point.drag-over {
    border-color: #2563eb;
    border-width: 2px;
    padding: 13px;
}

.org-point__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.org-point__drag {
    cursor: grab;
    color: #d1d5db;
    font-size: 14px;
    user-select: none;
    padding: 2px 4px;
    line-height: 1;
}

.org-point__drag:hover {
    color: #6b7280;
}

.org-point__drag:active {
    cursor: grabbing;
}

.org-point__title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    min-width: 0;
}

.org-point__title:focus {
    background: #eff6ff;
}

.org-point__del {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.org-point__del:hover {
    background: #fef2f2;
    color: #ef4444;
}

.org-point__chief {
    font-size: 12px;
    color: #6b7280;
    padding: 6px 8px;
    border-radius: 6px;
    outline: none;
    margin-bottom: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    cursor: text;
}

.org-point__chief:focus {
    background: #eff6ff;
    border-style: solid;
    border-color: #2563eb;
    color: #111827;
}

/* ── Виды сотрудников ───────────────────────────────────── */
.org-depts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.org-dept {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 10px;
}

.org-dept__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.org-dept__name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.org-dept__name:focus {
    background: #eff6ff;
}

.org-dept__del {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 15px;
    padding: 0 6px;
    line-height: 1;
    border-radius: 4px;
}

.org-dept__del:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ── Должности ──────────────────────────────────────────── */
.org-positions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.org-position {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 8px 10px;
}

.org-position__head {
    display: flex;
    align-items: center;
    gap: 4px;
}

.org-position__name {
    flex: 1;
    font-size: 12px;
    color: #111827;
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}

.org-position__name:focus {
    background: #eff6ff;
}

.org-position__del {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 14px;
    padding: 0 6px;
    line-height: 1;
    border-radius: 4px;
}

.org-position__del:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ── Пользователи (бейджи) ──────────────────────────────── */
.org-users {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}

.org-user {
    background: rgba(41, 92, 201, 0.12);
    color: #1e40af;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.org-user__x {
    cursor: pointer;
    opacity: 0.5;
    font-size: 13px;
    line-height: 1;
    transition: opacity 0.15s;
}

.org-user__x:hover {
    opacity: 1;
}

.org-user-add {
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    color: #9ca3af;
    font-size: 12px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.org-user-add:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* ── Кнопки "+ добавить" ────────────────────────────────── */
.org-add {
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
    transition: all 0.15s;
    font-family: inherit;
}

.org-add:hover {
    background: #fff;
    border-color: #2563eb;
    color: #2563eb;
}

.org-add-point {
    background: #fff;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    padding: 8px 18px 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
    z-index: 3;
    font-family: inherit;
}

.org-add-point svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.org-add-point:hover {
    border-color: #2563eb;
    border-style: solid;
    color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

/* ── Скроллбар для холста ───────────────────────────────── */
.org-canvas::-webkit-scrollbar {
    height: 8px;
}

.org-canvas::-webkit-scrollbar-track {
    background: transparent;
}

.org-canvas::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.org-canvas::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}
.org-wrap {
    font-family: var(--font-sans, -apple-system, sans-serif);
    padding: 20px 0;
    width: 100%;
}

.org-canvas {
    position: relative;
    background: #f7f7f5;
    border-radius: 16px;
    padding: 32px 0;
    min-height: 520px;
    width: 100%;
    box-sizing: border-box;
    /* никакого overflow */
}
.org-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

/* ── Руководитель точки ─────────────────────────────────── */
.org-point__chief {
    position: relative;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
}

.org-chief-name {
    flex: 1;
    color: #111827;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-chief-clear {
    cursor: pointer;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.org-chief-clear:hover {
    color: #ef4444;
    background: #fef2f2;
}

.org-chief-placeholder {
    flex: 1;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s;
}

.org-chief-placeholder:hover {
    color: #2563eb;
}

/* ── Дропдаун выбора руководителя ───────────────────────── */
.org-chief-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    z-index: 100;
    overflow: hidden;
}

.org-chief-dropdown__search {
    padding: 6px;
    border-bottom: 1px solid #f3f4f6;
}

.org-chief-dropdown__search input {
    width: 100%;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    color: #111827 !important;
    background: #fff !important;
    font-family: inherit;
}

.org-chief-dropdown__search input:focus {
    border-color: #2563eb !important;
    outline: none;
    color: #111827 !important;
}

.org-chief-dropdown__list {
    max-height: 200px;
    overflow-y: auto;
}

.org-chief-dropdown__item {
    padding: 8px 10px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-chief-dropdown__item:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* ═══════════ БОЛИ (solutions) ═══════════ */
.pains-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px 24px;
}
.pains-list { display: flex; flex-direction: column; gap: 10px; }

.pain {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.pain:hover { box-shadow: 0 2px 10px rgba(15,23,42,0.06); }

.pain__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.pain.is-open .shop-cat__chevron { transform: rotate(90deg); }

.pain__name {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    min-width: 0;
}
.pain__name:hover { background: #f9fafb; }
.pain__name:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; cursor: text; }

.pain__count {
    font-size: 12px;
    color: var(--muted);
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pain__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.pain.is-open .pain__body { max-height: 2000px; }

.pain__layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--line);
}

/* ── Календарь ── */
.pain-calendar-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafafa;
}
.pain-calendar {
    display: flex;
    gap: 8px;
    padding: 12px;
    min-width: min-content;
    align-items: stretch;
}
.pain-week {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.pain-week__head {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 6px 10px;
    text-align: center;
    background: #f9fafb;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.pain-week__days {
    display: grid;
    grid-template-columns: repeat(7, 56px);
    gap: 0;
}
.pain-day {
    min-height: 120px;
    padding: 4px;
    border-right: 1px solid #f1f2f4;
    display: flex;
    flex-direction: column;
    transition: background 0.12s;
    position: relative;
}
.pain-day:last-child { border-right: none; }
.pain-day__num {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 4px;
}
.pain-day.drag-over { background: #eef2ff; }
.pain-day__slots { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.pain-week--controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0 4px;
}
.pain-week-btn {
    width: 32px;
    height: 32px;
    border: 1px dashed #cfd3dc;
    background: #fff;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
.pain-week-btn:hover { border-color: var(--primary); color: var(--primary); background: #f5f3ff; }
.pain-week-btn svg { width: 16px; height: 16px; }
.pain-week-btn--danger:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

/* ── Миссии ── */
.pain-missions-wrap {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
}
.pain-missions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
    background: #f9fafb;
    border-bottom: 1px solid var(--line);
}
.pain-missions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    min-height: 100px;
    transition: background 0.12s;
}
.pain-missions.drag-over { background: #eef2ff; }
.pain-missions__empty {
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--primary, #7c5cff);
    border-radius: 6px;
    cursor: grab;
    font-size: 13px;
    user-select: none;
    transition: box-shadow 0.12s, opacity 0.12s;
}
.mission-card:active { cursor: grabbing; }
.mission-card:hover { box-shadow: 0 2px 6px rgba(15,23,42,0.08); }
.mission-card.is-dragging { opacity: 0.4; }
.mission-card--used { opacity: 0.5; }
.mission-card__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
}
.mission-card__name:focus { background: #f9fafb; }
.mission-card__days {
    font-size: 11px;
    color: var(--muted);
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}
.mission-card__days .pain-edit { outline: none; min-width: 8px; display: inline-block; }
.mission-card__x {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.mission-card__x:hover { background: #fef2f2; color: var(--danger); }

.mission-card--scheduled {
    padding: 4px 6px;
    font-size: 11px;
    border-left-width: 3px;
}
.mission-card--scheduled .mission-card__days { display: none; }

@media (max-width: 900px) {
    .pain__layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Finance
   ========================================================================== */
.fin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
}

.fin-stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fin-stat__label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.fin-stat__val   { font-size: 22px; font-weight: 700; color: #111827; line-height: 1.2; }
.fin-stat__sub   { font-size: 12px; color: var(--muted); }

.fin-stat--in  .fin-stat__val { color: #16a34a; }
.fin-stat--out .fin-stat__val { color: #dc2626; }
.fin-stat--bal .fin-stat__val { color: #7c3aed; }

.fin-stat--split .fin-stat__bar {
    display: flex;
    height: 8px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f2f5;
    margin-top: 6px;
}
.fin-stat--split .fin-stat__bar span { transition: width .25s; }
.fin-stat--split .fin-stat__bar span:first-child { background: #7c3aed; }
.fin-stat--split .fin-stat__bar span:last-child  { background: #CFF01C; }

.fin-stat__legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.fin-stat__legend b { color: #111827; font-weight: 700; }
.fin-stat__legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot--tariff { background: #7c3aed; }
.dot--merch  { background: #CFF01C; }

/* Фильтры */
.fin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    align-items: center;
}

.fin-f {
    height: 36px;
    padding: 0 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    width: auto !important;
    min-width: 140px;
    cursor: pointer;
}
.fin-f:focus { border-color: #7c3aed !important; outline: none; }
.fin-date { min-width: 150px; color: #111827 !important; }

.fin-reset {
    height: 36px;
    padding: 0 14px;
    background: transparent;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.fin-reset:hover { color: #dc2626; border-color: #dc2626; border-style: solid; }

/* Таблица */
.fin-table { min-width: 860px !important; }
.fin-table tbody td { color: #111827; }
.fin-table .success { color: #16a34a !important; }
.fin-table .fail    { color: #dc2626 !important; }

.fin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.fin-badge--income  { background: #dcfce7; color: #166534; }
.fin-badge--expense { background: #fee2e2; color: #991b1b; }

.fin-cat {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 500;
}
.fin-cat--tariff { background: #f3efff; color: #7c3aed; }
.fin-cat--merch  { background: #f7ffd6; color: #5a7a00; }
.fin-cat--fee, .fin-cat--payout,
.fin-cat--tariff_refund, .fin-cat--merch_refund { background: #fef3c7; color: #92400e; }

@media (max-width: 960px) {
    .fin-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .fin-stats { grid-template-columns: 1fr; }
    .fin-f { flex: 1 1 140px; }
}

/* Скелетон для финансов */
.fin-skeleton td { background: #fff; }
.sk-text-sm { height: 14px; border-radius: 4px; }
.sk-text-xs { height: 11px; border-radius: 4px; }

/* Базовая анимация .sk — если ещё не определена глобально */
.sk {
    display: inline-block;
    background: linear-gradient(90deg, #f0f1f4 0%, #e4e6ea 50%, #f0f1f4 100%);
    background-size: 200% 100%;
    animation: skShimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes skShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.sk-tag { height: 20px; border-radius: 999px; }
.sk-text { height: 14px; border-radius: 4px; }

/* Дропдаун выбора сотрудника (position relative уже ставится в JS на .org-users) */
.org-user-dropdown {
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    min-width: 200px;
    max-width: 260px;
}

/* Ручка перетаскивания вида сотрудников */
.org-dept__drag {
    cursor: grab;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
    padding: 2px 4px;
    user-select: none;
    flex-shrink: 0;
    letter-spacing: -2px;
}
.org-dept__drag:hover { color: #2563eb; }
.org-dept__drag:active { cursor: grabbing; }

/* Состояния при drag & drop */
.org-dept.is-dragging {
    opacity: 0.4;
}

.org-user {
    max-width: 140px;
    overflow: hidden;
}

.org-user > :not(.org-user__x) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}
.org-user {
    max-width: 140px;
    overflow: hidden;
}

.org-user__name {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
/* ==========================================================================
   MISSIONS — раздел "Миссии"
   Дополнение к style.css. Использует переменные --primary, --line, --muted, --danger.
   ========================================================================== */

/* ── Layout: страница занимает всю высоту, скролл внутри списка ─── */
.page:has(.missions-wrap) {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.page:has(.missions-wrap) > .card {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.page:has(.missions-wrap) > .card > .card-header { flex-shrink: 0; }

.missions-wrap {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 16px;
}

#missionsList { display: flex; flex-direction: column; gap: 10px; }

.missions-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    border: 2px dashed var(--line);
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.missions-empty:hover { border-color: var(--primary); color: var(--primary); background: #f5f3ff; }
.missions-empty__plus {
    width: 40px; height: 40px; margin: 0 auto 10px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; color: #9ca3af;
}
.missions-empty:hover .missions-empty__plus { background: #ede9fe; color: var(--primary); }
.missions-empty__plus svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ── Группа миссий ───────────────────────────────────── */
.mgroup {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.mgroup:hover { box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.mgroup.is-dragging { opacity: .4; border-color: var(--primary); }
/* Игра, к которой только что подвёл помощник: подсветка на пару секунд */
.mgroup.is-justmade { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.mgroup--virtual { background: transparent; border-style: dashed; }

.mgroup__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    transition: background .12s;
}
.mgroup--virtual .mgroup__head { background: transparent; }
.mgroup.is-collapsed .mgroup__head { border-bottom-color: transparent; }

.mgroup__handle {
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: #9ca3af;
    cursor: grab;
    flex-shrink: 0;
}
.mgroup__handle:active { cursor: grabbing; }
.mgroup__handle:hover { color: var(--primary); }
.mgroup__handle svg { width: 16px; height: 16px; }

.mgroup__chevron {
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform .2s;
}
.mgroup__chevron svg { width: 14px; height: 14px; }
.mgroup:not(.is-collapsed) .mgroup__chevron { transform: rotate(90deg); }

.mgroup__name {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    min-width: 0;
}
.mgroup-edit:hover { background: #fff; }
.mgroup-edit:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; cursor: text; }
.mgroup__name--virtual { color: var(--muted); font-weight: 500; font-style: italic; }

/* Обложка и короткое описание игры - их показывает витрина «Выберите игру». */
.mgroup__title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mgroup__title .mgroup__name { flex: 0 0 auto; }
.mgroup__descr {
    font-size: 12px;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 6px;
    outline: none;
    min-height: 18px;
    cursor: text;
}
.mgroup__descr:empty::before { content: attr(data-ph); color: #b6bcc7; }
.mgroup__descr:hover { background: #fff; }
.mgroup__descr:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }
.mgroup__cover {
    width: 52px; height: 30px;
    flex: 0 0 auto;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #9ca3af;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}
.mgroup__cover:hover { border-color: var(--primary); color: var(--primary); }
.mgroup__cover svg { width: 16px; height: 16px; }
.mgroup__cover.has-img { border-style: solid; border-color: var(--line); }
.mgroup__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mgroup__count {
    font-size: 11px;
    color: var(--muted);
    background: #f3f4f6;
    padding: 3px 9px;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
}

.mgroup__map,
.mgroup__add,
.mgroup__dup,
.mgroup__del {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: #9ca3af;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.mgroup__map:hover,
.mgroup__add:hover { background: #f3efff; color: var(--primary); }
.mgroup__dup:hover { background: #f3efff; color: var(--primary); }
.mgroup__del:hover { background: #fef2f2; color: var(--danger); }
.mgroup__add svg, .mgroup__dup svg, .mgroup__del svg { width: 14px; height: 14px; }
.mgroup__map svg { width: 16px; height: 16px; }

.mgroup__body {
    padding: 10px;
}
.mgroup.is-collapsed .mgroup__body { display: none; }

.mgroup__empty {
    grid-column: 1 / -1;
    padding: 18px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

/* ── Сетка миссий внутри группы ──────────────────────── */
.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px;
    min-height: 40px;
    transition: background .12s, outline-color .12s;
}
.missions-grid.drag-over {
    background: rgba(124,58,237,.06);
    border-radius: 6px;
    outline: 2px dashed rgba(124,58,237,.3);
    outline-offset: -2px;
}

/* ── Карточка миссии (компактная, в одну строку) ───── */
.mission {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    user-select: none;
}
.mission:hover { box-shadow: 0 2px 8px rgba(15,23,42,.08); border-color: #d6d3e2; }
.mission.is-dragging { opacity: .4; }

.mission__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f3efff 0%, #e0e7ff 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4b5fd;
    flex-shrink: 0;
    position: relative;
}
.mission__icon--empty svg { width: 55%; height: 55%; opacity: .65; }

.mission__type-badge {
    position: absolute;
    bottom: -3px; right: -3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.mission__type-badge svg { width: 9px; height: 9px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.mission__type-badge--group { color: #f59e0b; }

.mission__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.mission__name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Описание не помещается в компактную высоту — скрываем */
.mission__desc { display: none; }

.mission__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.2;
}

.mission__reward {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--primary);
    font-weight: 700;
}
.mission__reward svg { width: 11px; height: 11px; }

.mission__meta-sep { color: #d1d5db; }

.mission__del {
    width: 22px; height: 22px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #c4c8cf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .12s, color .12s, background .12s;
}
.mission:hover .mission__del { opacity: 1; }
.mission__del:hover { color: var(--danger); background: #fef2f2; }
.mission__del svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ==========================================================================
   FULLSCREEN MODAL — конструктор миссии
   ========================================================================== */
.mc-dialog {
    position: fixed; inset: 0;
    z-index: 9999;
    display: none;
    flex-direction: column;
    background: #f8f7fb;
    overflow: hidden;
}
.mc-dialog.is-open { display: flex; }

.mc-dialog__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.mc-dialog__back {
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .12s;
}
.mc-dialog__back:hover { border-color: var(--primary); color: var(--primary); }
.mc-dialog__back svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.mc-dialog__title {
    flex: 1 1 auto;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    min-width: 0;
}
.mc-dialog__title:hover { background: #f9fafb; }
.mc-dialog__title:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }
.mc-dialog__title:empty::before { content: 'Название миссии'; color: #d1d5db; }

.mc-dialog__save {
    height: 36px; padding: 0 18px;
    border: none; border-radius: 8px;
    background: var(--primary);
    color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background .12s;
    box-shadow: 0 2px 6px rgba(124,58,237,.25);
}
.mc-dialog__save:hover { background: #6d28d9; }
.mc-dialog__save:disabled { background: #c4b5fd; cursor: not-allowed; box-shadow: none; }

.mc-dialog__body {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    overflow: hidden;
}

/* ── Левая колонка: иконка + параметры ───────────────────── */
.mc-side {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mc-icon-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border: 2px dashed var(--line);
    border-radius: 12px;
    background: #fafbfc;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1c5cc;
    cursor: pointer;
    position: relative;
    transition: all .15s;
}
.mc-icon-wrap:hover { border-color: var(--primary); color: var(--primary); background-color: #f5f3ff; }
.mc-icon-wrap.has-icon { border-style: solid; border-color: var(--line); background-color: #fff; }
.mc-icon-wrap__placeholder { text-align: center; padding: 16px; }
.mc-icon-wrap__placeholder svg { width: 32px; height: 32px; margin-bottom: 6px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.mc-icon-wrap__placeholder div { font-size: 12px; color: inherit; }
.mc-icon-wrap.has-icon .mc-icon-wrap__placeholder { display: none; }

.mc-icon-wrap__edit {
    position: absolute;
    bottom: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: #6b7280;
    border: 1px solid var(--line);
    display: none;
    align-items: center; justify-content: center;
    cursor: pointer;
}
.mc-icon-wrap.has-icon .mc-icon-wrap__edit { display: flex; }
.mc-icon-wrap__edit:hover { color: var(--primary); border-color: var(--primary); }
.mc-icon-wrap__edit svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

.mc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mc-field__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.mc-field__input,
.mc-field__textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
    caret-color: #111827;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.mc-field__input:focus,
.mc-field__textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
}
.mc-field__textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* Защита от жёлтого autofill */
.mc-field__input:-webkit-autofill,
.mc-field__textarea:-webkit-autofill,
.mc-aud-search:-webkit-autofill,
.mc-field__input:-webkit-autofill:focus,
.mc-field__textarea:-webkit-autofill:focus,
.mc-aud-search:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827 !important;
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

.mc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mc-toggle {
    display: flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}
.mc-toggle__btn {
    flex: 1 1 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all .12s;
}
.mc-toggle__btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.mc-toggle__btn.is-on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ── Правая колонка: конструктор ─────────────────────────── */
.mc-main {
    overflow-y: auto;
    min-height: 0;
    height: 100%;
    padding: 24px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mc-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin: 0 0 8px;
}

/* ── Логическая полоса (бизнес-процесс) ──────────────────── */
.mc-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-height: 80px;
    transition: background .12s, border-color .12s;
}
.mc-flow.drag-over { background: #f5f3ff; border-color: var(--primary); border-style: dashed; }

.mc-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
    cursor: grab;
    user-select: none;
    background: #fff;
    border: 1px solid var(--line);
    color: #374151;
    position: relative;
    transition: box-shadow .12s, transform .1s;
}
.mc-tag:hover { box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.mc-tag:active { cursor: grabbing; }
.mc-tag.is-dragging { opacity: .4; }

.mc-tag__cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,.05);
    color: inherit;
    white-space: nowrap;
}
.mc-tag__label {
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    min-width: 8px;
    line-height: 1.2;
}
.mc-tag__label:focus { background: rgba(255,255,255,.7); }

.mc-tag__remove {
    width: 18px; height: 18px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: inherit;
    opacity: .55;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: opacity .12s, background .12s;
}
.mc-tag__remove:hover { opacity: 1; background: rgba(0,0,0,.08); }

/* Цвета по категориям */
.mc-tag--audience  { background: #ede9fe; border-color: #ddd6fe; color: #5b21b6; }
.mc-tag--audience .mc-tag__cat { background: rgba(124,58,237,.15); }
.mc-tag--trigger   { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }
.mc-tag--trigger .mc-tag__cat { background: rgba(30,64,175,.12); }
.mc-tag--condition { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.mc-tag--condition .mc-tag__cat { background: rgba(146,64,14,.12); }
.mc-tag--entity    { background: #e0f2fe; border-color: #bae6fd; color: #075985; }
.mc-tag--entity .mc-tag__cat { background: rgba(7,89,133,.12); }
.mc-tag--action    { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.mc-tag--action .mc-tag__cat { background: rgba(6,95,70,.12); }
.mc-tag--group     { background: #fce7f3; border-color: #fbcfe8; color: #9d174d; }
.mc-tag--group .mc-tag__cat { background: rgba(157,23,77,.12); }
.mc-tag--event     { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.mc-tag--event .mc-tag__cat { background: rgba(153,27,27,.12); }

.mc-tag-arrow {
    color: #cbd5e1;
    pointer-events: none;
    user-select: none;
}
.mc-tag-arrow svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

.mc-tag--audience .mc-tag__chips {
    display: inline-flex; flex-wrap: wrap; gap: 3px;
    margin-left: 4px;
}
.mc-tag-chip {
    background: rgba(124,58,237,.18);
    padding: 2px 6px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 3px;
}
.mc-tag-chip__x {
    cursor: pointer; opacity: .6; font-size: 13px; line-height: 1;
}
.mc-tag-chip__x:hover { opacity: 1; }

.mc-flow__hint {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

/* ── Палитра блоков ──────────────────────────────────────── */
.mc-palette {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.mc-palette__tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
    scrollbar-width: thin;
}
.mc-palette__tab {
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
}
.mc-palette__tab:hover { color: #374151; }
.mc-palette__tab.is-active { color: var(--primary); border-bottom-color: var(--primary); background: #fff; }

.mc-palette__body {
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 80px;
}

.mc-palette__pane { display: none; flex-wrap: wrap; gap: 8px; width: 100%; }
.mc-palette__pane.is-active { display: flex; }

.mc-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all .12s;
    user-select: none;
}
.mc-block:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.06); border-color: currentColor; }
.mc-block::before {
    content: '+';
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    opacity: .5;
}

.mc-block--trigger:hover   { color: #1e40af; }
.mc-block--condition:hover { color: #92400e; }
.mc-block--entity:hover    { color: #075985; }
.mc-block--action:hover    { color: #065f46; }
.mc-block--group:hover     { color: #9d174d; }
.mc-block--event:hover     { color: #991b1b; }

/* ── Picker для аудитории / иконок ───────────────────────── */
.mc-picker {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.mc-picker.is-open { display: flex; }

.mc-picker__dialog {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.mc-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.mc-picker__title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.mc-picker__close {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.mc-picker__close:hover { background: #f3f4f6; }
.mc-picker__body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.mc-picker__foot {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafbfc;
}
.mc-picker__btn {
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}
.mc-picker__btn:hover { border-color: #d1d5db; }
.mc-picker__btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.mc-picker__btn--primary:hover { background: #6d28d9; }

/* Аудитория — типы */
.mc-aud-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.mc-aud-type {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all .12s;
    background: #fff;
}
.mc-aud-type:hover { border-color: var(--primary); }
.mc-aud-type.is-active { border-color: var(--primary); background: #f5f3ff; color: var(--primary); }
.mc-aud-type__title { font-size: 13px; font-weight: 600; }
.mc-aud-type__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mc-aud-type.is-active .mc-aud-type__sub { color: var(--primary); opacity: .8; }

.mc-aud-search {
    width: 100%;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
    caret-color: #111827;
    background: #fff;
    margin-bottom: 10px;
    box-sizing: border-box;
    outline: none;
}
.mc-aud-search:focus { border-color: var(--primary); }

.mc-aud-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.mc-aud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.mc-aud-item:last-child { border-bottom: none; }
.mc-aud-item:hover { background: #fafbfc; }
.mc-aud-item input { width: 16px; height: 16px; margin: 0; }

/* Иконки picker */
.mc-icons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.mc-icon-tile {
    aspect-ratio: 1/1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3f4f6;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    transition: border-color .12s, transform .1s;
}
.mc-icon-tile:hover { border-color: var(--primary); transform: scale(1.04); }
.mc-icon-tile.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.2); }
.mc-icon-tile__del {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    border: none;
    background: rgba(0,0,0,.6);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: none;
    padding: 0;
}
.mc-icon-tile:hover .mc-icon-tile__del { display: flex; align-items: center; justify-content: center; }

.mc-icon-upload {
    aspect-ratio: 1/1;
    border: 2px dashed var(--line);
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all .12s;
}
.mc-icon-upload:hover { border-color: var(--primary); color: var(--primary); background: #f5f3ff; }
.mc-icon-upload svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

@media (max-width: 900px) {
    .mc-dialog__body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .mc-side { border-right: none; border-bottom: 1px solid var(--line); }
    .missions-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
/* ── Строка с иконкой и блоком "Дней" ── */
.mc-icon-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 14px;
    align-items: stretch;
}

.mc-icon-row .mc-icon-wrap {
    width: 100px;
    height: 100px;
    aspect-ratio: auto;
}
.mc-icon-row .mc-icon-wrap__placeholder { padding: 8px; }
.mc-icon-row .mc-icon-wrap__placeholder svg { width: 24px; height: 24px; margin-bottom: 4px; }
.mc-icon-row .mc-icon-wrap__placeholder div { font-size: 11px; }
.mc-icon-row .mc-icon-wrap__edit { width: 26px; height: 26px; bottom: 4px; right: 4px; }
.mc-icon-row .mc-icon-wrap__edit svg { width: 12px; height: 12px; }

.mc-field--days {
    justify-content: center;
    gap: 8px;
}
.mc-field--days .mc-field__input {
    height: 56px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary);
    padding: 0 8px;
}
/* ══════════════════════════════════════════════════════════
   START PAGE — квест онбординга
   ══════════════════════════════════════════════════════════ */

.start-header {
    flex-wrap: wrap;
    gap: 16px;
}

.start-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.start-progress {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.start-progress__bar {
    width: 180px;
    height: 6px;
    background: #f1f2f5;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.start-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.start-progress__pct {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    min-width: 36px;
    text-align: right;
}

/* ── Wrap & intro ───────────────────────────────────────── */
.start-wrap {
    flex: 1 1 auto;
    overflow: auto;
    padding: 24px 28px 28px;
}

.start-intro {
    margin-bottom: 24px;
}

.start-intro__title {
    margin: 0 0 6px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.start-intro__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
    max-width: 640px;
}

/* ── Steps list ─────────────────────────────────────────── */
.start-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

/* connector line behind step numbers */
.start-steps::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: #eef0f3;
    z-index: 0;
}

/* ── Step card ──────────────────────────────────────────── */
.start-step {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.start-step:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.start-step.is-active {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.10);
}

.start-step.is-done {
    background: #fafbfc;
}

.start-step.is-done .start-step__title {
    color: var(--muted);
    text-decoration-color: rgba(107, 114, 128, 0.4);
    text-decoration-thickness: 1.5px;
}

.start-step.is-done .start-step__desc,
.start-step.is-done .start-step__btn,
.start-step.is-done .start-integrations {
    display: none;
}

/* ── Step number badge ──────────────────────────────────── */
.start-step__num {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line);
    transition: all 0.2s ease;
}

.start-step__num svg {
    width: 22px;
    height: 22px;
}

.start-step.is-active .start-step__num {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.5), 0 0 0 6px rgba(124, 58, 237, 0.10);
}

.start-step.is-done .start-step__num {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5);
}

/* ── Step body ──────────────────────────────────────────── */
.start-step__body {
    flex: 1 1 auto;
    min-width: 0;
}

.start-step__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.start-step__title {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.start-step__status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.start-step__status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.start-step__status--pending {
    background: #f3f4f6;
    color: #6b7280;
}

.start-step__status--active {
    background: rgba(124, 58, 237, 0.10);
    color: #7c3aed;
}

.start-step__status--done {
    background: rgba(16, 185, 129, 0.10);
    color: #059669;
}

.start-step__desc {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--muted);
    max-width: 720px;
}

/* ── Action button ──────────────────────────────────────── */
.start-step__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.start-step__btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.start-step__btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.start-step__btn:hover svg {
    transform: translateX(2px);
}

.start-step.is-active .start-step__btn {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.start-step.is-active .start-step__btn:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}

/* ── Integration tiles (step 1) ─────────────────────────── */
.start-integrations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-width: 720px;
}

.start-integration {
    all: unset;
    cursor: pointer;
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.start-integration:hover {
    border-color: #7c3aed;
    background: #faf9ff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.10);
    transform: translateY(-1px);
}

.start-integration__logo {
    grid-row: 1 / span 2;
    grid-column: 1;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.start-integration__logo--iiko    { background: #ff5b1a; }
.start-integration__logo--rkeeper { background: #1c3a6e; }
.start-integration__logo--bitrix  { background: #2fc6f6; font-size: 11px; }

.start-integration__name {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.start-integration__hint {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.2;
    margin-top: 2px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
    .start-wrap { padding: 18px 16px 20px; }
    .start-intro__title { font-size: 20px; }
    .start-step { padding: 14px; gap: 12px; }
    .start-step__num { width: 40px; height: 40px; font-size: 16px; }
    .start-steps::before { left: 20px; }
    .start-progress__bar { width: 120px; }
    .start-integrations { grid-template-columns: 1fr; }
}
/* ══════════════════════════════════════════════════════════
   INTEGRATION DIALOG — попап подключения iiko (и др.)
   ══════════════════════════════════════════════════════════ */

.integration-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.integration-dialog.is-open { display: flex; }

.integration-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 21, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.integration-dialog__panel {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 14px;
    width: min(440px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: integrationDialogIn 0.18s ease-out;
}

@keyframes integrationDialogIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Header ─────────────────────────────────────────────── */
.integration-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.integration-dialog__title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.integration-dialog__logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.integration-dialog__logo--iiko    { background: #ff5b1a; }
.integration-dialog__logo--rkeeper { background: #1c3a6e; }

.integration-dialog__heading { min-width: 0; }

.integration-dialog__title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.integration-dialog__subtitle {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
}

.integration-dialog__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: background 0.12s, color 0.12s;
}
.integration-dialog__close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ── Body ───────────────────────────────────────────────── */
.integration-dialog__body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

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

.integration-field__label {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.integration-field__input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #111827;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.integration-field__input::placeholder { color: #9ca3af; }

.integration-field__input:hover { border-color: #d1d5db; }

.integration-field__input:focus,
.integration-field__input:focus-visible {
    outline: none;
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    color: #111827;
}

.integration-field__input.is-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.integration-field__hint {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.3;
}

.integration-dialog__error {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.4;
}

/* ── Footer & buttons ───────────────────────────────────── */
.integration-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
}

.integration-btn {
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    user-select: none;
}

.integration-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.integration-btn:not(:disabled):active { transform: scale(0.98); }

.integration-btn--ghost {
    background: #fff;
    border-color: var(--line);
    color: #374151;
}
.integration-btn--ghost:hover { background: #f3f4f6; border-color: #d1d5db; }

.integration-btn--primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}
.integration-btn--primary:hover { background: #6d28d9; }

/* spinner */
.integration-btn__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: integrationSpin 0.7s linear infinite;
}

.integration-btn.is-loading .integration-btn__spinner { display: inline-block; }
.integration-btn.is-loading .integration-btn__text { opacity: 0.85; }

@keyframes integrationSpin {
    to { transform: rotate(360deg); }
}

/* ── Подключение iiko: широкое окно, две колонки, подсказка ── */
.integration-dialog__panel--wide { width: min(720px, 94vw); }

.integration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

/* Адрес сервера: поле и домен в одной рамке, подсветка на всю рамку. */
.integration-host {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.integration-host:hover { border-color: #d1d5db; }
.integration-host:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.integration-host.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.integration-host__input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: none !important;
    border-radius: 0;
    background: #fff !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #111827;
    box-sizing: border-box;
}
.integration-host__input::placeholder { color: #9ca3af; }
.integration-host__input:focus,
.integration-host__input:focus-visible {
    outline: none;
    box-shadow: none;
    border: none !important;
}

.integration-host__suffix {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    padding: 0 26px 0 10px;
    border: none !important;
    border-left: 1px solid var(--line) !important;
    border-radius: 0;
    background: #f9fafb !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 9px center !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.integration-host__suffix:focus,
.integration-host__suffix:focus-visible { outline: none; box-shadow: none; }

/* «Где взять данные?»: раскрывающаяся подсказка со схемой окна iiko. */
.iiko-help {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfc;
}
.iiko-help__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.iiko-help__head::-webkit-details-marker { display: none; }
.iiko-help__title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}
.iiko-help__chev {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: #6b7280;
    transition: transform 0.15s;
}
.iiko-help[open] .iiko-help__chev { transform: rotate(180deg); }
.iiko-help__body { padding: 0 14px 14px; }
.iiko-help__text {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #374151;
}
.iiko-help__pics { display: flex; gap: 12px; }
.iiko-help__pic { display: block; flex: 1 1 0; min-width: 0; width: 100%; height: auto; }

/* ── Подключение r_keeper: шаги, текст для дилера, список кодов ── */
.rk-steps { margin: 0 0 12px; padding-left: 20px; font-size: 12.5px; line-height: 1.5; color: #374151; }
.rk-steps li { margin: 0 0 6px; }
.rk-dealer { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rk-dealer__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: #111827; }
.rk-dealer__copy { width: auto; flex: none; margin: 0; padding: 5px 12px; border: 1px solid #ddd6fe; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.rk-dealer__copy:hover { background: #ede9fe; }
.rk-dealer__text { padding: 10px 12px; font-size: 12.5px; line-height: 1.55; color: #374151; white-space: pre-line; user-select: text; }
.rk-codes-field { grid-column: 1 / -1; }
.rk-codes { display: flex; flex-direction: column; gap: 8px; }
.rk-code { display: flex; align-items: center; gap: 8px; }
.rk-code .integration-field__input { flex: 1 1 auto; width: auto; min-width: 0; }
.rk-code__del { width: 32px; height: 32px; flex: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #6b7280; font-size: 12px; cursor: pointer; }
.rk-code__del:hover { border-color: #fecaca; color: var(--danger); }
.rk-add { align-self: flex-start; width: auto; margin: 2px 0 0; padding: 4px 0; border: none; background: none; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.rk-state { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.rk-state--ok      { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.rk-state--pending { background: var(--primary-soft); border: 1px solid #ddd6fe; color: #4c1d95; }
.rk-state--partial,
.rk-state--warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
#rkInfo { margin: 12px 0 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .integration-grid { grid-template-columns: 1fr; }
    /* В строку схемы ужимаются до нечитаемого, поэтому ставим их друг под друга.
       Базис в колонке задаёт ВЫСОТУ, поэтому у картинок он обязан быть auto. */
    .iiko-help__pics { flex-direction: column; }
    .iiko-help__pic  { flex: 0 0 auto; width: 100%; }
}

@media (max-width: 480px) {
    .integration-dialog__panel { width: calc(100vw - 24px); }
    .integration-dialog__panel--wide { width: calc(100vw - 24px); }
    .integration-dialog__header,
    .integration-dialog__body,
    .integration-dialog__footer { padding-left: 16px; padding-right: 16px; }
}
/* ══════════════════════════════════════════════════════════
   INVITE DIALOG — полноэкранный попап «пригласить пользователей»
   ══════════════════════════════════════════════════════════ */
.invite-dialog {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    background: #f8f7fb;
}
.invite-dialog.is-open { display: flex; }

.invite-dialog__panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ── Шапка ──────────────────────────────────────────────── */
.invite-dialog__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.invite-dialog__icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3efff;
    color: var(--primary);
}
.invite-dialog__icon svg { width: 20px; height: 20px; }

.invite-dialog__heading { flex: 1; min-width: 0; }

.invite-dialog__title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.invite-dialog__subtitle {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
}

.invite-dialog__close {
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    background: #fff;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 4px;
    transition: background 0.12s, color 0.12s;
}
.invite-dialog__close:hover { background: #f3f4f6; color: #111827; }

/* ── Тело: две колонки ──────────────────────────────────── */
.invite-dialog__body {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

/* ── Общая шапка колонки ────────────────────────────────── */
.invite-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.invite-col__title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.invite-col__count {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0;
}

.invite-col__count--accent {
    color: var(--primary);
    background: #f3efff;
}

/* ── Кнопки в колонке ───────────────────────────────────── */
.invite-iconbtn {
    width: 32px; height: 32px;
    border: 1px solid var(--line);
    background: #fff;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
.invite-iconbtn:hover { background: #f3f4f6; color: var(--primary); border-color: var(--primary); }
.invite-iconbtn svg { width: 14px; height: 14px; }
.invite-iconbtn.is-spinning svg { animation: inviteSpin 0.8s linear infinite; }

@keyframes inviteSpin { to { transform: rotate(360deg); } }

.invite-add {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    transition: background 0.12s;
}
.invite-add:hover { background: #6d28d9; }
.invite-add svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════
   ЛЕВАЯ КОЛОНКА — источник из iiko
   ══════════════════════════════════════════════════════════ */
.invite-source {
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.invite-search {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.invite-search__input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfc !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #111827;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.invite-search__input:focus {
    border-color: var(--primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.invite-source__tree {
    flex: 1;
    overflow: auto;
    padding: 8px 8px 16px;
}

.invite-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.invite-empty--cta {
    border: 2px dashed var(--line);
    border-radius: 12px;
    margin: 0;
    background: #fff;
}

/* ── Узел дерева ────────────────────────────────────────── */
.invite-tree-row {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    width: 100%;
    transition: background 0.1s;
}
.invite-tree-row:hover { background: #f9fafb; }

.invite-tree-row__chev {
    width: 12px; height: 12px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.invite-tree-row__chev.is-open { transform: rotate(90deg); }

.invite-tree-row__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-tree-row__count {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
}

.invite-tree-row--dept .invite-tree-row__label {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
}

.invite-tree-row--pos .invite-tree-row__label {
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
}

.invite-dept__positions {
    padding-left: 18px;
    margin-bottom: 4px;
}
.invite-pos__emps {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 2px 0 4px;
}

/* ── Карточка сотрудника (источник) ─────────────────────── */
.invite-emp {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
    user-select: none;
}
.invite-emp:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.10);
}
.invite-emp:active { cursor: grabbing; }
.invite-emp.is-dragging { opacity: 0.4; }
.invite-emp.is-selected { border-color: var(--primary); background: #f5f3ff; }

/* Чекбоксы выбора (сотрудник + отдел) */
.invite-chk {
    width: 16px; height: 16px; flex-shrink: 0; margin: 0;
    accent-color: var(--primary); cursor: pointer;
}
.invite-chk:disabled { cursor: default; opacity: .4; }
.invite-emp__chk { margin-right: 2px; }

/* Шапка отдела/должности: чекбокс + кнопка-раскрытие в одну строку */
.invite-tree-head { display: flex; align-items: center; gap: 4px; }
.invite-tree-head .invite-chk { margin-left: 6px; }
.invite-tree-head .invite-tree-row { flex: 1; min-width: 0; }

/* Панель выбранных */
.invite-selbar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin: 2px 0 8px; padding: 7px 10px;
    background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
    font-size: 12px; color: #6d28d9;
}
.invite-selbar__txt { font-weight: 700; }
.invite-selbar__hint { color: #8b7fc7; }
.invite-selbar__clear {
    margin-left: auto; border: none; background: #ede9fe; color: #6d28d9;
    font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.invite-selbar__clear:hover { background: #ddd6fe; }

/* Призрак перетаскивания группы */
.invite-drag-ghost {
    position: fixed; top: -1000px; left: -1000px;
    background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
    padding: 6px 12px; border-radius: 8px; box-shadow: 0 6px 20px rgba(124,58,237,.4);
    white-space: nowrap;
}

.invite-emp.is-assigned {
    cursor: not-allowed;
    opacity: 0.55;
    background: #fafbfc;
}
.invite-emp.is-assigned:hover {
    border-color: var(--line);
    box-shadow: none;
}
.invite-emp.is-assigned .invite-emp__name {
    text-decoration: line-through;
    text-decoration-color: rgba(107, 114, 128, 0.4);
    color: var(--muted);
}

.invite-emp__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0;
}
.invite-emp.is-assigned .invite-emp__avatar {
    background: #e5e7eb !important;
    color: #6b7280;
}

.invite-emp__name {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-emp__badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}
.invite-emp__badge--code {
    color: #9ca3af;
    background: #f3f4f6;
    font-weight: 600;
}
.invite-emp__badge--done {
    color: #059669;
    background: rgba(16, 185, 129, 0.10);
}

/* ══════════════════════════════════════════════════════════
   ПРАВАЯ КОЛОНКА — мои точки
   ══════════════════════════════════════════════════════════ */
.invite-target {
    background: #f8f7fb;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.invite-target__list {
    flex: 1;
    overflow: auto;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Карточка точки ─────────────────────────────────────── */
.invite-point {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0; /* фикс: карточка не сжимается в flex-списке, список скроллится */
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.invite-point.is-dragover {
    border-color: var(--primary);
    border-style: dashed;
    background: #faf9ff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.invite-point__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.invite-point__pin {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.invite-point__name {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #111827;
    outline: none;
    transition: background 0.12s, border-color 0.12s;
}
.invite-point__name:hover { background: #f9fafb !important; }
.invite-point__name:focus {
    background: #fff !important;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.invite-point__count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 999px;
}

.invite-point__delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.invite-point__delete:hover { background: #fee2e2; color: #dc2626; }
.invite-point__delete svg { width: 14px; height: 14px; }

.invite-point__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 60px;
}

.invite-point__placeholder {
    padding: 22px 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 12.5px;
    font-style: italic;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

/* подсветка плейсхолдера при ховере drag */
.invite-point.is-dragover .invite-point__placeholder {
    border-color: var(--primary);
    color: var(--primary);
    background: #faf9ff;
    font-style: normal;
    font-weight: 600;
}

/* ── Сотрудник внутри точки ─────────────────────────────── */
.invite-point__emp {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: grab;
    transition: border-color 0.12s, background 0.12s;
}
.invite-point__emp:hover { border-color: #d1d5db; background: #fff; }
.invite-point__emp:active { cursor: grabbing; }
.invite-point__emp.is-dragging { opacity: 0.4; }

.invite-point__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.invite-point__empname {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    flex-shrink: 0;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-point__pos {
    font-size: 11.5px;
    color: var(--muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-point__remove {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.invite-point__remove:hover { background: #fee2e2; color: #dc2626; }

/* ── Глобальная ошибка снизу ────────────────────────────── */
.invite-dialog__error {
    padding: 10px 24px;
    background: rgba(239, 68, 68, 0.08);
    border-top: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Адаптив ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .invite-dialog__body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .invite-source { border-right: none; border-bottom: 1px solid var(--line); }
    .invite-dialog__head { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
    .invite-dialog__heading { flex-basis: 100%; order: -1; }
}
.invite-point__drag {
    flex: 0 0 auto;
    width: 28px;
    height: 32px;
    border: none;
    background: transparent;
    color: #c4c8d0;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 6px;
    transition: color 0.12s, background 0.12s;
}
.invite-point__drag:hover  { color: #6b7280; background: #f3f4f6; }
.invite-point__drag:active { cursor: grabbing; color: var(--primary); }
.invite-point__drag svg    { width: 18px; height: 18px; display: block; }
.start-step.is-done[data-step="1"] .start-step__btn {
    display: inline-flex;
}
.start-step.is-done[data-step="2"] .start-step__btn {
    display: inline-flex;
}
.start-step.is-done[data-step="3"] .start-step__btn {
    display: inline-flex;
}
.start-step.is-done[data-step="4"] .start-step__btn {
    display: inline-flex;
}
.start-step.is-done[data-step="5"] .start-step__btn {
    display: inline-flex;
}
/* ══════════════════════════════════════════════════════════
   INVITE DIALOG — стили инлайн-формы «Добавить сотрудника»
   Допишите в конец invite_popup.css
   ══════════════════════════════════════════════════════════ */

/* ── Кнопка «+ Добавить нового сотрудника» в точке ───────── */
.invite-point__add-emp {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 4px 4px;
    padding: 9px 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.12s;
    box-sizing: border-box;
}
.invite-point__add-emp:hover {
    color: var(--primary);
    border-color: rgba(124, 58, 237, 0.45);
    background: #faf9ff;
}
.invite-point__add-emp svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Инлайн-форма добавления ─────────────────────────────── */
.invite-addform {
    margin: 8px 4px 4px;
    padding: 14px;
    background: linear-gradient(180deg, #faf9ff 0%, #f5f3ff 100%);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(124, 58, 237, 0.04);
}

.invite-addform__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.invite-addform__input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    color: #111827;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.invite-addform__input::placeholder { color: #9ca3af; }
.invite-addform__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.invite-addform__actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 4px;
}

.invite-addform__btn {
    all: unset;
    cursor: pointer;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.12s;
    box-sizing: border-box;
    text-align: center;
}
.invite-addform__btn--ghost {
    color: #6b7280;
}
.invite-addform__btn--ghost:hover {
    color: #111827;
    background: rgba(15, 23, 42, 0.05);
}
.invite-addform__btn--primary {
    background: var(--primary);
    color: #fff;
}
.invite-addform__btn--primary:hover:not(:disabled) {
    background: #6d28d9;
}
.invite-addform__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* ── Setup section (название + поддомен) ───────────────── */
.start-setup {
    margin-bottom: 24px;
    padding: 18px 20px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.18s, background 0.18s;
}

.start-setup.is-confirmed {
    background: #f6fdf9;
    border-color: rgba(16, 185, 129, 0.3);
}

.start-setup__head {
    margin-bottom: 16px;
}

.start-setup__title {
    margin: 0 0 4px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.start-setup__lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.start-setup__lock svg { width: 12px; height: 12px; }

.start-setup__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.start-setup__grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 16px;
    margin-bottom: 14px;
}

.start-setup__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.start-setup__label {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.start-setup__input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #111827 !important;
    -webkit-text-fill-color: #111827;
    caret-color: #111827;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.start-setup__input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.start-setup__input:disabled {
    background: #f9fafb;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280;
    cursor: not-allowed;
}

.start-setup__subdomain {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.start-setup__subdomain:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.start-setup__subdomain.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.start-setup__subdomain.is-success {
    border-color: #10b981;
}

.start-setup__subdomain.is-locked {
    background: #f9fafb;
}

.start-setup__input--subdomain {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: none !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
}

.start-setup__suffix {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: #f9fafb;
    border-left: 1px solid var(--line);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.start-setup__status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    background: #f9fafb;
    border-left: 1px solid var(--line);
    color: var(--muted);
}
.start-setup__status:empty { display: none; }
.start-setup__status svg { width: 16px; height: 16px; }
.start-setup__status.is-loading { color: var(--primary); }
.start-setup__status.is-success { color: #10b981; background: rgba(16,185,129,0.08); }
.start-setup__status.is-error   { color: #ef4444; background: rgba(239,68,68,0.08); }

@keyframes setupSpin { to { transform: rotate(360deg); } }
.start-setup__status.is-loading svg { animation: setupSpin 0.8s linear infinite; }

.start-setup__hint {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    min-height: 16px;
}
.start-setup__hint.is-error   { color: #ef4444; }
.start-setup__hint.is-success { color: #059669; }

.start-setup__actions {
    display: flex;
    justify-content: flex-end;
}

.start-setup__confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}
.start-setup__confirm:hover:not(:disabled) { background: #6d28d9; border-color: #6d28d9; }
.start-setup__confirm:disabled {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}
.start-setup__confirm svg { width: 14px; height: 14px; }

@media (max-width: 720px) {
    .start-setup__grid { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════════════════════════════════
   START SETUP — обновлённая разметка с логотипом
   (заменяет старое правило .start-setup__grid)
   ═══════════════════════════════════════════════════════════════════════ */

.start-setup__body {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 18px;
    align-items: start;
}

/* На случай если в старом CSS остался .start-setup__grid — не мешает */
.start-setup__grid { display: contents; }

.start-setup__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Лок-бейдж теперь стоит в лейбле, а не на всей секции */
.start-setup__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.start-setup__lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    width: 14px;
    height: 14px;
}
.start-setup__lock svg { width: 12px; height: 12px; }

@media (max-width: 720px) {
    .start-setup__body { grid-template-columns: 1fr; }
    .setup-logo { margin: 0 auto; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ROW: Адрес кабинета + Внутренняя валюта рядом
   ═══════════════════════════════════════════════════════════════════════ */
.start-setup__row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-width: 0;
}
.start-setup__field--grow     { flex: 1 1 auto;  min-width: 0; }
.start-setup__field--currency { flex: 0 0 220px; min-width: 0; }

@media (max-width: 720px) {
    .start-setup__row { flex-direction: column; }
    .start-setup__field--currency { flex: 1 1 auto; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════
   CURRENCY SELECT — кастомный выпадающий список с иконками
   ═══════════════════════════════════════════════════════════════════════ */
.currency-select {
    position: relative;
    width: 100%;
}

.currency-select__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 10px 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
    text-align: left;
    box-sizing: border-box;
}
.currency-select__btn:hover { border-color: #d1d5db; }

.currency-select.is-open .currency-select__btn {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.currency-select__icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f9fafb;
    overflow: hidden;
}
.currency-select__icon img,
.currency-select__icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.currency-select__icon--fallback { background: transparent; }

.currency-select__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.currency-select__chev {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.15s;
}
.currency-select.is-open .currency-select__chev { transform: rotate(180deg); }

.currency-select__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.12s, transform 0.12s;
}
.currency-select.is-open .currency-select__menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.currency-select__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #111827;
    transition: background 0.1s;
}
.currency-select__option:hover { background: #f5f3ff; }

.currency-select__option .currency-select__check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--primary);
    opacity: 0;
    margin-left: auto;
}
.currency-select__option.is-selected {
    background: #f5f3ff;
    color: var(--primary);
}
.currency-select__option.is-selected .currency-select__check { opacity: 1; }
.currency-select__option.is-selected .currency-select__name { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   LOGO BUTTON — квадратная кнопка-загрузчик
   ═══════════════════════════════════════════════════════════════════════ */

.setup-logo {
    all: unset;
    position: relative;
    box-sizing: border-box;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    background: #fafbfc;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.setup-logo:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.setup-logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.setup-logo.has-logo {
    border-style: solid;
    border-color: var(--line);
    background: #fff;
}

.setup-logo__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.setup-logo__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #9ca3af;
    pointer-events: none;
}
.setup-logo__placeholder svg { width: 22px; height: 22px; }
.setup-logo__placeholder span {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
}

.setup-logo__edit {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #6b7280;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.setup-logo:hover .setup-logo__edit { opacity: 1; }
.setup-logo__edit svg { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════════════════
   LOGO CROP DIALOG — попап-кроп квадратного логотипа
   ═══════════════════════════════════════════════════════════════════════ */

.logo-crop-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}
.logo-crop-dialog.is-open { display: block; }

.logo-crop-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.logo-crop-dialog__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
}

.logo-crop-dialog__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.logo-crop-dialog__heading { flex: 1 1 auto; min-width: 0; }
.logo-crop-dialog__title {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}
.logo-crop-dialog__subtitle {
    margin-top: 2px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    color: var(--muted);
}
.logo-crop-dialog__close {
    all: unset;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.logo-crop-dialog__close:hover { background: #f3f4f6; color: #111827; }

.logo-crop-dialog__body {
    padding: 18px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

/* пустое состояние до выбора файла */
.logo-crop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 20px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: #fafbfc;
    text-align: center;
}
.logo-crop-empty svg { width: 36px; height: 36px; color: #9ca3af; }
.logo-crop-empty__title {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-top: 6px;
}
.logo-crop-empty__hint {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
}
.logo-crop-empty__btn {
    all: unset;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.logo-crop-empty__btn:hover { background: #6d28d9; }

/* стейдж для кропа */
.logo-crop-stage {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.logo-crop-stage__inner {
    position: absolute;
    inset: 0;
    cursor: grab;
}
.logo-crop-stage__inner.is-dragging { cursor: grabbing; }
.logo-crop-stage__inner img {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
    pointer-events: none;
    max-width: none;
    display: block;
}
.logo-crop-stage__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px;
}

/* контролы зума и смены файла */
.logo-crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-crop-zoom {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.logo-crop-zoom__icon {
    display: inline-flex;
    color: var(--muted);
    flex: 0 0 auto;
}
.logo-crop-zoom__icon svg { width: 14px; height: 14px; }
.logo-crop-zoom input[type="range"] {
    flex: 1 1 auto;
    accent-color: var(--primary);
    min-width: 0;
}

.logo-crop-changefile {
    all: unset;
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.logo-crop-changefile:hover { background: #f9fafb; border-color: #d1d5db; }

.logo-crop-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
}

.logo-crop-dialog__footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
/* ═══════════════════════════════════════════════════════════════════════
   USERS PAGE — chips bar + table cells
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Чипы с точками ─────────────────────────────────────── */
.cu-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
}

.cu-chip {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
    box-sizing: border-box;
}
.cu-chip:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.cu-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.cu-chip.is-active .cu-chip__count {
    background: rgba(255,255,255,0.22);
    color: #fff;
}
.cu-chip.is-being-dragged {
    opacity: 0.4;
    transform: scale(0.96);
}

.cu-chip__grip {
    display: inline-flex;
    width: 10px;
    color: #9ca3af;
    cursor: grab;
    margin-right: -2px;
}
.cu-chip__grip svg { width: 10px; height: 14px; }
.cu-chip:hover .cu-chip__grip { color: #6b7280; }
.cu-chip.is-being-dragged .cu-chip__grip { cursor: grabbing; }

.cu-chip__label { padding: 0 2px; }
.cu-chip__input {
    all: unset;
    min-width: 30px;
    padding: 0 2px;
    font: inherit;
    color: inherit;
    cursor: text;
}
.cu-chip__input:focus {
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
}
.cu-chip.is-active .cu-chip__input { color: #fff; }

.cu-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.cu-chip__del {
    all: unset;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-chip__del svg { width: 10px; height: 10px; }
.cu-chip:hover .cu-chip__del { opacity: 1; }
.cu-chip__del:hover { background: rgba(239,68,68,0.12); color: #dc2626; }
.cu-chip.is-active .cu-chip__del { color: rgba(255,255,255,0.7); }
.cu-chip.is-active .cu-chip__del:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Виртуальные («Все», «Без точки») — без грипа и крестика */
.cu-chip--virtual { padding-left: 12px; }

/* Кнопка «+ Точка» — пунктир */
.cu-chip--add {
    border-style: dashed;
    color: var(--primary);
}
.cu-chip--add svg { width: 12px; height: 12px; }
.cu-chip--add:hover {
    background: #f5f3ff;
    border-color: var(--primary);
}

/* DnD-цели */
.cu-chip--dragover {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.cu-chip--drop-before {
    box-shadow: -3px 0 0 0 var(--primary);
}
.cu-chip--drop-after {
    box-shadow: 3px 0 0 0 var(--primary);
}

/* ── Таблица ────────────────────────────────────────────── */
.cu-table .cu-row {
    transition: background 0.1s, opacity 0.1s, transform 0.08s;
}
.cu-table .cu-row[draggable="true"] { cursor: grab; }
.cu-table .cu-row.is-being-dragged {
    opacity: 0.4;
    transform: scale(0.99);
    cursor: grabbing;
}

.cu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.cu-user__av {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
}
.cu-user__info { min-width: 0; }
.cu-user__name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cu-user__email {
    margin-top: 1px;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cu-post {
    display: inline-block;
    font-size: 12px;
    color: #374151;
}

.cu-point-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(124,58,237,0.12);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cu-point-tag--none {
    background: #f3f4f6;
    color: #9ca3af;
}

.cu-iiko-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: default;
}
.cu-iiko-tag svg { flex: none; }

.cu-dim {
    color: #9ca3af;
    font-size: 12px;
}

/* Toggle */
.cu-toggle {
    display: inline-block;
    position: relative;
    width: 34px;
    height: 20px;
    vertical-align: middle;
    cursor: pointer;
}
.cu-toggle input { opacity: 0; width: 0; height: 0; }
.cu-toggle__slider {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    border-radius: 999px;
    transition: background 0.15s;
}
.cu-toggle__slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cu-toggle input:checked + .cu-toggle__slider { background: #10b981; }
.cu-toggle input:checked + .cu-toggle__slider::before { transform: translateX(14px); }

/* Кнопка удаления строки */
.cu-row__del {
    all: unset;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-row__del svg { width: 14px; height: 14px; }
.cu-table tr:hover .cu-row__del { opacity: 1; }
.cu-row__del:hover { background: rgba(239,68,68,0.1); color: #dc2626; }

/* Действия в строке пользователя (подарок + удаление) */
.cu-row__acts { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.cu-row__gift {
    all: unset;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-row__gift svg { width: 15px; height: 15px; }
.cu-table tr:hover .cu-row__gift { opacity: 1; }
.cu-row__gift:hover { background: rgba(124,58,237,0.1); color: #7c3aed; }

/* Пустое состояние */
.cu-empty {
    padding: 60px 24px;
    text-align: center;
}
.cu-empty__title {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.cu-empty__hint {
    margin-top: 6px;
    font-size: 13px;
    color: #9ca3af;
}
/* ═══════════════════════════════════════════════════════════════════════
   USERS PAGE — секции-полосы внутри таблицы + inline-форма добавления
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Секция-полоса (заголовок точки) ────────────────────── */
.cu-table .cu-section > td {
    padding: 0;
    background: #f3f4f6;
    border-top: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}
.cu-table .cu-section:first-child > td { border-top: none; }

.cu-table .cu-section[draggable="true"] > td { cursor: grab; }
.cu-table .cu-section.is-being-dragged > td { opacity: 0.4; cursor: grabbing; }

.cu-table .cu-section--drop-before > td { box-shadow: inset 0 3px 0 0 var(--primary); }
.cu-table .cu-section--drop-after  > td { box-shadow: inset 0 -3px 0 0 var(--primary); }

.cu-table .cu-section--user-dragover > td {
    background: #ecfdf5;
    border-top-color: #10b981;
    border-bottom-color: #10b981;
}

.cu-section__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}
.cu-section__grip {
    display: inline-flex;
    width: 14px;
    color: #9ca3af;
    cursor: grab;
}
.cu-section__grip svg { width: 14px; height: 18px; }
.cu-section.is-being-dragged .cu-section__grip { cursor: grabbing; }

.cu-section__name {
    all: unset;
    flex: 0 0 auto;
    min-width: 100px;
    padding: 4px 6px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    cursor: text;
    border-radius: 4px;
}
.cu-section__name:focus { background: #fff; box-shadow: 0 0 0 2px var(--primary); }
.cu-section__name--static { cursor: default; color: #6b7280; }

.cu-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
}

.cu-section__del {
    all: unset;
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-section__del svg { width: 14px; height: 14px; }
.cu-section:hover .cu-section__del { opacity: 1; }
.cu-section__del:hover { background: rgba(239,68,68,0.1); color: #dc2626; }

/* Виртуальная «Без точки» — без грипа, без удаления */
.cu-section--virtual > td {
    background: #fafbfc;
    border-top-style: dashed;
    border-bottom-style: dashed;
}

/* ── Строка пользователя ────────────────────────────────── */
.cu-table .cu-row { transition: background 0.1s, opacity 0.1s, transform 0.08s; }
.cu-table .cu-row[draggable="true"] { cursor: grab; }
.cu-table .cu-row.is-being-dragged  { opacity: 0.4; cursor: grabbing; }

.cu-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cu-user__av {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 700;
}
.cu-user__info { min-width: 0; }
.cu-user__name { font-size: 13px; font-weight: 600; color: #111827; }
.cu-user__email { margin-top: 1px; font-size: 12px; color: #9ca3af; }
/* Имя сотрудника в «Пользователях» — показываем ЦЕЛИКОМ: перенос по словам, без обрезки многоточием.
   Перебивает nowrap/ellipsis из .cu-user__name выше (выше специфичность + идёт последним). */
.cu-uname-row .cu-user__name {
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.cu-post { font-size: 12px; color: #374151; }
.cu-iiko-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: default;
}
.cu-iiko-tag svg { flex: none; }
.cu-dim { color: #9ca3af; font-size: 12px; }

/* Toggle */
.cu-toggle { display: inline-block; position: relative; width: 34px; height: 20px; cursor: pointer; }
.cu-toggle input { opacity: 0; width: 0; height: 0; }
.cu-toggle__slider {
    position: absolute; inset: 0;
    background: #e5e7eb; border-radius: 999px;
    transition: background 0.15s;
}
.cu-toggle__slider::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: #fff; border-radius: 50%;
    transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cu-toggle input:checked + .cu-toggle__slider { background: #10b981; }
.cu-toggle input:checked + .cu-toggle__slider::before { transform: translateX(14px); }

/* Удаление строки */
.cu-row__del {
    all: unset;
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #9ca3af; cursor: pointer; opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-row__del svg { width: 14px; height: 14px; }
.cu-table tr:hover .cu-row__del { opacity: 1; }
.cu-row__del:hover { background: rgba(239,68,68,0.1); color: #dc2626; }

/* ── Пустые места ───────────────────────────────────────── */
.cu-empty-row > td {
    padding: 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
    background: #fafbfc;
}

.cu-empty-all > td { padding: 60px 24px; text-align: center; background: #fafbfc; }
.cu-empty-all__title { font-size: 15px; font-weight: 600; color: #111827; }
.cu-empty-all__hint  { margin-top: 6px; font-size: 13px; color: #9ca3af; }

/* ── «+ Добавить пользователя» внутри полосы ─────────────── */
.cu-addbtn > td { padding: 0; }
.cu-addbtn__btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: #fff;
    border-top: 1px dashed #d1d5db;
    color: var(--primary);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
    box-sizing: border-box;
}
.cu-addbtn__btn svg { width: 14px; height: 14px; }
.cu-addbtn__btn:hover { background: #f5f3ff; }

/* ── Inline-форма ───────────────────────────────────────── */
.cu-addform > td { padding: 0; background: #f9fafb; }
.cu-addform__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    flex-wrap: wrap;
}
.cu-addform__input {
    flex: 1 1 160px;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #111827;
    box-sizing: border-box;
}
.cu-addform__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.cu-addform__actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.cu-addform__btn {
    all: unset;
    padding: 8px 14px;
    border-radius: 6px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.cu-addform__btn--ghost   { color: #6b7280; }
.cu-addform__btn--ghost:hover   { background: #e5e7eb; color: #111827; }
.cu-addform__btn--primary { background: var(--primary); color: #fff; }
.cu-addform__btn--primary:hover { filter: brightness(1.05); }

/* ── «+ Добавить точку» — финальная строка ──────────────── */
.cu-addpoint > td { padding: 0; }
.cu-addpoint__btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 14px;
    border-top: 1px solid var(--line);
    color: var(--primary);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s;
    box-sizing: border-box;
}
.cu-addpoint__btn svg { width: 14px; height: 14px; }
.cu-addpoint__btn:hover { background: #f5f3ff; }
/* ============================================================
   ИДЕИ — Админка клиента
   Добавить в style.css
   ============================================================ */

.ideas-admin {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0;   /* отступ дает main, как во всех разделах */
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.ideas-admin__section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 20px 20px;
}

/* Сворачиваемая секция */
.ideas-admin__section--collapsible {
    padding-bottom: 18px;
    transition: padding-bottom 0.2s ease;
}
.ideas-admin__section--collapsible .ideas-admin__section-head {
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
    -webkit-user-select: none;
    transition: margin-bottom 0.2s ease;
}
.ideas-admin__section--collapsible.is-open {
    padding-bottom: 20px;
}
.ideas-admin__section--collapsible.is-open .ideas-admin__section-head {
    margin-bottom: 14px;
}

.ideas-admin__section-chevron {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    transition: transform 0.2s ease;
    margin-right: 4px;
}
.ideas-admin__section--collapsible.is-open .ideas-admin__section-chevron {
    transform: rotate(90deg);
}

.ideas-admin__section-counter {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 6px;
}

.ideas-admin__section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.ideas-admin__section--collapsible.is-open .ideas-admin__section-body {
    max-height: 2000px; /* достаточно для длинного списка */
}

.ideas-admin__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ideas-admin__section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
}

/* ─── Категории ─── */
.ideas-admin__cats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ideas-admin__cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: box-shadow 0.15s;
}
.ideas-admin__cat:hover {
    box-shadow: 0 1px 6px rgba(15,23,42,0.06);
}
.ideas-admin__cat.is-dragging {
    opacity: 0.45;
    border-color: var(--primary);
}

.ideas-admin__cat-handle {
    cursor: grab;
    color: #94a3b8;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ideas-admin__cat-handle:active { cursor: grabbing; }

.ideas-admin__cat-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: text;
    outline: none;
    word-break: break-word;
}
.ideas-admin__cat-name:hover { background: #fff; }
.ideas-admin__cat-name:focus { background: #fff; box-shadow: 0 0 0 2px var(--primary-soft); }
.ideas-admin__cat-name.is-saving { opacity: 0.55; }

.ideas-admin__cat-count {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px 10px;
    min-width: 30px;
    text-align: center;
}

.ideas-admin__cat-del {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ideas-admin__cat-del:hover {
    color: #ef4444;
    background: #fee2e2;
}

.ideas-admin__empty-small {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ─── Фильтры ─── */
.ideas-admin__filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ideas-admin__author-point { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.ideas-admin__filter {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.ideas-admin__filter:focus { border-color: var(--primary); }

.ideas-admin__search {
    flex: 1;
    min-width: 200px;
    cursor: text;
}

/* ─── Таблица ─── */
.ideas-admin__table-wrap {
    overflow-x: auto;
}

.ideas-admin__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ideas-admin__table thead th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ideas-admin__row {
    cursor: pointer;
    transition: background 0.12s;
}
.ideas-admin__row:hover { background: #f9fafb; }
.ideas-admin__row td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.ideas-admin__col-date {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}
.ideas-admin__col-author {
    color: #0f172a;
    font-weight: 500;
}
.ideas-admin__col-title {
    color: #0f172a;
    font-weight: 600;
}
.ideas-admin__col-cat {
    color: #64748b;
    font-size: 12px;
}
.ideas-admin__col-likes {
    text-align: center;
    font-weight: 600;
    color: #0f172a;
}
.ideas-admin__col-dislikes {
    text-align: center;
    font-weight: 600;
    color: #ef4444;
}

/* Селекты статуса и модерации в таблице — одинаковая стилизация */
.ideas-admin__status-select,
.ideas-admin__moderation-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--st-color, #94a3b8);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: var(--st-color, #0f172a);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.ideas-admin__status-select:focus,
.ideas-admin__moderation-select:focus { border-color: var(--primary); }

/* ─── Модерация в детальной карточке: две большие кнопки ─── */
.ideas-admin__detail-modbar {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-bottom: 16px;
}
.ideas-admin__detail-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.ideas-admin__mod-actions {
    display: flex;
    gap: 10px;
}
.ideas-admin__mod-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    background: #f9fafb;
    color: #64748b;
}
.ideas-admin__mod-btn:hover { background: #f1f5f9; }

/* Принять — зелёная */
.ideas-admin__mod-btn--accept.is-active {
    background: #16A34A;
    color: #fff;
    border-color: #16A34A;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}
.ideas-admin__mod-btn--accept:not(.is-active):hover {
    background: #DCFCE7;
    color: #15803D;
    border-color: #BBF7D0;
}
/* Отклонить — красная */
.ideas-admin__mod-btn--reject.is-active {
    background: #EF4444;
    color: #fff;
    border-color: #EF4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.ideas-admin__mod-btn--reject:not(.is-active):hover {
    background: #FEE2E2;
    color: #B91C1C;
    border-color: #FECACA;
}

.ideas-admin__empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px 16px !important;
    font-size: 14px;
}

.ideas-admin__loading {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ─── Карточка идеи (выезжающая панель) ─── */
.ideas-admin__detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1099;   /* вместе с карточкой поднят выше шапки страницы */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.ideas-admin__detail-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.ideas-admin__detail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -10px 0 30px rgba(15,23,42,0.08);
    /* Выше шапки страницы (z-index 1001): иначе её верх накрывал карточку идеи,
       и клик по «Удалить» попадал в ссылку «Выйти» - удалить идею было нельзя. */
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ideas-admin__detail.is-open {
    transform: translateX(0);
}

.ideas-admin__detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: unset;
}

.ideas-admin__detail-close,
.ideas-admin__detail-delete {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ideas-admin__detail-close:hover { background: #f1f5f9; color: #0f172a; }
.ideas-admin__detail-delete:hover { background: #fee2e2; color: #ef4444; }

.ideas-admin__detail-h {
    flex: 1;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.ideas-admin__detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ideas-admin__detail-meta {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.ideas-admin__detail-row {
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 4px;
}
.ideas-admin__detail-row:last-child { margin-bottom: 0; }
.ideas-admin__detail-row .lbl {
    color: #64748b;
    font-weight: 500;
}

.ideas-admin__detail-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.ideas-admin__detail-desc {
    color: #334155;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    margin-bottom: 18px;
}

.ideas-admin__detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.ideas-admin__detail-photo {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: block;
    padding: 0;
    cursor: zoom-in;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ideas-admin__detail-photo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.ideas-admin__detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Лайтбокс ─── */
.ideas-admin__lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(8, 12, 24, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.ideas-admin__lightbox.is-open {
    display: flex;
    opacity: 1;
}
.ideas-admin__lightbox-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.ideas-admin__lightbox-close,
.ideas-admin__lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.15s, transform 0.15s;
}
.ideas-admin__lightbox-close:hover,
.ideas-admin__lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.20);
}
.ideas-admin__lightbox-close:active,
.ideas-admin__lightbox-nav:active { transform: scale(0.94); }

.ideas-admin__lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
}
.ideas-admin__lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
}
.ideas-admin__lightbox-nav--prev { left: 20px; }
.ideas-admin__lightbox-nav--next { right: 20px; }
.ideas-admin__lightbox-nav:active { transform: translateY(-50%) scale(0.94); }

.ideas-admin__lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    -webkit-user-select: none;
}

@media (max-width: 640px) {
    .ideas-admin__lightbox { padding: 16px; }
    .ideas-admin__lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
    .ideas-admin__lightbox-nav { width: 42px; height: 42px; }
    .ideas-admin__lightbox-nav--prev { left: 8px; }
    .ideas-admin__lightbox-nav--next { right: 8px; }
}

.ideas-admin__detail-statusbar {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ideas-admin__detail-statuslabel {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.ideas-admin__detail-status {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--st-color, #94a3b8);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    color: var(--st-color, #0f172a);
    cursor: pointer;
    outline: none;
}
.ideas-admin__detail-status:focus { border-color: var(--primary); }

/* ============================================================
   Точка-индикатор уведомлений на пункте меню (например, "Идеи")
   ============================================================ */
.side-nav__item.has-notif {
    position: relative;
}
.side-nav__item.has-notif .side-nav__icon {
    position: relative;
}
.side-nav__item.has-notif .side-nav__icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    border: unset;
    animation: ideasNotifPulse 2s ease-in-out infinite;
}

@keyframes ideasNotifPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.15); opacity: 0.85; }
}

/* Адаптив */
@media (max-width: 640px) {
    .ideas-admin__detail { max-width: 100%; }
}

/* ============================================================
   ПОКУПКИ (страница админки)
   ============================================================ */
.purchases-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    width: 100%;
    height: 100%;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
}

.purchases-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.purchases-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.purchases-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.purchases-filter {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}
.purchases-filter:hover { background: #f9fafb; border-color: #d1d5db; }
.purchases-filter.is-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.purchases-tablewrap {
    background: #fff;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.purchases-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f3f4f6 center/cover no-repeat;
    border: 1px solid #e5e7eb;
}
.purchases-thumb--empty {
    background-image: none;
}

.purchases-cell-num {
    font-weight: 700;
    color: #111827;
    font-size: 13px;
}
.purchases-cell-date {
    font-size: 13px;
    color: #111827;
    line-height: 1.2;
}
.purchases-cell-time {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.2;
    margin-top: 2px;
}
.purchases-cell-name {
    font-size: 14px;
    color: #111827;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.purchases-cell-price {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(41, 92, 201, 0.10);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 13px;
}
.purchases-cell-user {
    font-size: 13px;
    color: #374151;
}

/* Селект статуса с цветовой подсказкой */
.purchases-status {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 28px 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: filter 0.15s;
}
.purchases-status:hover { filter: brightness(0.97); }
.purchases-status:disabled { opacity: 0.6; cursor: wait; }

.purchases-status--new        { background-color: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.purchases-status--processing { background-color: #cffafe; color: #155e75; border-color: #a5f3fc; }
.purchases-status--delivered  { background-color: #dcfce7; color: #166534; border-color: #bbf7d0; }
.purchases-status--cancelled  { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* Отменённые строки в таблице — приглушённые */
.purchases-row--cancelled td { opacity: 0.55; }
.purchases-row--cancelled .purchases-status { opacity: 1; }
.cu-status-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}
.cu-status-dot--on  { background: #22c55e; }   /* зелёный  */
.cu-status-dot--off { background: #ef4444; }   /* красный  */

/* ── Значок платформы вместо кружка (Apple / Android) ──
   Значок = устройство пользователя (по последнему пуш-токену),
   цвет    = заходил ли в приложение. Кружок остаётся запасным
   вариантом, когда платформа неизвестна (пуш-токена нет). */
.cu-plat {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.cu-plat svg { width: 100%; height: 100%; display: block; }
.cu-plat--ios.cu-plat--on      { color: #111827; }   /* Apple — тёмный  */
.cu-plat--android.cu-plat--on  { color: #3ddc84; }   /* Android — зелёный робот */
.cu-plat--off                  { color: #cbd5e1; }   /* не заходил — приглушённый */
/* Уведомления на телефоне запрещены: серый перечеркнутый динамик рядом со значком устройства. */
.cu-mute {
    flex-shrink: 0; width: 14px; height: 14px; margin: 0 -4px 0 -14px;   /* от значка устройства ~6px */
    color: #9ca3af; display: inline-flex;
}
.cu-mute svg { width: 100%; height: 100%; display: block; }
/* У яблока масса внизу (листик сверху тонкий): по рамке оно по центру, а на глаз ниже. */
.cu-plat--ios + .cu-mute { transform: translateY(1.5px); }

/* ── Skeleton ────────────────────────────── */
@keyframes cu-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.cu-skel {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--color-background-secondary) 25%,
        var(--color-background-tertiary)  50%,
        var(--color-background-secondary) 75%
    );
    background-size: 800px 100%;
    animation: cu-shimmer 1.4s ease-in-out infinite;
}

/* Размеры заглушек */
.cu-skel--section { height: 36px; width: 180px; border-radius: 4px; }
.cu-skel--dot     { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cu-skel--name    { width: 120px; height: 13px; }
.cu-skel--email   { width: 160px; height: 11px; opacity: .7; }
.cu-skel--post    { width: 90px;  height: 13px; }
.cu-skel--chip    { width: 60px;  height: 20px; border-radius: 10px; }
.cu-skel--num     { width: 40px;  height: 13px; margin: 0 auto; }
.cu-skel--invite  { width: 80px;  height: 13px; margin: 0 auto; }
.cu-skel--date    { width: 130px; height: 14px; border-radius: 7px; margin-top: 2px; }
.cu-skel--sm      { width: 20px;  height: 20px; border-radius: 6px; margin: 0 auto; }

/* Строки скелетона — такая же высота как реальные */
.cu-skeleton-row td      { padding: 10px 12px; vertical-align: middle; }
.cu-skeleton-section td  { padding: 6px 12px; }
.cu-skel {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #f2f2f2 50%,
        #e8e8e8 75%
    );
    background-size: 800px 100%;
    animation: cu-shimmer 1.4s ease-in-out infinite;
}
/* ============================================================
   ОНБОРДИНГ — Админка
   Дописать в конец style.css
   ============================================================ */

.onb-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.onb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.onb-head__title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.onb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--primary, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}
.onb-btn-primary:hover  { background: #6d28d9; }
.onb-btn-primary:active { transform: scale(0.98); }

/* ─── Табы типов ─── */
.onb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
}
.onb-tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.onb-tab:hover { background: rgba(255,255,255,0.6); color: #0f172a; }
.onb-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06);
    font-weight: 600;
}

.onb-skeleton {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.onb-empty {
    border: 2px dashed #e5e7eb;
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.onb-empty:hover {
    border-color: var(--primary, #7c3aed);
    background: #faf7ff;
}
.onb-empty__plus {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #f3efff;
    color: var(--primary, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
}
.onb-empty__plus svg { width: 22px; height: 22px; }

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

/* ─── Шаг ─── */
.onb-step {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.onb-step:hover { box-shadow: 0 2px 10px rgba(15,23,42,0.06); }
.onb-step.is-dragging { opacity: 0.45; border-color: var(--primary, #7c3aed); }

.onb-step__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.onb-step__handle {
    cursor: grab;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.12s, background 0.12s;
}
.onb-step__handle:hover { color: #64748b; background: #f8fafc; }
.onb-step__handle:active { cursor: grabbing; }
.onb-step__handle svg { width: 16px; height: 16px; }

.onb-step__num {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    min-width: 50px;
}

.onb-step__chevron {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.onb-step__chevron svg { width: 14px; height: 14px; }
.onb-step.is-open .onb-step__chevron { transform: rotate(90deg); }

.onb-step__title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: text;
    outline: none;
    transition: background 0.12s, box-shadow 0.12s;
}
.onb-step__title:hover { background: #f9fafb; }
.onb-step__title:focus { background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; }

.onb-step__del {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}
.onb-step__del:hover { background: #fef2f2; color: var(--danger, #ef4444); }
.onb-step__del svg { width: 15px; height: 15px; }

.onb-step__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-top: 1px solid transparent;
}
.onb-step.is-open .onb-step__body {
    max-height: 1500px;
    border-top-color: #f1f5f9;
    padding: 14px 16px 16px;
}

/* ─── Поля внутри шага ─── */
.onb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.onb-field + .onb-field { margin-top: 12px; }

.onb-field__label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.onb-field__text {
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
    color: #0f172a;
    background: #fff;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.onb-field__text:hover { border-color: #d1d5db; }
.onb-field__text:focus { border-color: var(--primary, #7c3aed); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10); }
.onb-field__text:empty::before {
    content: attr(data-placeholder);
    color: #cbd5e1;
}

.onb-field__btn {
    align-self: flex-start;
    min-width: 120px;
    max-width: 320px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #f9fafb;
    cursor: text;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.onb-field__btn:hover { border-color: #d1d5db; background: #fff; }
.onb-field__btn:focus { border-color: var(--primary, #7c3aed); background: #fff; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10); }

/* ─── Состояние «сохранение» ─── */
.onb-edit.is-saving {
    opacity: 0.6;
    pointer-events: none;
}
/* Выключение доступа сотруднику. Кнопка живёт рядом с удалением и ведёт себя так же:
   проявляется на наведении. Выключенный доступ помечен постоянно видимой кнопкой,
   иначе в списке не отличить, кто ещё работает. */
.cu-row__off {
    all: unset;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.cu-row__off svg { width: 14px; height: 14px; }
.cu-table tr:hover .cu-row__off { opacity: 1; }
.cu-row__off:hover { background: rgba(249,115,22,0.12); color: #ea580c; }
.cu-row__off.is-off { opacity: 1; color: #ea580c; background: rgba(249,115,22,0.12); }
