/* =====================================================================
   ИНВЕНТАРИЗАЦИЯ — общие стили основной страницы и страницы участника.
   Подключается после style2.css / topbar.css / mobile.css.
   ===================================================================== */

:root {
    --inv-accent: #6c5ce7;
    --inv-accent-dk: #5a4bd1;
    --inv-accent-soft: #f0edff;
    --inv-ink: #1e1e2a;
    --inv-muted: #8e929b;
    --inv-muted-2: #6f7480;
    --inv-line: #eef0f4;
    --inv-bg: #f5f7fb;
    --inv-green: #2e7d32;
    --inv-green-soft: #e8f5e9;
    --inv-amber: #b26a00;
    --inv-amber-soft: #fff4e0;
    --inv-red: #d64545;
    --inv-red-soft: #fdeceb;
    --inv-lime: #d8ff6a;
    --inv-radius: 20px;
    --inv-shadow: 0 8px 30px rgba(30, 30, 42, .05);
}

html {
    height: auto !important;
    overflow: auto !important;
}

body.inv-body {
    height: auto !important;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: block;
    padding: 0;
    background: var(--inv-bg);
    color: var(--inv-ink);
}

#app.inv-app {
    display: block;
    min-height: 100vh;
    height: auto;
    max-height: none;
    background: transparent;
    border-radius: 0;
}

/* ---------- Каркас ---------- */
.inv-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 96px;
}

.inv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 100px 20px;
    color: var(--inv-muted);
    font-size: 14px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e4dfff;
    border-top-color: var(--inv-accent);
    border-radius: 50%;
    animation: invSpin .8s linear infinite;
}

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

/* ---------- Hero ---------- */
.inv-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inv-hero__left { min-width: 260px; }

.inv-hero h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.6px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.15;
}

.inv-hero__sub {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--inv-muted-2);
    max-width: 620px;
}

.inv-hero__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inv-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.inv-stat {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: 14px;
    padding: 10px 16px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(30, 30, 42, .03);
}

.inv-stat b { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.inv-stat span { font-size: 12px; color: var(--inv-muted); }

/* ---------- Кнопки ---------- */
.inv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
    white-space: nowrap;
}

.inv-btn:active:not(:disabled) { transform: scale(.98); }
.inv-btn:disabled { opacity: .5; cursor: not-allowed; }

.inv-btn--primary {
    background: var(--inv-accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 92, 231, .25);
}
.inv-btn--primary:hover:not(:disabled) { background: var(--inv-accent-dk); }

.inv-btn--soft {
    background: var(--inv-accent-soft);
    color: var(--inv-accent);
    border-color: #e4dfff;
}
.inv-btn--soft:hover:not(:disabled) { background: #e6e0ff; }

.inv-btn--ghost {
    background: #fff;
    color: var(--inv-ink);
    border-color: var(--inv-line);
}
.inv-btn--ghost:hover:not(:disabled) { background: #f7f8fb; border-color: #dfe3ea; }

.inv-btn--danger {
    background: var(--inv-red-soft);
    color: var(--inv-red);
    border-color: #f6d5d5;
}
.inv-btn--danger:hover:not(:disabled) { background: #fbdcdc; }

.inv-btn--success {
    background: var(--inv-green);
    color: #fff;
}
.inv-btn--success:hover:not(:disabled) { background: #256428; }

.inv-btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.inv-btn--icon { padding: 8px 10px; }

.inv-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--inv-line);
    border-radius: 11px;
    background: #fff;
    color: var(--inv-muted-2);
    cursor: pointer;
    font-size: 17px;
    transition: background .15s, color .15s;
}
.inv-icon-btn:hover { background: #f6f7fa; color: var(--inv-ink); }

/* ---------- Табы ---------- */
.inv-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eceef4;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.inv-tab {
    border: none;
    background: transparent;
    border-radius: 11px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--inv-muted-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, color .15s, box-shadow .15s;
}

.inv-tab:hover { color: var(--inv-ink); }

.inv-tab--active {
    background: #fff;
    color: var(--inv-ink);
    box-shadow: 0 2px 8px rgba(30, 30, 42, .08);
}

.inv-tab__count {
    background: #e8eaf3;
    color: var(--inv-muted-2);
    font-size: 11px;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 20px;
    text-align: center;
}
.inv-tab--active .inv-tab__count { background: var(--inv-accent-soft); color: var(--inv-accent); }

/* ---------- Карточки инвентаризаций ---------- */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.inv-card {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow);
    padding: 20px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.inv-card--clickable { cursor: pointer; }
.inv-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(30, 30, 42, .09);
    border-color: #e2e5ee;
}

.inv-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.inv-kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.inv-kind--property { background: #eaf5e0; color: #3c6b20; }
.inv-kind--goods { background: #eaf0ff; color: #3355b3; }

.inv-card h3 {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.2px;
    line-height: 1.35;
    margin-bottom: 4px;
    word-break: break-word;
}

.inv-card__meta {
    font-size: 12.5px;
    color: var(--inv-muted);
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inv-card__progress { margin-top: 16px; }

.inv-request-badge {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--inv-amber);
    background: var(--inv-amber-soft);
    border-radius: 7px;
    padding: 3px 8px;
}

.inv-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--inv-line);
}

.inv-card__people {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--inv-muted);
}

.avatar-stack { display: inline-flex; align-items: center; margin-right: 8px; }
.avatar-stack .avatar { margin-left: -7px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background: #8e929b;
    user-select: none;
}
.avatar--more { background: #e8eaf3; color: var(--inv-muted-2); font-size: 10px; }

/* ---------- Прогресс ---------- */
.inv-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inv-progress__bar {
    flex: 1;
    height: 8px;
    background: #eceef4;
    border-radius: 20px;
    overflow: hidden;
}

.inv-progress__fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #8a7bff, var(--inv-accent));
    transition: width .5s ease;
}

.inv-progress__fill--done { background: linear-gradient(90deg, #56b25c, #2e7d32); }

.inv-progress__text {
    font-size: 12px;
    font-weight: 600;
    color: var(--inv-muted-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---------- Статусы ---------- */
.inv-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.inv-status--open { background: var(--inv-green-soft); color: var(--inv-green); }
.inv-status--closed { background: #eef0f4; color: var(--inv-muted-2); }

.inv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}
.inv-dot--live { animation: invPulse 1.8s infinite; }
@keyframes invPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.8); }
}

/* ---------- Пустое состояние ---------- */
.inv-empty {
    text-align: center;
    padding: 56px 24px;
    background: #fff;
    border: 1px dashed #dfe3ec;
    border-radius: var(--inv-radius);
    color: var(--inv-muted);
}
.inv-empty__icon { font-size: 42px; margin-bottom: 12px; opacity: .75; }
.inv-empty__title { font-size: 16px; font-weight: 600; color: var(--inv-ink); margin-bottom: 6px; }
.inv-empty__text { font-size: 13.5px; line-height: 1.5; max-width: 420px; margin: 0 auto 16px; }

/* ---------- Детальная страница ---------- */
.inv-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--inv-muted-2);
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 8px;
}
.inv-back:hover { color: var(--inv-accent); }

.inv-detail-head {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow);
    padding: 22px 24px;
    margin-bottom: 18px;
}

.inv-detail-head__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.inv-detail-head h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.25;
    margin: 6px 0 5px;
    word-break: break-word;
}

.inv-detail-head__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--inv-muted);
}

.inv-detail-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inv-detail-progress {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.inv-detail-progress .inv-progress { flex: 1; }

.inv-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--inv-green);
}

.inv-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 18px;
    align-items: start;
}

.inv-detail__main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.inv-detail__side { min-width: 0; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 18px; }

.inv-panel {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow);
    overflow: hidden;
}

.inv-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--inv-line);
    flex-wrap: wrap;
}

.inv-panel__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.inv-panel__title .muted { color: var(--inv-muted); font-weight: 500; font-size: 13px; }

.inv-panel__body { padding: 18px 20px; }
.inv-panel__body--flush { padding: 0; }

.inv-panel__hint {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--inv-muted);
}

/* ---------- Лента проверок ---------- */
.inv-feed { max-height: 560px; overflow-y: auto; }
.inv-feed__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid #f4f5f8;
    animation: invFeedIn .35s ease;
}
.inv-feed__item:last-child { border-bottom: none; }
@keyframes invFeedIn {
    from { opacity: 0; transform: translateY(-5px); background: #f7fff0; }
    to { opacity: 1; transform: translateY(0); background: transparent; }
}
.inv-feed__item--new { background: #f6ffe9; }
.inv-feed__body { flex: 1; min-width: 0; }
.inv-feed__line {
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--inv-ink);
    word-break: break-word;
}
.inv-feed__line b { font-weight: 650; }
.inv-feed__item-name {
    font-size: 13px;
    color: var(--inv-muted-2);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inv-feed__time {
    font-size: 11.5px;
    color: #a8aeb8;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ---------- Переключатель звука ---------- */
.inv-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--inv-muted-2);
    cursor: pointer;
    user-select: none;
}
.inv-switch input { width: 16px; height: 16px; accent-color: var(--inv-accent); cursor: pointer; }

/* ---------- Участники ---------- */
.inv-people { display: flex; flex-direction: column; }
.inv-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid #f4f5f8;
}
.inv-person:last-child { border-bottom: none; }
.inv-person__body { min-width: 0; flex: 1; }
.inv-person__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-person__meta { font-size: 11.5px; color: var(--inv-muted); margin-top: 1px; }
.inv-person__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--inv-green);
    background: var(--inv-green-soft);
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Заявки на вступление */
.inv-pending-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--inv-amber);
    background: var(--inv-amber-soft);
    border-radius: 20px;
    padding: 3px 8px;
    white-space: nowrap;
}
.inv-requests {
    background: #fffdf7;
    border-bottom: 1px solid var(--inv-line);
}
.inv-requests__title {
    padding: 12px 20px 2px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--inv-amber);
}
.inv-person--request { background: transparent; }
.inv-person__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.inv-person__remove {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #f3f4f8;
    color: var(--inv-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.inv-person__remove:hover { background: var(--inv-red-soft); color: var(--inv-red); }
.inv-person__remove:active { transform: scale(.94); }

/* Итоги */
.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}
.result-stat {
    background: #f8f9fc;
    border: 1px solid var(--inv-line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.result-stat b {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.6px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.result-stat span { font-size: 11px; color: var(--inv-muted); }
.result-stat--ok b { color: var(--inv-green); }
.result-stat--warn b { color: var(--inv-amber); }

.result-block { margin-top: 20px; }
.result-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--inv-line);
}
.result-block__head h4 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.2px;
}
.result-block__head > span {
    font-size: 12px;
    font-weight: 700;
    color: var(--inv-muted);
    background: #f0f1f6;
    border-radius: 20px;
    padding: 2px 8px;
}
.result-table-wrap {
    max-height: 560px;
    overflow: auto;
    border: 1px solid var(--inv-line);
    border-radius: 12px;
    margin-top: 10px;
}
.result-table { min-width: 760px; }
.result-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.result-table .inv-table__sub {
    max-width: 460px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-status {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 8px;
    padding: 3px 8px;
    white-space: nowrap;
}
.result-status--missing { color: var(--inv-amber); background: var(--inv-amber-soft); }
.result-ok {
    margin-top: 10px;
    background: var(--inv-green-soft);
    border: 1px solid #cfe9d4;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--inv-green);
}
.result-ok--empty { background: #f8f9fc; border-color: var(--inv-line); color: var(--inv-muted); }

/* Большая кнопка добавления после распознанного списка */
.inv-import__submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0 4px;
}
.inv-add-btn {
    width: 100%;
    max-width: 540px;
    min-height: 56px;
    padding: 10px 32px;
    font-size: 16px;
    border-radius: 15px;
    white-space: normal;
    line-height: 1.25;
    box-shadow: 0 10px 24px rgba(108, 92, 231, .3);
}
.inv-import__submit-hint {
    font-size: 12px;
    color: var(--inv-muted);
    text-align: center;
    max-width: 460px;
    line-height: 1.45;
}
.inv-import__progress {
    width: 100%;
    max-width: 540px;
    height: 8px;
    background: #eceef4;
    border-radius: 20px;
    overflow: hidden;
}
.inv-import__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8a7bff, var(--inv-accent));
    border-radius: 20px;
    transition: width .2s ease;
}

/* ---------- QR ---------- */
.inv-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}
.inv-qr__box {
    width: 210px;
    height: 210px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inv-qr__box svg { width: 100%; height: 100%; display: block; }
.inv-qr__caption {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--inv-muted);
    text-align: center;
    line-height: 1.45;
    max-width: 280px;
}
.inv-link-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
}
.inv-link-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--inv-line);
    background: #f8f9fc;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
    color: var(--inv-muted-2);
    font-family: ui-monospace, Consolas, monospace;
    outline: none;
}
.inv-link-input:focus { border-color: var(--inv-accent); background: #fff; }

/* ---------- Импорт ---------- */
.inv-import__drop {
    border: 2px dashed #dfe3ec;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    transition: border-color .15s, background .15s;
    cursor: pointer;
    background: #fbfcfe;
}
.inv-import__drop:hover, .inv-import__drop--over {
    border-color: var(--inv-accent);
    background: #f7f5ff;
}
.inv-import__drop-icon { font-size: 26px; margin-bottom: 6px; }
.inv-import__drop-title { font-size: 13.5px; font-weight: 600; }
.inv-import__drop-hint { font-size: 12px; color: var(--inv-muted); margin-top: 3px; }

.inv-textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid var(--inv-line);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--inv-ink);
    outline: none;
    background: #fbfcfe;
    transition: border-color .15s, box-shadow .15s;
}
.inv-textarea:focus { border-color: var(--inv-accent); box-shadow: 0 0 0 3px rgba(108, 92, 231, .1); background: #fff; }

.inv-import__toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.inv-import__status { font-size: 12.5px; color: var(--inv-muted-2); margin-left: auto; }

.inv-example {
    margin-top: 14px;
    background: #f8f9fc;
    border: 1px solid var(--inv-line);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--inv-muted-2);
    line-height: 1.6;
}
.inv-example summary { cursor: pointer; font-weight: 600; color: var(--inv-accent); list-style: none; }
.inv-example summary::-webkit-details-marker { display: none; }
.inv-example code {
    font-family: ui-monospace, Consolas, monospace;
    background: #eef0f6;
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--inv-ink);
}

.inv-preview {
    margin-top: 14px;
    border: 1px solid var(--inv-line);
    border-radius: 12px;
    overflow: hidden;
}
.inv-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fc;
    border-bottom: 1px solid var(--inv-line);
    font-size: 12.5px;
    font-weight: 600;
}
.inv-preview__table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; }
.inv-preview table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
.inv-preview th {
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .35px;
    color: var(--inv-muted);
    padding: 8px 12px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--inv-line);
    white-space: nowrap;
}
.inv-preview td {
    padding: 8px 12px;
    border-bottom: 1px solid #f4f5f8;
    color: var(--inv-ink);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inv-preview tr:last-child td { border-bottom: none; }

/* ---------- Таблица товаров ---------- */
.inv-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--inv-line);
    flex-wrap: wrap;
}
.inv-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.inv-search input {
    width: 100%;
    border: 1px solid var(--inv-line);
    background: #f8f9fc;
    border-radius: 11px;
    padding: 9px 12px 9px 34px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}
.inv-search input:focus { border-color: var(--inv-accent); background: #fff; box-shadow: 0 0 0 3px rgba(108, 92, 231, .1); }
.inv-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--inv-muted);
}
.inv-chip {
    border: 1px solid var(--inv-line);
    background: #fff;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--inv-muted-2);
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.inv-chip:hover { border-color: #d7dbe5; color: var(--inv-ink); }
.inv-chip--active { background: var(--inv-accent-soft); border-color: #ddd7ff; color: var(--inv-accent); font-weight: 600; }

.inv-table-wrap { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.inv-table th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--inv-muted);
    padding: 10px 14px;
    background: #fafbfc;
    border-bottom: 1px solid var(--inv-line);
    white-space: nowrap;
}
.inv-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f4f5f8;
    font-size: 13px;
    vertical-align: middle;
}
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-table tbody tr:hover { background: #fbfcfe; }
.inv-table__name { font-weight: 600; max-width: 380px; }
.inv-table__sub { font-size: 11.5px; color: var(--inv-muted); margin-top: 2px; }
.inv-table__code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--inv-muted-2); white-space: nowrap; }
.inv-table__amount { font-weight: 600; white-space: nowrap; color: var(--inv-green); }
.inv-table__check { white-space: nowrap; font-size: 12px; }
.inv-check-mark { color: var(--inv-green); font-weight: 600; }
.inv-check-wait { color: var(--inv-muted); }

.inv-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--inv-line);
    font-size: 12px;
    color: var(--inv-muted);
    flex-wrap: wrap;
}
.inv-pager__btns { display: flex; gap: 6px; }
.inv-page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--inv-line);
    background: #fff;
    border-radius: 9px;
    font-size: 12px;
    color: var(--inv-ink);
    cursor: pointer;
    font-family: inherit;
}
.inv-page-btn:hover:not(:disabled) { border-color: var(--inv-accent); color: var(--inv-accent); }
.inv-page-btn:disabled { opacity: .4; cursor: default; }

/* ---------- Настройки ---------- */
.inv-setting {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f4f5f8;
}
.inv-setting:last-child { border-bottom: none; }
.inv-setting__body { flex: 1; }
.inv-setting__title { font-size: 13.5px; font-weight: 600; }
.inv-setting__hint { font-size: 11.5px; color: var(--inv-muted); margin-top: 2px; line-height: 1.4; }

/* ---------- Модалка ---------- */
.inv-form-row { margin-bottom: 14px; }
.inv-label { display: block; font-size: 12px; font-weight: 600; color: var(--inv-muted-2); margin-bottom: 6px; }
.inv-input, .inv-select {
    width: 100%;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--inv-ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.inv-input:focus, .inv-select:focus { border-color: var(--inv-accent); box-shadow: 0 0 0 3px rgba(108, 92, 231, .12); }
.inv-select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238e929b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.inv-form-hint { font-size: 12px; color: var(--inv-muted); margin-top: 5px; line-height: 1.45; }

.inv-kind-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inv-kind-card {
    border: 1.5px solid var(--inv-line);
    border-radius: 14px;
    padding: 13px;
    cursor: pointer;
    transition: all .15s;
    background: #fff;
    text-align: left;
    font-family: inherit;
}
.inv-kind-card:hover { border-color: #d7dbe5; }
.inv-kind-card--active { border-color: var(--inv-accent); background: #f8f5ff; box-shadow: 0 0 0 3px rgba(108, 92, 231, .08); }
.inv-kind-card__icon { font-size: 22px; margin-bottom: 6px; display: block; }
.inv-kind-card__title { font-size: 13.5px; font-weight: 700; color: var(--inv-ink); }
.inv-kind-card__hint { font-size: 11.5px; color: var(--inv-muted); margin-top: 2px; line-height: 1.4; }

/* ---------- Тост ---------- */
.inv-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: #1e1e2a;
    color: #fff;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    z-index: 1200;
    max-width: calc(100vw - 32px);
    animation: invToastIn .2s ease;
    text-align: center;
}
.inv-toast--error { background: #b33a3a; }
.inv-toast--success { background: #2e7d32; }
@keyframes invToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Логин ---------- */
.inv-login-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-login-note {
    font-size: 12.5px;
    color: var(--inv-muted-2);
    background: #f5f7fb;
    border: 1px solid var(--inv-line);
    border-radius: 12px;
    padding: 10px 12px;
    line-height: 1.5;
    text-align: left;
    width: 100%;
}

/* =====================================================================
   СТРАНИЦА УЧАСТНИКА
   ===================================================================== */
.join-body { background: #f3f5fa; }

.join-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 18px 70px;
}

.join-top {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: 18px;
    box-shadow: var(--inv-shadow);
    padding: 16px 18px;
    margin-bottom: 14px;
    position: sticky;
    top: 10px;
    z-index: 30;
}

.join-top__row { display: flex; align-items: center; gap: 12px; }
.join-top__back {
    width: 36px; height: 36px; flex-shrink: 0;
    border: 1px solid var(--inv-line); border-radius: 10px;
    background: #fff; color: var(--inv-muted-2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 17px; text-decoration: none;
}
.join-top__back:hover { background: #f7f8fb; }
.join-top__title { flex: 1; min-width: 0; }
.join-top__title h1 {
    font-size: 16px; font-weight: 700; letter-spacing: -.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.join-top__title p { font-size: 11.5px; color: var(--inv-muted); margin-top: 2px; }
.join-top__progress { margin-top: 12px; }

.join-settings-wrap { position: relative; flex-shrink: 0; }
.join-settings {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 300px;
    max-width: calc(100vw - 36px);
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(30, 30, 42, .16);
    z-index: 60;
    overflow: hidden;
    animation: invToastIn .15s ease;
}
.join-settings__head { padding: 12px 16px; border-bottom: 1px solid var(--inv-line); font-size: 13px; font-weight: 700; }
.join-settings .inv-setting { padding: 12px 16px; }

.join-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 14px;
    align-items: start;
}

.join-card {
    background: #fff;
    border: 1px solid var(--inv-line);
    border-radius: 20px;
    box-shadow: var(--inv-shadow);
    overflow: hidden;
}

.join-join-card { max-width: 560px; margin: 40px auto; }
.join-join-card__hero {
    padding: 26px 26px 0;
    text-align: center;
}
.join-join-card__icon { font-size: 46px; margin-bottom: 10px; }
.join-join-card__title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.3; }
.join-join-card__meta { margin-top: 8px; font-size: 13px; color: var(--inv-muted); line-height: 1.55; }
.join-join-card__body { padding: 22px 26px 26px; }
.join-account {
    display: flex; align-items: center; gap: 10px;
    background: #f8f9fc; border: 1px solid var(--inv-line);
    border-radius: 12px; padding: 10px 12px;
    font-size: 12.5px; color: var(--inv-muted-2);
    margin-bottom: 16px;
}
.join-account b { color: var(--inv-ink); }

/* Сканер */
.scanner-card { padding: 18px; }

.scanner-title {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
}
.scanner-title h2 { font-size: 15px; font-weight: 700; }
.scanner-title__hint { font-size: 11.5px; color: var(--inv-muted); }

.scan-input-row { display: flex; gap: 8px; }
.scan-input-wrap { position: relative; flex: 1; min-width: 0; }
.scan-input {
    width: 100%;
    height: 60px;
    border: 2px solid #ded9ff;
    border-radius: 15px;
    background: #fbfaff;
    padding: 0 48px 0 16px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: .5px;
    font-family: inherit;
    color: var(--inv-ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.scan-input::placeholder { font-size: 16px; font-weight: 400; letter-spacing: 0; color: #b0b5c2; }
.scan-input:focus { border-color: var(--inv-accent); background: #fff; box-shadow: 0 0 0 4px rgba(108, 92, 231, .12); }
.scan-input--ok { border-color: var(--inv-green) !important; box-shadow: 0 0 0 4px rgba(46, 125, 50, .14) !important; }
.scan-input--err { border-color: var(--inv-red) !important; box-shadow: 0 0 0 4px rgba(214, 69, 69, .12) !important; }
.scan-input:disabled { opacity: .55; }
.scan-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: none; border-radius: 50%;
    background: #f0f1f6; color: var(--inv-muted-2);
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.scan-clear:hover { background: #e8eaf1; color: var(--inv-ink); }

.scan-submit {
    height: 60px;
    min-width: 104px;
    border: none;
    border-radius: 15px;
    background: var(--inv-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 0 20px;
    transition: background .15s, transform .1s;
    box-shadow: 0 8px 18px rgba(108, 92, 231, .22);
}
.scan-submit:hover:not(:disabled) { background: var(--inv-accent-dk); }
.scan-submit:active:not(:disabled) { transform: scale(.98); }
.scan-submit:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.scan-hint {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 9px; font-size: 11.5px; color: var(--inv-muted);
    line-height: 1.45;
}
.scan-hint kbd {
    font-family: inherit; font-size: 10.5px; font-weight: 600;
    background: #f0f1f6; border: 1px solid #e3e5ec; border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 6px; color: var(--inv-muted-2);
}

/* Подсказки */
.scan-suggest {
    margin-top: 8px;
    border: 1px solid var(--inv-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(30, 30, 42, .1);
    overflow: hidden;
}
.scan-suggest__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer;
    border-bottom: 1px solid #f4f5f8;
}
.scan-suggest__item:last-child { border-bottom: none; }
.scan-suggest__item:hover { background: #f8f6ff; }
.scan-suggest__body { flex: 1; min-width: 0; }
.scan-suggest__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-suggest__meta { font-size: 11px; color: var(--inv-muted); margin-top: 1px; }
.scan-suggest__code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px; color: var(--inv-muted-2);
    background: #f3f4f8; border-radius: 6px; padding: 3px 7px;
    white-space: nowrap;
}

/* Карточка результата */
.scan-result { margin-top: 14px; border-radius: 16px; overflow: hidden; border: 1px solid var(--inv-line); animation: invFeedIn .25s ease; }
.scan-result__head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: 13px; font-weight: 700;
}
.scan-result--success .scan-result__head { background: var(--inv-green-soft); color: var(--inv-green); }
.scan-result--already .scan-result__head { background: var(--inv-amber-soft); color: var(--inv-amber); }
.scan-result--notfound .scan-result__head, .scan-result--error .scan-result__head { background: var(--inv-red-soft); color: var(--inv-red); }
.scan-result__body { padding: 16px; background: #fff; }

.scan-product__name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    line-height: 1.3;
    word-break: break-word;
}
.scan-product__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-top: 14px;
}
.scan-field__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--inv-muted); font-weight: 700; }
.scan-field__value { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-word; font-variant-numeric: tabular-nums; }
.scan-amount { color: var(--inv-green); font-size: 18px; }
.scan-product__details {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--inv-line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}
.scan-product__details .scan-field__label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.scan-product__details .scan-field__value { font-size: 12.5px; font-weight: 500; color: var(--inv-muted-2); }

.scan-notfound__query {
    font-family: ui-monospace, Consolas, monospace;
    background: #f3f4f8; border-radius: 6px; padding: 2px 7px;
    font-size: 13px; color: var(--inv-ink);
}

/* Лента участника */
.join-feed { max-height: 520px; overflow-y: auto; }
.join-feed__title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--inv-line);
    font-size: 13px; font-weight: 700;
}
.join-feed__list { display: flex; flex-direction: column; }
.join-feed__item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #f4f5f8; }
.join-feed__item:last-child { border-bottom: none; }
.join-feed__body { flex: 1; min-width: 0; }
.join-feed__line { font-size: 12.5px; line-height: 1.4; }
.join-feed__item-name { font-size: 11.5px; color: var(--inv-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-feed__time { font-size: 10.5px; color: #a8aeb8; white-space: nowrap; }

.join-progress-big {
    display: flex; align-items: baseline; gap: 8px;
    font-variant-numeric: tabular-nums;
}
.join-progress-big b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.join-progress-big span { font-size: 12px; color: var(--inv-muted); }

.finished-banner {
    background: #fff4e0; color: #8a5a00;
    border: 1px solid #f3ddb4;
    padding: 12px 16px; border-radius: 14px;
    font-size: 13px; font-weight: 600;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}

/* Адаптив */
@media (max-width: 1080px) {
    .inv-detail { grid-template-columns: minmax(0, 1fr) 320px; }
    .join-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
}

@media (max-width: 900px) {
    .inv-detail { grid-template-columns: 1fr; }
    .inv-detail__side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
    .join-grid { grid-template-columns: 1fr; }
    .join-feed { max-height: 360px; }
}

@media (max-width: 768px) {
    .inv-main { padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 0px)); }
    .inv-hero h1 { font-size: 22px; }
    .inv-hero__sub { font-size: 13px; }
    .inv-hero__actions { width: 100%; }
    .inv-hero__actions .inv-btn { flex: 1; }
    .inv-grid { grid-template-columns: 1fr; gap: 12px; }
    .inv-card { padding: 16px; }
    .inv-detail-head { padding: 16px; }
    .inv-detail-head h1 { font-size: 20px; }
    .inv-detail-head__actions { width: 100%; }
    .inv-detail-head__actions .inv-btn--primary,
    .inv-detail-head__actions .inv-btn--ghost { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }
    .inv-detail-head__actions .inv-btn--icon { flex: 0 0 38px; }
    .inv-detail__side { grid-template-columns: 1fr; }
    .inv-tabs { width: 100%; }
    .inv-tab { flex: 1; justify-content: center; padding: 8px 10px; }
    .inv-toolbar { padding: 12px 14px; }
    .inv-panel__head, .inv-panel__body { padding-left: 14px; padding-right: 14px; }
    .inv-feed__item { padding-left: 14px; padding-right: 14px; }
    .inv-person { padding-left: 14px; padding-right: 14px; }
    .inv-table th, .inv-table td { padding-left: 10px; padding-right: 10px; }
    .inv-qr__box { width: 190px; height: 190px; }
    .inv-stats { gap: 8px; }
    .inv-stat { flex: 1; padding: 9px 12px; }
    .inv-stat b { font-size: 17px; }
    .result-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .result-stat { padding: 10px 12px; }
    .result-stat b { font-size: 19px; }
    .inv-add-btn { font-size: 14.5px; min-height: 52px; padding: 10px 18px; }
    .inv-person__actions .inv-btn { padding: 7px 10px; }
    .inv-requests__title { padding-left: 14px; padding-right: 14px; }
    .result-table .inv-table__sub { max-width: 240px; }
    .join-main { padding: 12px 12px calc(30px + env(safe-area-inset-bottom, 0px)); }
    .join-top { top: 6px; padding: 12px 14px; border-radius: 16px; }
    .join-top__title h1 { font-size: 14px; }
    .scanner-card { padding: 14px; }
    .scan-input { height: 56px; font-size: 21px; padding-right: 44px; }
    .scan-submit { height: 56px; min-width: 82px; font-size: 14px; padding: 0 14px; }
    .scan-product__grid { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
    .scan-product__name { font-size: 18px; }
    .scan-product__details { grid-template-columns: 1fr; gap: 7px; }
    .scan-result__body { padding: 14px; }
    .join-join-card { margin: 18px auto; }
}

@media (max-width: 420px) {
    .inv-tab { font-size: 12px; }
    .scan-submit { min-width: 62px; font-size: 0; }
    .scan-submit::before { content: '➤'; font-size: 19px; }
    .join-top__progress .inv-progress__text { font-size: 11px; }
}
