/* RaboTeb ERP — the modern layer over Vuexy.
   Loaded last: softer surfaces, rounder corners, layered shadows and a little motion across every page, plus the
   panel's new pieces (popup, wizard, drag-and-drop photo, barcode field, product picker, approval timeline,
   approval inbox, product gallery). Colours come from the logo's green; tones mark kinds of documents. */

:root {
    --ui-green: #208d44;
    --ui-green-2: #12b886;
    --ui-grad: linear-gradient(135deg, #1f9a4c 0%, #12b886 100%);
    --ui-ink: #1d2b24;
    --ui-ink-2: #4b5a52;
    --ui-mute: #8a968f;
    --ui-line: #e6ebe8;
    --ui-bg: #f4f7f5;
    --ui-card: #ffffff;
    --ui-r: 14px;
    --ui-r-sm: 10px;
    --ui-sh-1: 0 1px 2px rgba(16, 40, 28, .05), 0 1px 3px rgba(16, 40, 28, .06);
    --ui-sh-2: 0 4px 12px -2px rgba(16, 40, 28, .08), 0 2px 4px -2px rgba(16, 40, 28, .05);
    --ui-sh-3: 0 24px 48px -12px rgba(16, 40, 28, .25);
    --ui-ease: cubic-bezier(.2, .8, .2, 1);
    --tone-primary: #208d44; --tone-success: #16a34a; --tone-danger: #e5484d; --tone-warning: #f59e0b; --tone-info: #0ea5e9;
    --tone-indigo: #6366f1; --tone-amber: #f59e0b; --tone-green: #16a34a; --tone-cyan: #06b6d4; --tone-pink: #ec4899; --tone-violet: #8b5cf6; --tone-slate: #64748b;
}
.tone-primary { --t: var(--tone-primary); } .tone-success { --t: var(--tone-success); } .tone-danger { --t: var(--tone-danger); }
.tone-warning { --t: var(--tone-warning); } .tone-info { --t: var(--tone-info); } .tone-indigo { --t: var(--tone-indigo); }
.tone-amber { --t: var(--tone-amber); } .tone-green { --t: var(--tone-green); } .tone-cyan { --t: var(--tone-cyan); }
.tone-pink { --t: var(--tone-pink); } .tone-violet { --t: var(--tone-violet); } .tone-slate { --t: var(--tone-slate); }

/* ── Shell ─────────────────────────────────────────────── */
body {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(18, 184, 134, .07), transparent 60%),
        radial-gradient(900px 500px at -10% 0%, rgba(32, 141, 68, .06), transparent 55%),
        var(--ui-bg);
    background-attachment: fixed;
}
.layout-navbar.navbar-detached {
    background: rgba(255, 255, 255, .82) !important;
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: var(--ui-sh-2) !important;
    border-radius: var(--ui-r) !important;
}
.layout-menu.menu-vertical { box-shadow: 0 0 0 1px var(--ui-line), var(--ui-sh-2) !important; }
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link,
.bg-menu-theme .menu-inner > .menu-item > .menu-link.active {
    background: var(--ui-grad) !important;
    box-shadow: 0 6px 16px -6px rgba(32, 141, 68, .55) !important;
    border-radius: var(--ui-r-sm);
}
.bg-menu-theme .menu-link { border-radius: var(--ui-r-sm); transition: background-color .15s, transform .15s var(--ui-ease); }
.bg-menu-theme .menu-inner > .menu-item > .menu-link:hover { transform: translateX(-2px); }
.menu-header .menu-header-text { letter-spacing: 0; font-weight: 600; color: var(--ui-mute); }

/* Each page eases in. */
/* backwards, not both: once in, nothing keeps a transform (it would trap the fixed popups and toasts inside). */
.content-wrapper > .container-xxl > *:not(.mx-layer):not(.apx-toast) { animation: ui-rise .38s var(--ui-ease) backwards; }
.content-wrapper > .container-xxl > *:nth-child(2) { animation-delay: .03s; }
.content-wrapper > .container-xxl > *:nth-child(3) { animation-delay: .06s; }
.content-wrapper > .container-xxl > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes ui-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Page header ───────────────────────────────────────── */
.action-bar h4 { font-weight: 800; color: var(--ui-ink); font-size: 1.35rem; letter-spacing: -.01em; }
.action-bar .text-muted { color: var(--ui-mute) !important; max-width: 70ch; font-size: .875rem; }
.action-bar-buttons .btn { white-space: nowrap; }

/* ── Building blocks ───────────────────────────────────── */
.card { border-radius: var(--ui-r); border: 1px solid var(--ui-line); box-shadow: var(--ui-sh-1); }
.card:has(> .card-body > .table), .card:has(> .table-responsive) { overflow: hidden; }
/* Document lines (product picker, quantities, batch, cost) can be wider than a phone or a narrow pane: they scroll inside their card. */
:is(.card, .card-body, .sheet):has(> table.lines) { overflow-x: auto; }
.btn { border-radius: var(--ui-r-sm); font-weight: 600; transition: transform .12s var(--ui-ease), box-shadow .15s, background-color .15s, color .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary { background: var(--ui-grad); border: 0; box-shadow: 0 6px 14px -6px rgba(32, 141, 68, .6); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 20px -8px rgba(32, 141, 68, .7); filter: brightness(1.04); }
.btn-success { box-shadow: 0 6px 14px -6px rgba(22, 163, 74, .55); }
.btn-icon { border-radius: var(--ui-r-sm); }
.form-control, .form-select { border-radius: var(--ui-r-sm); border-color: #dde3df; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.form-control:hover:not(:disabled), .form-select:hover:not(:disabled) { border-color: #c5cfc9; }
.form-control:focus, .form-select:focus { border-color: var(--ui-green); box-shadow: 0 0 0 4px rgba(32, 141, 68, .14); }
.form-control-lg { font-size: 1.05rem; border-radius: 12px; }
.input-group > .form-control, .input-group > .btn, .input-group > .input-group-text { border-radius: 0; }
.input-group > :first-child { border-start-start-radius: var(--ui-r-sm) !important; border-end-start-radius: var(--ui-r-sm) !important; }
.input-group > :last-child { border-start-end-radius: var(--ui-r-sm) !important; border-end-end-radius: var(--ui-r-sm) !important; }
.alert { border-radius: var(--ui-r-sm); border: 0; }
.badge { border-radius: 999px; font-weight: 600; }
.table > thead th { background: #f7faf8; color: var(--ui-ink-2); font-weight: 700; font-size: .78rem; border-bottom-color: var(--ui-line); }
.table-hover > tbody > tr:hover > * { background-color: rgba(32, 141, 68, .035); }
.form-check-input:checked { background-color: var(--ui-green); border-color: var(--ui-green); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(32, 141, 68, .14); }

/* Status steps on documents: a progress line under round steps. */
.status-steps-card .status-flow li .step-icon { border-radius: 999px; width: 2.1rem; height: 2.1rem; transition: transform .2s var(--ui-ease); }
.status-steps-card .status-flow li.current .step-icon { background: var(--ui-grad); box-shadow: 0 0 0 5px rgba(32, 141, 68, .14); transform: scale(1.06); }
.status-steps-card .status-flow li + li::before { width: 3rem; height: 3px; }
.status-steps-card .status-flow li.current.off-path .step-icon { background: var(--bs-danger); box-shadow: 0 0 0 5px rgba(229, 72, 77, .15); }

/* Kanban lists. */
.kanban-column { background: rgba(255, 255, 255, .6); border: 1px solid var(--ui-line); border-radius: var(--ui-r); }
.kanban-card { border-radius: 12px; border: 1px solid var(--ui-line); box-shadow: var(--ui-sh-1); transition: transform .15s var(--ui-ease), box-shadow .15s; }
.kanban-card:hover, .kanban-card:focus { transform: translateY(-2px); box-shadow: var(--ui-sh-2); }

/* ── Popup ─────────────────────────────────────────────── */
html.mx-locked, html.mx-locked body { overflow: hidden; }
.mx-layer { position: fixed; inset: 0; z-index: 1900; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
/* No backdrop blur: in RTL Chromium can paint a mirrored copy of the page behind a blurred layer. */
.mx-backdrop { position: absolute; inset: 0; background: rgba(13, 28, 20, .52); animation: mx-fade .2s ease both; }
.mx-dialog {
    position: relative; display: flex; flex-direction: column; width: 100%; max-height: min(92vh, 900px);
    background: var(--ui-card); border-radius: 20px; box-shadow: var(--ui-sh-3); outline: 0; overflow: hidden;
    animation: mx-pop .28s var(--ui-ease) both;
}
.mx-sm { max-width: 460px; } .mx-md { max-width: 640px; } .mx-lg { max-width: 920px; } .mx-xl { max-width: 1180px; }
.mx-head { display: flex; align-items: center; gap: .85rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--ui-line); }
.mx-icon { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem;
           color: var(--t, var(--tone-primary)); background: color-mix(in srgb, var(--t, var(--tone-primary)) 13%, #fff); }
.mx-titles { min-width: 0; flex: 1; }
.mx-titles h2 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--ui-ink); }
.mx-titles p { margin: .1rem 0 0; color: var(--ui-mute); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-close { flex: none; width: 38px; height: 38px; border: 0; border-radius: 11px; background: #f2f5f3; color: var(--ui-ink-2); font-size: 1.15rem; display: grid; place-items: center; transition: background .15s, transform .15s; }
.mx-close:hover:not(:disabled) { background: #e7ece9; transform: rotate(90deg); }
.mx-body { padding: 1.35rem; overflow: auto; overscroll-behavior: contain; }
.mx-flush .mx-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mx-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.35rem; border-top: 1px solid var(--ui-line); background: #fafcfb; }
@keyframes mx-fade { from { opacity: 0; } }
@keyframes mx-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes mx-sheet { from { transform: translateY(100%); } }

/* ── Wizard ────────────────────────────────────────────── */
.wz { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.wz-track { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 1rem 1.35rem .6rem; overflow-x: auto; scrollbar-width: none; }
.wz-track::-webkit-scrollbar { display: none; }
.wz-track li { flex: 1 1 0; min-width: max-content; }
.wz-track button { width: 100%; display: flex; align-items: center; gap: .6rem; border: 0; background: none; padding: .45rem .5rem; border-radius: 12px; text-align: start; color: var(--ui-mute); transition: background .15s; }
.wz-track button:not(:disabled):hover { background: #f3f7f5; }
.wz-track button:disabled { cursor: default; }
.wz-dot { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1rem;
          background: #eef2f0; color: var(--ui-mute); transition: all .25s var(--ui-ease); }
.wz-label { display: flex; flex-direction: column; font-weight: 700; font-size: .86rem; line-height: 1.3; }
.wz-label small { font-weight: 400; font-size: .72rem; color: var(--ui-mute); }
.wz-track li.is-done .wz-dot { background: color-mix(in srgb, var(--ui-green) 14%, #fff); color: var(--ui-green); }
.wz-track li.is-done .wz-label { color: var(--ui-ink-2); }
.wz-track li.is-current .wz-dot { background: var(--ui-grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(32, 141, 68, .8); transform: scale(1.06); }
.wz-track li.is-current .wz-label { color: var(--ui-ink); }
.wz-bar { height: 3px; margin: 0 1.35rem; background: #edf1ef; border-radius: 3px; overflow: hidden; }
.wz-bar span { display: block; height: 100%; width: calc(var(--wz-done, 0) * 100%); background: var(--ui-grad); border-radius: 3px; transition: width .4s var(--ui-ease); }
.wz-panel { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 1.35rem; }
.wz-step { animation: wz-in .3s var(--ui-ease) both; }
@keyframes wz-in { from { opacity: 0; transform: translateX(-14px); } }
.wz-foot { display: flex; align-items: center; gap: .5rem; padding: .85rem 1.35rem; border-top: 1px solid var(--ui-line); background: #fafcfb; flex-wrap: wrap; }
.wz-spacer { flex: 1; }
.wz-count { color: var(--ui-mute); font-size: .78rem; }
.wz-finish { min-width: 9rem; }

/* ── Drag-and-drop photo ───────────────────────────────── */
.imgdrop { position: relative; border: 2px dashed #cfd9d3; border-radius: 16px; background: #fafcfb; min-height: 230px; display: grid; place-items: center;
           overflow: hidden; transition: border-color .2s, background .2s, transform .2s var(--ui-ease); }
.imgdrop:hover { border-color: var(--ui-green); background: #f4faf6; }
.imgdrop.is-over { border-color: var(--ui-green); background: #ecf8f0; transform: scale(1.015); box-shadow: 0 0 0 6px rgba(32, 141, 68, .1); }
.imgdrop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.imgdrop-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: 1.5rem; color: var(--ui-mute); pointer-events: none; }
.imgdrop-empty strong { color: var(--ui-ink); font-size: .95rem; }
.imgdrop-empty small { font-size: .72rem; }
.imgdrop-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--ui-grad);
               box-shadow: 0 12px 24px -10px rgba(32, 141, 68, .7); margin-bottom: .4rem; animation: ui-float 3s ease-in-out infinite; }
.imgdrop.is-over .imgdrop-art { animation: ui-bounce .6s ease infinite; }
@keyframes ui-float { 50% { transform: translateY(-5px); } }
@keyframes ui-bounce { 50% { transform: translateY(-8px) scale(1.06); } }
.imgdrop.has-image img { width: 100%; height: 100%; max-height: 320px; object-fit: contain; background: #fff; }
.imgdrop-actions { position: absolute; inset-inline: .6rem; bottom: .6rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; z-index: 2; pointer-events: none; }
.imgdrop-chip { background: rgba(13, 28, 20, .7); color: #fff; font-size: .72rem; padding: .3rem .6rem; border-radius: 999px; }
.imgdrop-remove { pointer-events: auto; border-radius: 10px; }
.imgdrop-progress { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .8); z-index: 3; color: var(--ui-green); font-weight: 700; gap: .4rem; }
.imgdrop-camera.btn { display: none; }
@media (pointer: coarse) and (max-width: 991.98px) { .imgdrop-camera.btn { display: inline-flex; } }

/* ── Product photos (several, main first) ──────────────── */
.pgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .75rem; }
.pgal-item { position: relative; margin: 0; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #e3ebe6; }
.pgal-item.is-main { grid-column: span 2; grid-row: span 2; border: 2px solid var(--ui-green); }
.pgal-item img { width: 100%; height: 100%; object-fit: contain; }
.pgal-badge { position: absolute; top: .45rem; inset-inline-start: .45rem; background: var(--ui-green); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.pgal-tools { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: center; gap: .25rem; padding: .35rem; background: linear-gradient(transparent, rgba(13, 28, 20, .65)); }
.pgal-tools .btn { color: #fff; background: rgba(255, 255, 255, .16); border-radius: 9px; }
.pgal-tools .btn:hover, .pgal-tools .btn:focus-visible { background: rgba(255, 255, 255, .32); color: #fff; }
.pgal-tools .pgal-remove:hover { background: #d63c3c; }
.pgal-add { position: relative; aspect-ratio: 1; border: 2px dashed #cfd9d3; border-radius: 14px; background: #fafcfb; display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: .25rem; text-align: center; padding: .6rem; color: var(--ui-mute); overflow: hidden; transition: border-color .2s, background .2s; }
.pgal-add:hover, .pgal-add.is-over { border-color: var(--ui-green); background: #ecf8f0; }
.pgal-add.is-first { grid-column: 1 / -1; aspect-ratio: auto; min-height: 220px; }
.pgal-add strong { color: var(--ui-ink); font-size: .85rem; }
.pgal-add small { font-size: .7rem; }
.pgal-add .imgdrop-art { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 16px; margin-bottom: .2rem; }
.pgal-add:not(.is-first) .imgdrop-art { animation: none; }

/* ── Store product manager ─────────────────────────────── */
.sp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.sp-kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; text-align: start;
          border: 1px solid #e3ebe6; background: #fff; border-radius: 16px; padding: .8rem 1rem; transition: transform .15s var(--ui-ease), box-shadow .15s; }
.sp-kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(13, 28, 20, .45); }
.sp-kpi.is-ghost { min-height: 74px; background: linear-gradient(90deg, #f3f6f4, #fafcfb, #f3f6f4); background-size: 200% 100%; animation: ui-shimmer 1.4s linear infinite; }
.sp-kpi i { grid-row: span 2; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; }
.sp-kpi span { font-size: .78rem; color: var(--ui-mute); }
.sp-kpi strong { font-size: 1.35rem; line-height: 1.2; }
.sp-kpi.is-on { border-color: var(--ui-green); box-shadow: 0 0 0 3px rgba(32, 141, 68, .12); }
.sp-kpi.tone-ok i { background: #e7f6ec; color: var(--ui-green); }
.sp-kpi.tone-mute i { background: #eef1ef; color: #6b7a72; }
.sp-kpi.tone-hot i { background: #fdeceb; color: #d63c3c; }
.sp-kpi.tone-warn i { background: #fff4e0; color: #c77700; }
.sp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.sp-toolbar .pg-search { flex: 1 1 220px; }
.sp-catfilter { max-width: 240px; }
.sp-view { margin-inline-start: auto; }
.sp-bulk { position: sticky; top: .5rem; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .55rem .8rem; margin-bottom: .75rem;
           border-radius: 14px; background: #f6faf7; border: 1px dashed #cfd9d3; font-size: .85rem; }
.sp-bulk.is-on { background: #fff; border: 1px solid var(--ui-green); box-shadow: 0 12px 30px -20px rgba(13, 28, 20, .5); }
.sp-bulk .dropdown-like { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.sp-check { width: 2.25rem; }
.sp-name { display: flex; flex-direction: column; min-width: 0; }
.sp-name small { color: var(--ui-mute); font-size: .75rem; }
.sp-money { max-width: 150px; text-align: left; }
.sp-window { display: block; font-size: .68rem; color: var(--ui-mute); margin-top: .15rem; }
.sp-excel { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.25rem 0 .75rem; }
tr.imx-unchanged { color: var(--ui-mute); }
tr.imx-updated small { white-space: normal; min-width: 260px; }
tr.sp-dirty > td { background: #fffbea !important; }
.sp-complete { display: inline-block; width: 64px; height: 6px; border-radius: 999px; background: #e7ece9; overflow: hidden; vertical-align: middle; }
.sp-complete span { display: block; height: 100%; width: calc(var(--p) * 1%); background: linear-gradient(90deg, #f0a43a, var(--ui-green)); }
.ptag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.ptag s { color: var(--ui-mute); font-size: .8em; }
.ptag strong { font-weight: 700; }
.ptag-off { background: #d63c3c; color: #fff; border-radius: 6px; padding: 0 .35rem; font-size: .72rem; }
.ptag-label { color: #d63c3c; font-size: .7rem; }
.ptag.is-lg strong { font-size: 1.35rem; color: var(--ui-green); }
.ptag.is-lg .ptag-off { font-size: .85rem; }
.ptag-unit { color: var(--ui-mute); font-size: .75rem; }
.sp-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.sp-tabs { display: flex; gap: .25rem; border-bottom: 1px solid #e3ebe6; margin-bottom: 1rem; overflow-x: auto; }
.sp-tabs button { border: 0; background: none; padding: .55rem .9rem; border-bottom: 2px solid transparent; color: var(--ui-ink-2); white-space: nowrap; }
.sp-tabs button.is-on { border-bottom-color: var(--ui-green); color: var(--ui-green); font-weight: 600; }
.sp-pricebox { border: 1px solid #e3ebe6; border-radius: 14px; padding: .85rem 1rem; margin-bottom: .75rem; background: #fff; }
.sp-deal.is-on.tone-hot { border-color: #f1b7b3; background: #fffafa; }
.sp-deal.is-on.tone-warn { border-color: #f5d39b; background: #fffdf7; }
.sp-warn { display: flex; gap: .4rem; align-items: center; margin-top: .5rem; padding: .45rem .7rem; border-radius: 10px; background: #fff4e0; color: #8a5300; font-size: .82rem; }
.sp-mode .btn { min-width: 7rem; }
.sp-today { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: 14px; background: #f1f9f4; }
.sp-publish { padding: .8rem 1rem; border: 1px solid #e3ebe6; border-radius: 14px; }
.sp-override summary { cursor: pointer; font-weight: 600; }
.sp-own-image { width: 220px; }
.sp-preview { position: sticky; top: 0; border: 1px solid #e3ebe6; border-radius: 16px; padding: .85rem; background: #fafcfb; }
.sp-preview-head { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ui-mute); margin-bottom: .6rem; }
.sp-tile { background: #fff; border-radius: 14px; padding: .6rem; box-shadow: 0 10px 24px -18px rgba(13, 28, 20, .5); display: flex; flex-direction: column; gap: .4rem; }
.sp-tile.is-hidden { opacity: .55; }
.sp-tile-img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f3f6f4; display: grid; place-items: center; color: #b6c4bc; font-size: 2rem; }
.sp-tile-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sp-tile-off { position: absolute; top: .4rem; inset-inline-start: .4rem; background: #d63c3c; color: #fff; border-radius: 8px; padding: .1rem .45rem; font-size: .78rem; font-style: normal; }
.sp-tile-label { position: absolute; bottom: .4rem; inset-inline-end: .4rem; background: rgba(255, 255, 255, .92); color: #d63c3c; border-radius: 8px; padding: .05rem .45rem; font-size: .7rem; font-style: normal; }
.sp-tile strong { font-size: .9rem; }
.sp-preview-thumbs { display: flex; gap: .3rem; margin-top: .5rem; overflow-x: auto; }
.sp-preview-thumbs img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid #e3ebe6; }
.sp-preview-checks { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; }
.sp-preview-checks .ok { color: var(--ui-green); }
.sp-preview-checks .warn { color: #c77700; }
@media (max-width: 991.98px) {
    .sp-editor { grid-template-columns: 1fr; }
    .sp-preview { position: static; }
    .sp-view { margin-inline-start: 0; }
}

/* ── Category on product cards, filters and forms ──────── */
.pg-catpath { font-size: .72rem; color: var(--ui-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: -.15rem 0 .3rem; }
.pg-catfilter { max-width: 230px; }
.pg-catpick { max-width: 360px; flex: 1 1 240px; }

/* ── Category tree editor ──────────────────────────────── */
.ctree-card { background: #fff; border: 1px solid #e3ebe6; border-radius: 18px; padding: 1rem 1.1rem 1.1rem; box-shadow: 0 10px 30px -22px rgba(13, 28, 20, .35); }
.ctree-card.is-ghost { min-height: 320px; background: linear-gradient(90deg, #f3f6f4, #fafcfb, #f3f6f4); background-size: 200% 100%; animation: ui-shimmer 1.4s linear infinite; }
@keyframes ui-shimmer { to { background-position: -200% 0; } }
.ctree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.ctree-tools .pg-search { flex: 1 1 260px; }
.ctree-stats { margin-inline-start: auto; color: var(--ui-mute); font-size: .8rem; }
.ctree { list-style: none; margin: 0; padding: 0; }
.ctree-row { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem .35rem .35rem; padding-inline-start: calc(.35rem + var(--d, 0) * 1.6rem);
             border-radius: 10px; border: 1px dashed transparent; position: relative; }
.ctree-row::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: calc(.95rem + (var(--d, 0) - 1) * 1.6rem); border-inline-start: 1px solid #e3ebe6; display: var(--line, block); }
.ctree-row[style*="--d:0"]::before { display: none; }
.ctree-row:hover { background: #f6faf7; }
.ctree-row.is-hit { background: #fff8e1; }
.ctree-row.is-drop { border-color: var(--ui-green); background: #ecf8f0; }
.ctree-row.is-drag { opacity: .45; }
.ctree-caret { border: 0; background: none; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 8px; color: var(--ui-ink-2); }
.ctree-caret:disabled { color: #c4d0c9; }
.ctree-caret:not(:disabled):hover { background: #e9f3ed; }
.ctree-grip { color: #b6c4bc; cursor: grab; }
.ctree-name { display: flex; align-items: baseline; gap: .45rem; min-width: 0; flex: 1 1 auto; }
.ctree-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctree-name small { color: var(--ui-mute); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctree-ico { color: var(--ui-green); align-self: center; }
.ctree-count { font-size: .75rem; color: var(--ui-ink-2); background: #f1f5f2; border-radius: 999px; padding: .1rem .55rem; white-space: nowrap; }
.ctree-acts { display: flex; gap: .2rem; opacity: .35; transition: opacity .15s; }
.ctree-row:hover .ctree-acts, .ctree-row:focus-within .ctree-acts { opacity: 1; }
.ctree-form { flex: 1; padding-inline-start: calc(var(--d, 0) * 1.6rem); }
.ctree-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ctree-edit input:first-child { flex: 1 1 200px; }
.ctree-edit input[dir="ltr"] { flex: 0 1 180px; }
.ctree-root-drop { margin-top: .6rem; border: 2px dashed #cfd9d3; border-radius: 12px; padding: .7rem; text-align: center; color: var(--ui-mute); }
.ctree-root-drop.is-drop { border-color: var(--ui-green); background: #ecf8f0; color: var(--ui-green); }
@media (hover: none) { .ctree-acts { opacity: 1; } }
@media (max-width: 767.98px) {
    .ctree-row { flex-wrap: wrap; }
    .ctree-acts { width: 100%; justify-content: flex-end; }
    .ctree-grip { display: none; }
}

/* ── Product specifications (label / value rows) ───────── */
.pg-specs { display: flex; flex-direction: column; gap: .4rem; }
.pg-spec-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: .4rem; align-items: center; }
.pg-spec-row .btn-group .btn { padding-inline: .45rem; }
.pg-spec-hints { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.pg-spec-hints button { border: 1px dashed #cfd9d3; background: #fff; color: var(--ui-ink-2); border-radius: 999px; font-size: .75rem; padding: .2rem .65rem; }
.pg-spec-hints button:hover { border-color: var(--ui-green); color: var(--ui-green); }
@media (max-width: 575.98px) {
    .pgal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pg-spec-row { grid-template-columns: minmax(0, 1fr) auto; }
    .pg-spec-row > :nth-child(2) { grid-column: 1; grid-row: 2; }
}

/* ── Barcode field ─────────────────────────────────────── */
.bcf-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; }
.bcf-input::placeholder { font-family: inherit; letter-spacing: 0; }
.bcf-preview { margin: .75rem 0 0; padding: .8rem 1rem .55rem; background: #fff; border: 1px solid var(--ui-line); border-radius: 14px; text-align: center; box-shadow: var(--ui-sh-1); animation: ui-rise .3s var(--ui-ease) both; }
.bcf-bars { display: block; height: 64px; }
.bcf-bars svg { width: 100%; height: 100%; }
.bcf-preview figcaption { font-family: ui-monospace, Consolas, monospace; letter-spacing: .35em; font-size: .85rem; color: var(--ui-ink); margin-top: .35rem; }
.bcf-cam { position: relative; margin-top: .75rem; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-height: 280px; }
.bcf-cam video { width: 100%; height: 100%; object-fit: cover; }
.bcf-laser { position: absolute; inset-inline: 12%; top: 50%; height: 2px; background: #ff3b3b; box-shadow: 0 0 12px 2px rgba(255, 59, 59, .8); animation: bcf-scan 1.6s ease-in-out infinite; }
.bcf-cam-hint { position: absolute; bottom: .6rem; inset-inline: 0; text-align: center; color: #fff; font-size: .75rem; text-shadow: 0 1px 3px #000; }
@keyframes bcf-scan { 0%, 100% { transform: translateY(-50px); } 50% { transform: translateY(50px); } }

/* ── Product picker (document lines) ───────────────────── */
.pp-field { display: flex; align-items: center; gap: .6rem; width: 100%; min-width: 220px; padding: .35rem .6rem; border: 1px solid #dde3df; border-radius: var(--ui-r-sm);
            background: #fff; text-align: start; transition: border-color .15s, box-shadow .15s; }
.pp-field:hover:not(:disabled) { border-color: var(--ui-green); }
.pp-field:focus-visible { outline: 0; border-color: var(--ui-green); box-shadow: 0 0 0 4px rgba(32, 141, 68, .14); }
.pp-field:disabled { background: #f8faf9; }
.pp-field.is-empty .pp-text b { color: var(--ui-mute); font-weight: 600; }
.pp-thumb { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #f3f6f4; border: 1px solid var(--ui-line); }
.pp-ghost { display: grid; place-items: center; color: var(--ui-mute); font-size: 1.1rem; }
.pp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; flex: 1; }
.pp-text b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-ink); }
.pp-text small { color: var(--ui-mute); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.pp-caret { color: var(--ui-mute); }
.pp-search { position: relative; }
.pp-search > i { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--ui-green); pointer-events: none; }
.pp-search input { padding-inline-start: 2.8rem; }
.pp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; margin-top: 1rem; }
.pp-item { display: flex; align-items: center; gap: .7rem; padding: .6rem; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; text-align: start;
           transition: border-color .15s, transform .15s var(--ui-ease), box-shadow .15s; }
.pp-item:hover, .pp-item:focus-visible { border-color: var(--ui-green); transform: translateY(-1px); box-shadow: var(--ui-sh-2); outline: 0; }
.pp-item.is-on { border-color: var(--ui-green); background: #f1faf4; }
.pp-item .pp-thumb { width: 48px; height: 48px; }
.pp-stock { flex: none; font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; background: #e8f6ed; color: #16803c; }
.pp-stock.low { background: #fff4e0; color: #b45309; } .pp-stock.out { background: #fde8e8; color: #c81e1e; }
.pp-none { grid-column: 1 / -1; text-align: center; color: var(--ui-mute); padding: 2rem 0; }

/* Scan to add (stock moves) and the photos on the picking sheet. */
.scan-add { position: relative; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; padding: .6rem .75rem; border-radius: 12px;
            background: linear-gradient(135deg, #f1faf4, #ecfbf6); border: 1px dashed #b6dcc4; }
.scan-add > i { font-size: 1.5rem; color: var(--ui-green); }
.scan-add input { flex: 1; min-width: 220px; max-width: 420px; background: #fff; }
.scan-add-note { font-size: .82rem; font-weight: 700; animation: ui-rise .25s var(--ui-ease) both; }
.scan-add-note.ok { color: #16803c; } .scan-add-note.bad { color: #c81e1e; }
.pick-name { display: flex; align-items: center; gap: .6rem; }
.pick-thumb { flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1px solid var(--ui-line); background: #fff; }
.pick-thumb.ghost { display: grid; place-items: center; color: var(--ui-mute); background: #f3f6f4; font-size: 1.3rem; }
@media print { .pick-thumb { width: 36px; height: 36px; } }

/* ── Approval timeline (beside every document) ─────────── */
.apv { --c: var(--ui-green); border: 1px solid var(--ui-line); border-radius: var(--ui-r); padding: 1rem; background: #fff; box-shadow: var(--ui-sh-1); }
.apv-rejected { --c: var(--tone-danger); } .apv-cancelled { --c: var(--tone-slate); } .apv-running { --c: var(--tone-warning); }
.apv-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.apv-status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-size: .86rem; color: var(--c);
              background: color-mix(in srgb, var(--c) 11%, #fff); padding: .3rem .7rem; border-radius: 999px; }
.apv-meter { display: inline-flex; gap: 4px; }
.apv-meter span { width: 18px; height: 6px; border-radius: 3px; background: #e5ebe7; }
.apv-meter .is-done { background: var(--ui-green); } .apv-meter .is-current { background: var(--tone-warning); animation: apv-pulse 1.6s ease-in-out infinite; }
.apv-meter .is-rejected { background: var(--tone-danger); }
.apv-sent { margin: .7rem 0 0; font-size: .78rem; color: var(--ui-mute); }
.apv-track { list-style: none; margin: .8rem 0 0; padding: 0; position: relative; }
.apv-node { position: relative; display: flex; gap: .75rem; padding-bottom: 1rem; }
.apv-node:last-child { padding-bottom: 0; }
.apv-node:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 15px; top: 34px; bottom: 2px; width: 2px; background: #e5ebe7; border-radius: 2px; }
.apv-node.is-done:not(:last-child)::before { background: var(--ui-green); }
.apv-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
           background: #eef2f0; color: var(--ui-mute); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ui-line); z-index: 1; }
.apv-node.is-done .apv-dot { background: var(--ui-green); color: #fff; box-shadow: none; }
.apv-node.is-current .apv-dot { background: var(--tone-warning); color: #fff; box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); animation: apv-ring 1.8s infinite; }
.apv-node.is-rejected .apv-dot { background: var(--tone-danger); color: #fff; box-shadow: none; }
.apv-node.is-off { opacity: .45; }
@keyframes apv-ring { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
@keyframes apv-pulse { 50% { opacity: .45; } }
.apv-body { min-width: 0; padding-top: .3rem; flex: 1; }
.apv-body > strong { display: block; color: var(--ui-ink); font-size: .9rem; }
.apv-wait { display: inline-block; margin-top: .2rem; font-size: .72rem; font-weight: 700; color: #b45309; background: #fff4e0; padding: .1rem .5rem; border-radius: 999px; }
.apv-sign { display: flex; align-items: center; gap: .45rem; margin-top: .35rem; font-size: .8rem; color: var(--ui-ink-2); }
.apv-sign small { color: var(--ui-mute); margin-inline-start: .25rem; }
.apv-sign.neg b { color: var(--tone-danger); }
.apv-avatar, .apx-avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; background: var(--ui-grad); }
.apv-comment { display: block; margin-top: .35rem; padding: .45rem .65rem; border-radius: 10px; background: #f6f8f7; font-size: .8rem; color: var(--ui-ink-2); quotes: "«" "»"; }
.apv-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.chatter .apv { margin-bottom: .25rem; }

/* ── Approval inbox ────────────────────────────────────── */
.apx-toast { position: fixed; z-index: 1950; bottom: 1.5rem; inset-inline-start: 50%; transform: translateX(50%); display: flex; align-items: center; gap: .5rem;
             background: #14281d; color: #fff; padding: .75rem 1.1rem; border-radius: 14px; box-shadow: var(--ui-sh-3); font-weight: 600; max-width: calc(100vw - 2rem);
             animation: apx-toast .35s var(--ui-ease) both; }
.apx-toast > i { color: #4ade80; font-size: 1.25rem; }
@keyframes apx-toast { from { opacity: 0; transform: translate(50%, 20px); } }
.apx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.apx-stat { display: flex; align-items: center; gap: .85rem; background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r); padding: 1rem; box-shadow: var(--ui-sh-1); }
.apx-stat > i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; color: var(--t); background: color-mix(in srgb, var(--t) 12%, #fff); flex: none; }
.apx-stat strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--ui-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.apx-stat span { font-size: .78rem; color: var(--ui-mute); }
.apx-filters, .pg-chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.apx-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink-2);
            padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600; transition: all .15s var(--ui-ease); }
.apx-chip b { font-size: .72rem; background: #eef2f0; color: var(--ui-ink-2); border-radius: 999px; padding: .05rem .45rem; min-width: 1.4rem; text-align: center; }
.apx-chip i { color: var(--t, var(--ui-green)); }
.apx-chip:hover { border-color: var(--t, var(--ui-green)); transform: translateY(-1px); }
.apx-chip.is-on { background: var(--t, var(--ui-green)); border-color: var(--t, var(--ui-green)); color: #fff; box-shadow: 0 6px 14px -8px var(--t, var(--ui-green)); }
.apx-chip.is-on i { color: #fff; } .apx-chip.is-on b { background: rgba(255, 255, 255, .25); color: #fff; }
.apx-chip.has-alert:not(.is-on) b { background: #fde8e8; color: #c81e1e; }
.apx-search { max-width: 320px; margin-inline-start: auto; border-radius: 999px; }
.apx-bulk { position: sticky; top: calc(var(--navbar-height, 64px) + 1.5rem); z-index: 5; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
            background: #14281d; color: #fff; padding: .55rem .75rem; border-radius: 14px; margin-bottom: 1rem; box-shadow: var(--ui-sh-2); animation: ui-rise .25s var(--ui-ease) both; }
.apx-bulk > span { margin-inline-end: auto; }
.apx-bulk .btn-link { color: #cfe; }
.apx-board { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.25rem; align-items: start; }
.apx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.apx-card { position: relative; display: flex; flex-direction: column; gap: .75rem; background: #fff; border: 1px solid var(--ui-line);
            border-radius: 16px; padding: 1rem; box-shadow: var(--ui-sh-1); cursor: grab; overflow: hidden;
            transition: transform .2s var(--ui-ease), box-shadow .2s, border-color .2s, opacity .3s; animation: ui-rise .35s var(--ui-ease) both; }
.apx-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--t, var(--tone-slate)); }
.apx-card:hover { transform: translateY(-3px); box-shadow: var(--ui-sh-2); border-color: color-mix(in srgb, var(--t, var(--tone-slate)) 40%, var(--ui-line)); }
.apx-card:active { cursor: grabbing; }
.apx-card.is-picked { border-color: var(--ui-green); box-shadow: 0 0 0 3px rgba(32, 141, 68, .18), var(--ui-sh-2); }
.apx-card.is-lifted { opacity: .45; transform: rotate(-1.5deg) scale(.98); }
.apx-card.is-leaving { opacity: 0; transform: translateX(-40px) scale(.9); }
.apx-card.is-ghost { min-height: 190px; cursor: default; background: linear-gradient(90deg, #f1f4f2 0%, #f8faf9 50%, #f1f4f2 100%); background-size: 200% 100%; animation: ui-shimmer 1.2s infinite; border: 0; }
.apx-card.is-ghost::before { display: none; }
@keyframes ui-shimmer { to { background-position: -200% 0; } }
.apx-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.apx-card header { display: flex; align-items: center; gap: .7rem; }
.apx-type { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: var(--t, var(--tone-slate)); background: color-mix(in srgb, var(--t, var(--tone-slate)) 12%, #fff); flex: none; }
.apx-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.apx-title span { font-size: .75rem; color: var(--ui-mute); }
.apx-title strong { color: var(--ui-ink); font-size: 1rem; }
.apx-pick { padding: .25rem; cursor: pointer; }
.apx-pick input { width: 1.2rem; height: 1.2rem; }
.apx-money { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; padding: .6rem .75rem; border-radius: 12px; background: #f7faf8; }
.apx-party { font-size: .82rem; color: var(--ui-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.apx-amount { font-weight: 800; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.apx-amount small { font-weight: 400; color: var(--ui-mute); font-size: .7rem; }
.apx-stage { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.apx-stage-name { font-size: .8rem; font-weight: 700; color: #b45309; background: #fff4e0; padding: .2rem .6rem; border-radius: 999px; }
.apx-dots { display: inline-flex; gap: 4px; }
.apx-dots span { width: 8px; height: 8px; border-radius: 50%; background: #e2e8e4; }
.apx-dots .done { background: var(--ui-green); } .apx-dots .now { background: var(--tone-warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.apx-card footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .75rem; border-top: 1px dashed var(--ui-line); margin-top: auto; }
.apx-who { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .8rem; color: var(--ui-ink-2); }
.apx-who > span:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.apx-who small { color: var(--ui-mute); font-size: .7rem; } .apx-who small.late { color: var(--tone-danger); font-weight: 700; }
.apx-actions { display: flex; gap: .35rem; flex: none; }
.apx-card.is-late .apx-type { animation: apv-pulse 2.4s ease-in-out infinite; }
.apx-rail { position: sticky; top: calc(var(--navbar-height, 64px) + 2rem); display: flex; flex-direction: column; gap: .75rem; }
.apx-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 150px; border-radius: 18px; border: 2px dashed; text-align: center;
            transition: all .2s var(--ui-ease); padding: 1rem; }
.apx-drop > * { pointer-events: none; }
.apx-drop i { font-size: 2.2rem; }
.apx-drop strong { font-size: 1.05rem; }
.apx-drop span { font-size: .75rem; opacity: .8; }
.apx-drop.ok { color: #16803c; border-color: #a7dcb9; background: #f2fbf5; }
.apx-drop.no { color: #c81e1e; border-color: #f3b4b4; background: #fff5f5; }
.apx-board.is-dragging .apx-drop { transform: scale(1.03); box-shadow: var(--ui-sh-2); }
.apx-board.is-dragging .apx-drop.ok { border-style: solid; }
.apx-board.is-dragging .apx-drop.no { border-style: solid; }
.apx-drop.ok.is-over { background: #16a34a; color: #fff; border-color: #16a34a; transform: scale(1.07); }
.apx-drop.no.is-over { background: #e5484d; color: #fff; border-color: #e5484d; transform: scale(1.07); }
.apx-rail-hint { font-size: .74rem; color: var(--ui-mute); margin: 0; line-height: 1.7; }
.apx-empty { text-align: center; padding: 3.5rem 1rem; background: #fff; border: 1px solid var(--ui-line); border-radius: 20px; box-shadow: var(--ui-sh-1); }
.apx-empty-art { width: 84px; height: 84px; border-radius: 26px; display: inline-grid; place-items: center; font-size: 2.6rem; color: #fff; background: var(--ui-grad);
                 box-shadow: 0 16px 30px -12px rgba(32, 141, 68, .7); animation: ui-float 3s ease-in-out infinite; margin-bottom: 1rem; }
.apx-empty h3 { font-weight: 800; color: var(--ui-ink); }
.apx-empty p { color: var(--ui-mute); max-width: 46ch; margin: .25rem auto 1rem; }
.apx-none { grid-column: 1 / -1; text-align: center; color: var(--ui-mute); padding: 2rem; }
.apx-decide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; max-height: 220px; overflow: auto; }
.apx-decide-list li { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 10px; background: #f6f8f7; font-size: .85rem; }

/* ── Product gallery ───────────────────────────────────── */
.pg-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.pg-toolbar .pg-chips { margin: 0; }
.pg-tools { display: flex; gap: .5rem; align-items: center; flex: 1; justify-content: flex-end; min-width: 260px; }
.pg-search { position: relative; flex: 1; max-width: 360px; }
.pg-search > i { position: absolute; inset-inline-start: .8rem; top: 50%; transform: translateY(-50%); color: var(--ui-mute); }
.pg-search input { padding-inline-start: 2.3rem; border-radius: 999px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.pg-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ui-line); border-radius: 18px; overflow: hidden;
           box-shadow: var(--ui-sh-1); cursor: pointer; transition: transform .22s var(--ui-ease), box-shadow .22s, border-color .22s; animation: ui-rise .35s var(--ui-ease) both; }
.pg-card:hover, .pg-card:focus-visible { transform: translateY(-4px); box-shadow: var(--ui-sh-2); border-color: #cfe3d6; outline: 0; }
.pg-card.is-ghost { min-height: 290px; cursor: default; background: linear-gradient(90deg, #f1f4f2 0%, #f8faf9 50%, #f1f4f2 100%); background-size: 200% 100%; animation: ui-shimmer 1.2s infinite; border: 0; }
.pg-media { position: relative; aspect-ratio: 4 / 3; background: #f6f8f7; display: grid; place-items: center; overflow: hidden; }
.pg-media img { width: 100%; height: 100%; object-fit: contain; background: #fff; transition: transform .4s var(--ui-ease); }
.pg-card:hover .pg-media img { transform: scale(1.05); }
.pg-noimg { --h: 140; width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: #fff;
            background: linear-gradient(135deg, hsl(var(--h) 55% 52%), hsl(calc(var(--h) + 40) 60% 45%)); }
.pg-noimg.sm { width: 44px; height: 44px; font-size: .9rem; border-radius: .5rem; border: 0; }
.pg-stock { position: absolute; top: .6rem; inset-inline-start: .6rem; font-size: .7rem; font-weight: 800; padding: .25rem .6rem; border-radius: 999px; backdrop-filter: blur(6px); }
.pg-stock.ok { background: rgba(232, 246, 237, .92); color: #16803c; } .pg-stock.low { background: rgba(255, 244, 224, .95); color: #b45309; }
.pg-stock.out { background: rgba(253, 232, 232, .95); color: #c81e1e; } .pg-stock.svc { background: rgba(238, 242, 255, .95); color: #4f46e5; }
.pg-kind { position: absolute; top: .6rem; inset-inline-end: .6rem; font-size: .7rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: rgba(79, 70, 229, .9); color: #fff; }
.pg-info { display: flex; flex-direction: column; gap: .45rem; padding: .85rem .95rem .9rem; flex: 1; }
.pg-info h3 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--ui-ink); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.85em; }
.pg-codes { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .72rem; color: var(--ui-mute); }
.pg-codes > span { background: #f3f6f4; padding: .12rem .45rem; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; }
.pg-barcode i, .pg-missing i { margin-inline-end: .2rem; }
.pg-missing { color: #b45309 !important; background: #fff4e0 !important; font-family: inherit !important; }
.pg-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .45rem; }
.pg-price { font-weight: 800; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.pg-price small { font-weight: 400; color: var(--ui-mute); font-size: .68rem; }
.pg-acts { display: flex; gap: .3rem; opacity: .0; transition: opacity .15s; }
.pg-card:hover .pg-acts, .pg-card:focus-within .pg-acts { opacity: 1; }
@media (hover: none) { .pg-acts { opacity: 1; } }

/* Product wizard steps. */
.pg-kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.pg-kind-pick button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center; text-align: start;
                       padding: .9rem 1rem; border: 2px solid var(--ui-line); border-radius: 16px; background: #fff; transition: all .18s var(--ui-ease); }
.pg-kind-pick button i { grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.4rem; background: #f1f5f3; color: var(--ui-mute); transition: all .18s; }
.pg-kind-pick button strong { color: var(--ui-ink); }
.pg-kind-pick button span { font-size: .74rem; color: var(--ui-mute); }
.pg-kind-pick button:hover:not(:disabled) { border-color: #b6dcc4; }
.pg-kind-pick button.is-on { border-color: var(--ui-green); background: #f3fbf6; box-shadow: 0 8px 18px -12px rgba(32, 141, 68, .7); }
.pg-kind-pick button.is-on i { background: var(--ui-grad); color: #fff; }
.pg-kind-pick button:disabled:not(.is-on) { opacity: .45; }
.pg-field-title { font-size: .8125rem; font-weight: 600; color: var(--ui-ink-2); margin: 1rem 0 .45rem; }
.pg-media-step .pg-field-title { margin-top: 0; }
.pg-units { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pg-units button { border: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink-2); padding: .35rem .8rem; border-radius: 999px; font-size: .82rem; transition: all .15s; }
.pg-units button:hover { border-color: var(--ui-green); }
.pg-units button.is-on { background: var(--ui-green); border-color: var(--ui-green); color: #fff; font-weight: 700; }
.pg-units input { width: 9rem; border-radius: 999px; }
.pg-media-step { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.pg-switch { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1rem; padding: .8rem; border-radius: 12px; background: #f7faf8; cursor: pointer; }
.pg-switch .form-check-input { width: 2.4em; height: 1.3em; margin-top: .2rem; }
.pg-switch span { display: flex; flex-direction: column; }
.pg-switch small { color: var(--ui-mute); font-size: .74rem; }
.pg-note { display: flex; gap: .5rem; align-items: center; padding: 1rem; border-radius: 12px; background: #eef2ff; color: #4338ca; }
.pg-toman { color: var(--ui-mute); font-size: .74rem; min-height: 1.1em; font-weight: 400; }
.pg-margin { --m: 0; --c: var(--ui-green); margin-top: .5rem; padding: 1rem; border-radius: 14px; background: #f7faf8; }
.pg-margin.low { --c: var(--tone-warning); } .pg-margin.neg { --c: var(--tone-danger); }
.pg-margin > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.pg-margin strong { font-size: 1.4rem; color: var(--c); font-weight: 800; }
.pg-margin-bar { height: 8px; border-radius: 4px; background: #e5ebe7; margin: .5rem 0; overflow: hidden; }
.pg-margin-bar span { display: block; height: 100%; width: calc(var(--m) * 100%); background: var(--c); border-radius: 4px; transition: width .4s var(--ui-ease); }
.pg-margin small { color: var(--ui-mute); }
.pg-review { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.pg-card.is-preview { cursor: default; box-shadow: var(--ui-sh-2); }
.pg-card.is-preview:hover { transform: none; }
.pg-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.pg-checks li { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-radius: 12px; font-size: .86rem; background: #f6fbf8; color: var(--ui-ink-2); }
.pg-checks li.ok i { color: var(--ui-green); font-size: 1.15rem; }
.pg-checks li.warn { background: #fff8eb; } .pg-checks li.warn i { color: var(--tone-warning); font-size: 1.15rem; }
.pg-flow { margin: 1.25rem 0 0; padding: .85rem 1rem; border-radius: 12px; background: linear-gradient(135deg, #f1faf4, #ecfbf6); color: var(--ui-ink-2); font-size: .84rem; line-height: 1.9; }
.pg-flow i { color: var(--ui-green); margin-inline-end: .25rem; }

/* ── The small confirm / prompt / decision dialog ──────── */
.alb-dialog-backdrop { background: rgba(13, 28, 20, .52); animation: mx-fade .18s ease both; }
.alb-dialog-backdrop.closing { animation: mx-fade .14s ease reverse both; }
.alb-dialog { width: min(460px, 100%); padding: 1.5rem; border-radius: 20px; border: 0; text-align: center; box-shadow: var(--ui-sh-3); animation: mx-pop .25s var(--ui-ease) both; }
.alb-dialog-icon { width: 56px; height: 56px; margin: 0 auto .75rem; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; color: var(--t, var(--tone-primary)); background: color-mix(in srgb, var(--t, var(--tone-primary)) 13%, #fff); }
.alb-dialog-title { font-size: 1.1rem; font-weight: 800; color: var(--ui-ink); margin: 0 0 .35rem; }
.alb-dialog-text { color: var(--ui-ink-2); }
.alb-dialog-input { text-align: start; margin-bottom: 1rem; }
.alb-dialog-actions { display: flex; gap: .5rem; justify-content: center; }
.alb-dialog-actions .btn { min-width: 7rem; }

/* ── Phones and tablets ────────────────────────────────── */
@media (max-width: 1199.98px) {
    .apx-board { grid-template-columns: 1fr; }
    /* Narrower screens: the drop zones rise as a bar at the bottom only while a card is being dragged. */
    .apx-rail { position: fixed; z-index: 1800; top: auto; bottom: 1rem; inset-inline: 1rem; flex-direction: row; display: flex;
                transform: translateY(160%); transition: transform .3s var(--ui-ease); pointer-events: none; }
    .apx-board.is-dragging .apx-rail { transform: none; pointer-events: auto; }
    .apx-rail .apx-drop { flex: 1; min-height: 96px; box-shadow: var(--ui-sh-3); }
    .apx-rail-hint { display: none; }
}
@media (max-width: 767.98px) {
    /* The page's main action comes first in the sideways-scrolling button row, never hidden past its edge. */
    .action-bar-buttons > .btn-primary { order: -1; }
    .apx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .apx-stat { padding: .75rem; gap: .6rem; }
    .apx-stat > i { width: 38px; height: 38px; font-size: 1.15rem; }
    .apx-stat strong { font-size: 1.1rem; }
    .apx-search { max-width: none; flex-basis: 100%; }
    .apx-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
    .apx-filters .apx-search { flex: 0 0 220px; }
    .apx-chip { flex: none; }
    .apx-grid, .apx-skeleton { grid-template-columns: 1fr; }
    .apx-card { cursor: default; }
    .mx-layer { padding: 0; align-items: flex-end; }
    .mx-dialog { max-width: 100% !important; max-height: 94vh; border-radius: 22px 22px 0 0; animation: mx-sheet .3s var(--ui-ease) both; padding-bottom: env(safe-area-inset-bottom); }
    .mx-dialog::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #d5ddd8; }
    .mx-head { padding: 1.2rem 1rem .9rem; }
    .mx-body, .wz-panel { padding: 1rem; }
    .mx-foot, .wz-foot { padding: .75rem 1rem; }
    .wz-track { padding: .75rem 1rem .5rem; }
    .wz-track li { flex: 0 0 auto; }
    .wz-track li:not(.is-current) .wz-label { display: none; }
    .wz-bar { margin: 0 1rem; }
    .wz-count { display: none; }
    .wz-foot .btn { flex: 1; }
    .wz-foot .wz-spacer { display: none; }
    .pg-media-step, .pg-review, .pg-kind-pick { grid-template-columns: 1fr; }
    .pg-review .pg-card { max-width: 260px; margin: 0 auto; }
    .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .pg-info { padding: .6rem .7rem .7rem; }
    .pg-info h3 { font-size: .84rem; }
    .pg-tools { min-width: 0; flex-basis: 100%; }
    .pg-search { max-width: none; }
    .pg-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
    .pp-list { grid-template-columns: 1fr; }
    .apx-toast { bottom: calc(1rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 359.98px) { .pg-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Excel / CSV import wizard ─────────────────────────── */
.imx-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; min-height: 210px;
            padding: 1.5rem; border: 2px dashed #cfd9d3; border-radius: 18px; background: #fafcfb; color: var(--ui-mute); transition: all .2s var(--ui-ease); }
.imx-drop strong { color: var(--ui-ink); font-size: 1rem; }
.imx-drop:hover, .imx-drop.is-over { border-color: var(--ui-green); background: #f1faf4; }
.imx-drop.is-over { transform: scale(1.01); box-shadow: 0 0 0 6px rgba(32, 141, 68, .1); }
.imx-drop.has-file { min-height: 130px; border-style: solid; border-color: #b6dcc4; background: linear-gradient(135deg, #f1faf4, #ecfbf6); }
.imx-drop > :not(input) { pointer-events: none; }
.imx-file-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; color: #fff; background: #1d6f42; box-shadow: 0 10px 20px -10px #1d6f42; }
.imx-peek { margin-top: 1rem; max-height: 230px; overflow: auto; border: 1px solid var(--ui-line); border-radius: 12px; }
.imx-peek.tall { max-height: 360px; }
.imx-peek table { margin: 0; font-size: .8rem; white-space: nowrap; }
.imx-peek thead th { position: sticky; top: 0; z-index: 1; }
.imx-template { margin: 1rem 0 0; font-size: .82rem; color: var(--ui-mute); }
.imx-template .btn-link { font-size: inherit; vertical-align: baseline; }
.imx-required { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; font-size: .82rem; color: var(--ui-ink-2); }
.imx-req { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .6rem; border-radius: 999px; font-weight: 700; }
.imx-req.ok { background: #e8f6ed; color: #16803c; } .imx-req.miss { background: #fde8e8; color: #c81e1e; }
.imx-spacer { flex: 1; }
.imx-map { display: flex; flex-direction: column; gap: .5rem; }
.imx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(180px, 280px); align-items: center; gap: .75rem; padding: .55rem .75rem;
           border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.imx-row.is-mapped { border-color: #b6dcc4; background: #f6fbf8; }
.imx-row.is-dup { border-color: #f3b4b4; background: #fff5f5; }
.imx-row .imx-hint { grid-column: 3; color: var(--ui-mute); font-size: .72rem; margin-top: -.3rem; }
.imx-col { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.imx-col > div { min-width: 0; display: flex; flex-direction: column; }
.imx-col strong { color: var(--ui-ink); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imx-col small { color: var(--ui-mute); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imx-letter { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: #eef2f0; color: var(--ui-ink-2); font-family: ui-monospace, Consolas, monospace; }
.imx-row.is-mapped .imx-letter { background: var(--ui-green); color: #fff; }
.imx-arrow { color: var(--ui-mute); font-size: 1.1rem; }
.imx-row.is-mapped .imx-arrow { color: var(--ui-green); }
.imx-checking { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 3rem 1rem; color: var(--ui-ink-2); font-weight: 600; }
.imx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.imx-stats > div { display: flex; flex-direction: column; align-items: center; padding: .75rem .5rem; border-radius: 14px; background: #f4f7f5; text-align: center; }
.imx-stats strong { font-size: 1.5rem; font-weight: 800; color: var(--ui-ink-2); font-variant-numeric: tabular-nums; line-height: 1.2; }
.imx-stats span { font-size: .74rem; color: var(--ui-mute); }
.imx-stats .ok { background: #e8f6ed; } .imx-stats .ok strong { color: #16803c; }
.imx-stats .up { background: #e6f4fb; } .imx-stats .up strong { color: #0369a1; }
.imx-stats .bad { background: #fde8e8; } .imx-stats .bad strong { color: #c81e1e; }
.imx-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.imx-options .pg-switch { margin-top: 0; }
.imx-option { margin: 0 !important; padding: .8rem; border-radius: 12px; background: #f7faf8; }
.imx-filter { display: flex; gap: .4rem; margin-bottom: .5rem; }
.imx-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: .1rem .5rem; border-radius: 999px; background: #eef2f0; color: var(--ui-ink-2); }
tr.imx-created .imx-badge, tr.imx-done .imx-badge { background: #e8f6ed; color: #16803c; }
tr.imx-updated .imx-badge { background: #e6f4fb; color: #0369a1; }
tr.imx-error > td { background: #fff7f7 !important; }
tr.imx-error .imx-badge { background: #fde8e8; color: #c81e1e; }
tr.imx-error small { color: #c81e1e; white-space: normal; min-width: 220px; }
.imx-done { text-align: center; padding: 2.5rem 1.5rem; overflow: auto; }
.imx-done-art { width: 76px; height: 76px; border-radius: 24px; display: inline-grid; place-items: center; font-size: 2.4rem; color: #fff; background: var(--ui-grad);
                box-shadow: 0 16px 30px -12px rgba(32, 141, 68, .7); margin-bottom: .75rem; animation: mx-pop .4s var(--ui-ease) both; }
.imx-done-art.bad { background: var(--tone-warning); box-shadow: 0 16px 30px -12px rgba(245, 158, 11, .7); }
.imx-done h3 { font-weight: 800; color: var(--ui-ink); margin-bottom: 1rem; }
.imx-done .imx-stats { max-width: 620px; margin: 0 auto; }
.imx-kinds { max-width: 760px; }
@media (max-width: 767.98px) {
    .imx-row { grid-template-columns: 1fr; gap: .4rem; }
    .imx-row .imx-arrow { display: none; }
    .imx-row .imx-hint { grid-column: 1; margin-top: 0; }
    .imx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Inline forms shown as popups (FormPopup) ──────────── */
.mx-form-close { position: absolute; top: .9rem; inset-inline-end: .9rem; z-index: 3; }
.mx-form > .mx-body { padding: 1.4rem 1.5rem 1.25rem; }
/* The form's own heading reads as the popup title, clear of the ✕. */
.mx-form > .mx-body > :first-child { padding-inline-end: 3rem; }
.mx-form > .mx-body > h2:first-child, .mx-form > .mx-body > h3:first-child { font-size: 1.15rem; font-weight: 800; color: var(--ui-ink); margin: 0 0 1.1rem; }
.mx-form > .mx-body > div:first-child h2 { font-size: 1.15rem; font-weight: 800; color: var(--ui-ink); }
/* Its button row stays in reach at the bottom of a long form. */
.mx-form > .mx-body > :last-child:is(.action-bar-buttons, .d-flex, .mt-2):has(> .btn, > button) {
    position: sticky; bottom: -1.25rem; z-index: 2; margin: 1rem -1.5rem -1.25rem; padding: .85rem 1.5rem;
    background: #fafcfb; border-top: 1px solid var(--ui-line); display: flex; flex-wrap: wrap; gap: .5rem;
}
@media (max-width: 767.98px) {
    .mx-form > .mx-body { padding: 1.3rem 1rem 1rem; }
    .mx-form > .mx-body > :last-child:is(.action-bar-buttons, .d-flex, .mt-2):has(> .btn, > button) { margin: 1rem -1rem -1rem; padding: .75rem 1rem; bottom: -1rem; }
}
