/* Loricci — упаковка поставок: стили поверх style.css/admin.css (токены VORX). */

.pack-page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pack-alert { margin-bottom: var(--space-md, 16px); }
.pack-empty { padding: 40px 16px; text-align: center; color: var(--color-text-muted, #6b7280); border: 1px dashed var(--color-border, #e2e5ed); border-radius: 10px; background: var(--color-surface, #fff); }

/* Плашки статусов */
.pack-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pack-chip--ok { background: #ecfdf3; color: #16a34a; }
.pack-chip--off { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }

/* Всплывающее окно */
.pack-modal { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: none; align-items: flex-start; justify-content: center; z-index: 1000; overflow: auto; padding: 8vh 16px; }
.pack-modal.is-open { display: flex; }
.pack-modal__card { background: var(--color-surface, #fff); border-radius: 12px; padding: 22px; width: 100%; max-width: 460px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.pack-modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pack-modal__head h3 { margin: 0; font-size: 18px; }
.pack-modal__close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--color-text-muted, #6b7280); }
.pack-modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.pack-field { margin-bottom: 14px; }
.pack-field > label { display: block; font-size: 13px; font-weight: 600; color: var(--color-text-secondary, #6b7280); margin-bottom: 5px; }
.pack-pass { display: flex; gap: 8px; }
.pack-pass .form-input { flex: 1; font-family: ui-monospace, Menlo, monospace; }

/* Вход */
.pack-login { max-width: 360px; margin: 10vh auto; padding: 0 16px; }
.pack-login__brand { text-align: center; margin-bottom: 8px; }
.pack-login__brand .vorx-logo { width: 96px; height: 37px; }
.pack-login__title { text-align: center; font-size: 22px; margin: 0 0 22px; }
.pack-login__form { display: grid; gap: 14px; }
.pack-login__form .form-group { margin: 0; }
.pack-login__submit { width: 100%; padding-block: 12px; font-size: 16px; }
.pack-login .alert { margin-bottom: 14px; }
.pack-login__sign { text-align: center; color: var(--color-text-muted, #9ca3af); font-size: 12.5px; margin-top: 28px; }
.pack-vorx { font-weight: 700; letter-spacing: -.02em; color: var(--color-text, #1e2330); }
.pack-vorx i { font-style: normal; background: linear-gradient(110deg, #A855F7, #7C3AED 50%, #06B6D4); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ТСД (АТОЛ Smart M20: 4,2″, 720×1280 → ~360×640 css px). Крупные цели для пальца. */
.tsd-body { --ok: #16a34a; --ok-soft: #ecfdf3; --warn: #d97706; --warn-soft: #fff7ed; --loss: #dc2626; --loss-soft: #fef2f2;
  --prim: var(--color-primary, #2563eb); --prim-soft: #eff6ff; --line: var(--color-border, #e2e5ed); --surf: var(--color-surface, #fff); --mut: var(--color-text-muted, #6b7280);
  background: var(--color-bg, #f5f6fa); min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.tsd-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surf); border-bottom: 1px solid var(--line); min-height: 48px; }
.tsd-top__title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsd-top__right { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsd-back { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -4px 0 -4px -4px; font-size: 30px; line-height: 1; color: var(--mut); text-decoration: none; background: none; border: 0; cursor: pointer; }
.tsd-inline { display: inline; margin: 0; }
.tsd-link { background: none; border: 0; color: var(--prim); font: inherit; font-size: 13.5px; padding: 4px 2px; cursor: pointer; text-decoration: none; }
.tsd-main { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.tsd-empty, .tsd-hint { padding: 22px 12px; text-align: center; color: var(--mut); }
.tsd-hint { background: var(--prim-soft); color: var(--prim); border-radius: 10px; font-weight: 600; padding: 12px; }
.tsd-banner { padding: 10px 12px; font-size: 14px; }
.tsd-banner--error { background: var(--loss-soft); color: #b91c1c; }

.tsd-tabs { display: flex; background: var(--surf); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tsd-tabs a { flex: 1; text-align: center; padding: 10px 4px; color: var(--mut); text-decoration: none; font-size: 14px; border-bottom: 3px solid transparent; }
.tsd-tabs a.is-on { color: var(--color-text, #1e2330); font-weight: 700; border-bottom-color: var(--prim); }

.tsd-card { display: block; background: var(--surf); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: inherit; text-decoration: none; }
a.tsd-card:active { background: var(--prim-soft); }
.tsd-card--ok { border-color: var(--ok); background: var(--ok-soft); }
.tsd-card__head { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.tsd-card__head b { margin-right: auto; }
.tsd-card__title { margin-top: 2px; }
.tsd-card__meta { color: var(--mut); font-size: 13.5px; margin-top: 3px; }
.tsd-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tsd-chip--to_pick { background: var(--prim-soft); color: var(--prim); }
.tsd-chip--in_work { background: var(--warn-soft); color: var(--warn); }
.tsd-chip--picked { background: var(--ok-soft); color: var(--ok); }
.tsd-chip--closed { background: var(--color-text, #1e2330); color: #fff; }
.tsd-chip--diff { background: var(--loss-soft); color: var(--loss); }
.tsd-prog { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tsd-bar { flex: 1; height: 7px; border-radius: 99px; background: var(--color-bg, #f0f2f7); overflow: hidden; }
.tsd-bar span { display: block; height: 100%; background: var(--prim); }

.tsd-list { background: var(--surf); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tsd-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); font-weight: 700; margin: 4px 2px 0; display: block; }
.tsd-line { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tsd-line:last-child { border-bottom: 0; }
.tsd-line__bc { font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; }
.tsd-line__q { grid-row: span 2; align-self: center; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.tsd-line__note { color: var(--mut); font-size: 12.5px; }
.tsd-line--done { background: var(--ok-soft); } .tsd-line--done .tsd-line__q { color: var(--ok); }
.tsd-line--part { background: var(--warn-soft); } .tsd-line--part .tsd-line__q { color: var(--warn); }
.tsd-line--over { background: var(--loss-soft); } .tsd-line--over .tsd-line__q { color: var(--loss); }

.tsd-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tsd-boxes form { margin: 0; }
.tsd-tile { width: 100%; min-height: 76px; border: 1px solid var(--line); background: var(--surf); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; color: inherit; cursor: pointer; }
.tsd-tile b { font-size: 26px; line-height: 1.1; }
.tsd-tile small { color: var(--mut); font-size: 12px; }
.tsd-tile.is-open { border: 2px solid var(--prim); background: var(--prim-soft); }
.tsd-tile.is-empty b { color: var(--mut); }
.tsd-tile--add { border: 2px dashed var(--prim); background: transparent; color: var(--prim); }
.tsd-tile--add small { color: var(--prim); }
.tsd-tile:active { transform: scale(.97); }

.tsd-scanbox { display: flex; align-items: center; gap: 8px; background: var(--surf); border: 2px solid var(--prim); border-radius: 10px; padding: 4px 4px 4px 12px; }
.tsd-scanbox__input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; padding: 8px 0; background: transparent; color: inherit; }
.tsd-hidden-scan { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.tsd-flash { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.tsd-flash.is-pulse { animation: tsd-pulse .5s ease-out; }
@keyframes tsd-pulse { from { background: #bbf7d0; } to { background: var(--ok-soft); } }
.tsd-rows-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--mut); padding: 0 4px 4px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tsd-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px 10px 6px; background: var(--surf); border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tsd-row:last-child { border-bottom: 0; }
.tsd-row__in { font-size: 24px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.tsd-row__in.is-zero { color: #c3c7d1; }
.tsd-row__bc { font-family: ui-monospace, Menlo, monospace; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.tsd-row__tot { text-align: right; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tsd-row__tot small { display: block; font-weight: 400; color: var(--mut); font-size: 11.5px; }
.tsd-row--done .tsd-row__tot { color: var(--ok); }
.tsd-row--over .tsd-row__tot { color: var(--loss); }
.tsd-row.is-hl { background: var(--prim-soft); }
.tsd-row--fold { display: block; text-align: center; color: var(--mut); font-size: 13px; cursor: default; padding: 10px; }

.tsd-foot { position: sticky; bottom: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surf); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.tsd-foot form { margin: 0; }
.tsd-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tsd-btn { display: block; width: 100%; text-align: center; font: 700 16px/1.2 var(--font-family, inherit); padding: 14px 10px; border-radius: 10px; border: 1px solid var(--prim); background: var(--prim); color: #fff; text-decoration: none; cursor: pointer; }
.tsd-btn--light { background: var(--surf); color: var(--color-text, #1e2330); border-color: var(--line); font-weight: 600; }
.tsd-btn--ok { background: var(--ok); border-color: var(--ok); }
.tsd-btn--warn { background: var(--warn); border-color: var(--warn); }
.tsd-btn:active { filter: brightness(.92); }
.tsd-textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; font-size: 15px; background: var(--surf); color: inherit; }
.tsd-mono { font-family: ui-monospace, Menlo, monospace; }

/* Окно правки количества (Т6б) */
.tsd-sheet-dim { position: fixed; inset: 0; z-index: 30; background: rgba(15, 20, 35, .4); display: flex; align-items: flex-end; }
.tsd-sheet-dim[hidden] { display: none; }
.tsd-sheet { width: 100%; background: var(--surf); border-radius: 14px 14px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; }
.tsd-sheet__label { color: var(--mut); font-size: 13.5px; }
.tsd-ctl { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.tsd-ctl__pm { height: 56px; border-radius: 10px; border: 1px solid var(--line); background: var(--color-bg, #f0f2f7); font: 700 28px/1 var(--font-family, inherit); color: inherit; cursor: pointer; }
.tsd-ctl__val { height: 56px; border: 2px solid var(--prim); border-radius: 10px; text-align: center; font-size: 26px; font-weight: 800; width: 100%; background: var(--surf); color: inherit; }

/* Экраны ошибки и подтверждения (Т8, Т9) */
.tsd-alert { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 24px 18px; text-align: center; }
.tsd-alert[hidden] { display: none; }
.tsd-alert--error { background: var(--loss); color: #fff; }
.tsd-alert--warn { background: var(--warn-soft); color: var(--color-text, #1e2330); border: 4px solid var(--warn); }
.tsd-alert__big { font-size: 28px; font-weight: 800; line-height: 1.15; }
.tsd-alert__code { font-family: ui-monospace, Menlo, monospace; font-size: 16px; opacity: .9; word-break: break-all; }
.tsd-alert__text { font-size: 17px; max-width: 30ch; }
.tsd-alert .tsd-btn { max-width: 320px; }
.tsd-alert--error .tsd-btn--light { background: #fff; color: var(--loss); border-color: #fff; }

/* Сообщения */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; border: 1px solid transparent; }
.alert--error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
