/* KD Warehouse Tools — Commercial Framework v0.2.4 */
:root {
    --navy: #0d2a4f;
    --navy-deep: #081d37;
    --blue: #1f78ff;
    --blue-dark: #0d5fd7;
    --blue-soft: #eaf2ff;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #12213a;
    --muted: #64748b;
    --border: #d8e1ed;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
    --warning: #9a6700;
    --warning-bg: #fff7e6;
    --radius: 18px;
    --shadow: 0 12px 35px rgba(15, 35, 65, .08);
}

* { box-sizing: border-box; }
html {
    min-width: 320px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--blue-dark); }
h1, h2, h3, p { margin-top: 0; }
button, input, select, textarea { font: inherit; }

/* KDWT typography refinement — v0.6.12.1 */
h1, .page-title, .app-page-title { font-weight: 700; letter-spacing: -.025em; }
h2, h3, .card-title, .panel-title, .section-title { font-weight: 650; letter-spacing: -.012em; }
label, th, .field-label, .detail-label, .meta-label { font-weight: 600; }
button, .btn, .button, [role="button"] { font-weight: 600; }

/* Login */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    background: linear-gradient(145deg, var(--navy-deep), #153f70);
}
.login-card {
    width: min(100%, 540px);
    padding: 42px 44px;
    border-radius: 24px;
    background: var(--card);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}
.brand { text-align: center; margin-bottom: 28px; }
.brand h1 { margin: 14px 0 4px; font-size: 30px; }
.brand p, .small-note { color: var(--muted); }
.logo-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--blue);
    color: #fff;
    font-size: 36px;
    font-weight: 900;
}
.small-note { margin: 22px 0 0; text-align: center; font-size: 14px; }

/* Forms */
label { display: block; margin: 17px 0 7px; font-weight: 800; }
input, select, textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(31, 120, 255, .15);
}
button {
    border: 0;
    cursor: pointer;
}
.login-card button[type="submit"] {
    width: 100%;
    margin-top: 26px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
}
.form-help { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}
.form-inline { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    cursor: pointer;
}
.checkbox-row input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 3px 0 0;
    flex: 0 0 auto;
}
.checkbox-row > span {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.checkbox-row strong,
.checkbox-row small {
    display: block;
}
.checkbox-row strong {
    line-height: 1.35;
}
.checkbox-row small {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    padding: 11px 17px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: var(--navy-deep); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-large { min-height: 54px; padding: 14px 24px; font-size: 17px; }
.btn-small { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.btn-link { background: transparent; color: var(--blue-dark); padding: 6px; font-weight: 800; }
.btn-link.danger { color: var(--danger); }

/* Shared shell */
.app-header {
    background: var(--navy-deep);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-header-inner {
    width: min(100% - 40px, 1480px);
    min-height: 84px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 34px;
}
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    min-width: 250px;
}
.app-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    font-weight: 900;
}
.app-brand-copy, .app-account-copy { display: flex; flex-direction: column; line-height: 1.15; }
.app-brand-copy strong { font-size: 19px; }
.app-brand-copy small { margin-top: 5px; color: #b9c9de; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a {
    padding: 10px 13px;
    border-radius: 10px;
    color: #cbd8ea;
    font-weight: 750;
    text-decoration: none;
}
.app-nav a:hover, .app-nav a.active { background: rgba(255,255,255,.10); color: #fff; }
.app-account { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.app-account-copy { min-width: 130px; text-align: right; }
.app-account-copy strong { font-size: 15px; }
.app-account-copy small { margin-top: 4px; color: #b9c9de; font-size: 12px; }
.app-main {
    width: min(100% - 40px, 1480px);
    flex: 1;
    margin: 0 auto;
    padding: 28px 0 42px;
}
.app-footer { border-top: 1px solid var(--border); background: #edf2f8; color: var(--muted); }
.app-footer-inner {
    width: min(100% - 40px, 1220px);
    min-height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: 13px;
    font-weight: 700;
}
.release-badge { display: inline-flex; align-items: center; gap: 10px; }
.release-badge strong { padding: 6px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); }

/* Headers and cards */
.page-header, .hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
    padding: 28px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}
.page-header h1, .hero h1 { margin: 8px 0 8px; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
.page-header p, .hero p { margin: 0; color: var(--muted); font-size: 16px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow, .module-kicker {
    display: inline-block;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .11em;
}
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}
.panel, .stat-card, .module-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}
.panel { padding: 28px; }
.panel-heading, .panel-title-row { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.panel-heading h2, .panel-title-row h2 { margin-bottom: 5px; }
.panel-heading p, .panel-title-row p { margin: 0; color: var(--muted); }
.user-form-panel { max-width: 900px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card { padding: 22px 24px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 850; letter-spacing: .06em; }
.stat-card strong { display: block; margin-top: 9px; font-size: 36px; line-height: 1; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.module-card { min-height: 220px; padding: 25px; }
.module-card h2, .module-card h3 { margin: 10px 0 14px; }
.module-card p { color: var(--muted); }
.module-link { text-decoration: none; color: var(--text); }
.module-link:hover { border-color: #a9c7f2; transform: translateY(-1px); }
.module-card-muted { background: #f8fafc; }
.link-arrow { font-weight: 850; }

/* Alerts and statuses */
.alert { margin: 0 0 18px; border-radius: 12px; padding: 13px 15px; font-size: 14px; }
.alert-error { border: 1px solid #fecdca; background: var(--danger-bg); color: var(--danger); }
.alert-success { border: 1px solid #abefc6; background: var(--success-bg); color: var(--success); }
.status-pill, .current-user-label {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 850;
}
.status-active { background: var(--success-bg); color: var(--success); }
.status-inactive { background: var(--danger-bg); color: var(--danger); }
.status-warning { background: var(--warning-bg); color: var(--warning); }
.status-normal, .current-user-label { background: var(--blue-soft); color: var(--blue-dark); }

/* User management */
.user-management-list { display: grid; gap: 14px; margin-top: 20px; }
.user-management-card {
    display: grid;
    grid-template-columns: minmax(230px, 1.2fr) minmax(220px, .8fr) auto;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
}
.user-card-name-row, .user-card-badges, .user-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-card-name { margin: 0; }
.user-card-username { display: block; margin: 4px 0 10px; color: var(--muted); }
.user-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.user-card-meta dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.user-card-meta dd { margin: 4px 0 0; font-weight: 750; }
.user-card-actions { justify-content: flex-end; }
.user-card-actions form { margin: 0; }
.empty-state { margin-top: 20px; padding: 28px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; }

/* Locations tables / generic lists */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }

@media (max-width: 1100px) {
    .app-header-inner { grid-template-columns: auto 1fr; padding: 16px 0; }
    .app-nav { grid-column: 1 / -1; order: 3; }
    .app-account { justify-self: end; }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-management-card { grid-template-columns: 1fr; }
    .user-card-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .app-header-inner, .app-main, .app-footer-inner { width: min(100% - 24px, 1480px); }
    .app-header-inner { grid-template-columns: 1fr; gap: 14px; }
    .app-brand { min-width: 0; }
    .app-account { justify-self: stretch; justify-content: space-between; }
    .app-account-copy { text-align: left; }
    .app-nav { width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .app-nav a { flex: 0 0 auto; }
    .app-main { padding-top: 18px; }
    .page-header, .hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn, .hero .btn { width: 100%; }
    .stat-grid, .module-grid { grid-template-columns: 1fr; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .panel { padding: 20px; }
    .login-card { padding: 32px 24px; }
    .app-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 18px 0; }
    .release-badge { align-items: flex-start; flex-direction: column; }
    .user-card-meta { grid-template-columns: 1fr; }
    .user-card-actions .btn, .user-card-actions form, .user-card-actions form button { width: 100%; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ==========================================================
   Commercial Framework v0.2 — Navigation, Breadcrumbs, Search
   ========================================================== */

.app-search-launcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,.07);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.app-search-launcher:hover { background: rgba(255,255,255,.13); }
.app-search-launcher kbd,
.search-dialog-input-wrap kbd {
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    padding: 3px 6px;
    background: rgba(255,255,255,.08);
    color: #cbd8ea;
    font-family: inherit;
    font-size: 11px;
}
.app-account-link {
    color: #cbd8ea;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}
.app-account-link:hover { color: #fff; }

.app-breadcrumbs { margin: -6px 0 18px; }
.app-breadcrumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}
.app-breadcrumbs a { color: var(--blue-dark); text-decoration: none; }
.app-breadcrumbs a:hover { text-decoration: underline; }
.app-breadcrumb-home {
    display: inline-flex;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}
.app-breadcrumb-home svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-breadcrumb-separator { color: #a7b2c2; }

.search-dialog-open { overflow: hidden; }
.search-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: min(10vh, 90px) 18px 24px;
    background: rgba(5, 18, 35, .72);
    backdrop-filter: blur(5px);
}
.search-dialog-backdrop[hidden] { display: none; }
.search-dialog {
    width: min(100%, 760px);
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(3, 16, 34, .28);
}
.search-dialog-header,
.search-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
}
.search-dialog-header { border-bottom: 1px solid var(--border); }
.search-dialog-header h2 { margin: 5px 0 0; }
.search-dialog-close {
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 10px;
    background: #eef3f9;
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}
.search-dialog-input-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin: 18px 22px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 13px;
    background: #f8fafc;
}
.search-dialog-input {
    min-height: 54px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none !important;
}
.search-dialog-input-wrap kbd {
    border-color: var(--border);
    background: #fff;
    color: var(--muted);
}
.search-dialog-results { min-height: 180px; overflow-y: auto; padding: 8px 14px 18px; }
.search-dialog-group h3 {
    margin: 15px 8px 7px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.search-dialog-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
}
.search-dialog-result:hover,
.search-dialog-result.is-active { background: var(--blue-soft); }
.search-dialog-result-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.search-dialog-result-copy small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.search-dialog-result-badge { flex: 0 0 auto; border-radius: 999px; padding: 5px 8px; background: #edf2f8; color: var(--muted); font-size: 11px; font-weight: 850; }
.search-empty-state { padding: 34px 20px; text-align: center; }
.search-empty-state strong { display: block; font-size: 17px; }
.search-empty-state p { margin: 7px 0 0; color: var(--muted); }
.search-empty-icon { display: block; margin-bottom: 8px; font-size: 30px; color: var(--blue-dark); }
.search-dialog-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.search-dialog-footer a { margin-left: auto; font-weight: 800; text-decoration: none; }

.search-workspace { max-width: 1050px; }
.search-workspace-form label { margin-top: 0; }
.search-workspace-input-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-result-section { margin-top: 28px; }
.search-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.search-result-heading h2 { margin: 0; }
.search-result-heading span { color: var(--muted); font-size: 13px; font-weight: 750; }
.search-result-list { display: grid; gap: 8px; }
.search-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 15px;
    color: var(--text);
    text-decoration: none;
}
.search-result-row:hover { border-color: #a9c7f2; background: #f8fbff; }
.search-result-row > span:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search-result-row small { color: var(--muted); }

@media (max-width: 1220px) {
    .app-header-inner { grid-template-columns: auto 1fr; }
    .app-account { justify-self: end; }
    .app-nav { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 820px) {
    .app-account { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .app-account-copy { margin-left: auto; }
    .app-search-launcher kbd { display: none; }
}

@media (max-width: 720px) {
    .app-search-launcher { order: 3; flex: 1 1 100%; justify-content: center; }
    .app-account-copy { margin-left: 0; text-align: left; }
    .app-account-link { padding: 8px 4px; }
    .search-dialog-backdrop { padding: 12px; align-items: start; }
    .search-dialog { max-height: calc(100vh - 24px); border-radius: 15px; }
    .search-dialog-header, .search-dialog-footer { padding: 16px; }
    .search-dialog-input-wrap { margin: 14px 16px 8px; }
    .search-dialog-footer span { display: none; }
    .search-dialog-footer a { margin-left: 0; }
    .search-workspace-input-row { grid-template-columns: 1fr; }
    .search-workspace-input-row .btn { width: 100%; }
    .search-result-row { align-items: flex-start; flex-direction: column; }
}


/* ==========================================================
   Commercial Framework v0.2.1 — KDSS repairs
   ========================================================== */
.search-dialog-close {
    display: grid;
    place-items: center;
    padding: 0;
}
.search-dialog-close span {
    display: block;
    line-height: .8;
    transform: translateY(-1px);
}

.user-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.user-summary-card {
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 18px 20px;
    background: #fff;
    box-shadow: var(--shadow);
}
.user-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.user-summary-card strong {
    display: block;
    margin-top: 7px;
    font-size: 30px;
    line-height: 1;
}
.user-management-card {
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.user-management-card:hover {
    border-color: #b8cdeb;
    box-shadow: 0 10px 28px rgba(15, 35, 65, .07);
    transform: translateY(-1px);
}

@media (max-width: 720px) {
    .app-header-inner {
        gap: 16px;
        padding: 18px 0;
    }
    .app-brand {
        width: 100%;
    }
    .app-account {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 8px;
        padding: 12px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 14px;
        background: rgba(255,255,255,.05);
    }
    .app-account-copy {
        min-width: 0;
        padding-right: 8px;
    }
    .app-account-copy strong,
    .app-account-copy small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-account-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        border-radius: 9px;
        padding: 7px 9px;
        background: rgba(255,255,255,.07);
    }
    .app-search-launcher {
        grid-column: 1 / -1;
        order: initial;
        width: 100%;
    }
    .app-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding: 0;
    }
    .app-nav a {
        width: 100%;
        text-align: center;
    }
    .user-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Commercial Framework v0.2.4 — Mobile density polish
   ========================================================== */
@media (max-width: 720px) {
    .app-header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 14px;
        padding: 12px 0;
    }
    .app-brand {
        width: auto;
        min-width: 0;
        gap: 9px;
    }
    .app-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 13px;
    }
    .app-brand-copy strong {
        max-width: 150px;
        font-size: 16px;
        line-height: 1.05;
    }
    .app-brand-copy small {
        margin-top: 4px;
        font-size: 10px;
    }
    .app-account {
        width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    .app-account-copy,
    .app-search-launcher {
        display: none;
    }
    .app-account-link {
        min-height: 34px;
        border: 1px solid rgba(255,255,255,.11);
        border-radius: 9px;
        padding: 7px 9px;
        background: rgba(255,255,255,.06);
        font-size: 11px;
    }
    .app-nav {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding: 0;
    }
    .app-nav a {
        min-width: 0;
        padding: 9px 4px;
        border-radius: 9px;
        font-size: 12px;
        text-align: center;
    }
    .app-main {
        padding-top: 14px;
        padding-bottom: 26px;
    }
    .app-breadcrumbs {
        margin: -2px 0 12px;
    }
    .app-breadcrumbs ol {
        gap: 5px;
        font-size: 11px;
    }
    .page-header,
    .hero {
        gap: 16px;
        margin-bottom: 16px;
        padding: 18px;
        border-radius: 15px;
    }
    .page-header h1,
    .hero h1 {
        margin: 6px 0 6px;
        font-size: 30px;
    }
    .page-header p,
    .hero p {
        font-size: 14px;
        line-height: 1.4;
    }
    .page-header-actions {
        gap: 8px;
    }
    .page-header-actions .btn,
    .hero .btn {
        min-height: 46px;
    }
    .panel {
        padding: 16px;
        border-radius: 15px;
    }
    .panel-heading,
    .panel-title-row {
        padding-bottom: 14px;
    }
    .panel-title-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }
    .panel-title-row h2 {
        font-size: 24px;
    }
    .form-inline {
        gap: 8px;
    }
    .form-inline label {
        width: 100%;
        margin-top: 14px;
    }
    .user-management-list {
        gap: 10px;
        margin-top: 14px;
    }
    .user-management-card {
        gap: 14px;
        padding: 16px;
        border-radius: 13px;
    }
    .user-card-name {
        font-size: 20px;
    }
    .user-card-badges {
        gap: 6px;
    }
    .badge,
    .status-pill,
    .current-user-label {
        padding: 4px 8px;
        font-size: 10px;
    }
    .user-card-meta {
        gap: 10px;
    }
    .user-card-actions .btn {
        min-height: 40px;
    }
    .user-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }
    .user-summary-card {
        padding: 12px 10px;
        border-radius: 13px;
        box-shadow: none;
    }
    .user-summary-card span {
        font-size: 9px;
        line-height: 1.25;
    }
    .user-summary-card strong {
        margin-top: 6px;
        font-size: 24px;
    }
    .app-footer-inner {
        min-height: 58px;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 0;
        font-size: 11px;
    }
    .release-badge {
        align-items: flex-end;
        flex-direction: column;
        gap: 3px;
        text-align: right;
    }
    .release-badge strong {
        padding: 0;
        background: transparent;
    }
}

@media (max-width: 390px) {
    .app-brand-copy strong { max-width: 126px; font-size: 15px; }
    .app-account-link { padding-inline: 7px; font-size: 10px; }
    .app-nav a { font-size: 11px; }
}

/* Locations lifecycle — Phase 1A Slice 1 */
.location-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.location-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.location-status-card span { color: var(--muted); font-weight: 800; }
.location-status-card strong { font-size: 1.7rem; line-height: 1; }
.location-status-card.is-current {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 119, 255, 0.12);
}
.location-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) auto;
    align-items: end;
    gap: 12px;
    margin: 18px 0;
}
.location-filter-bar > div { min-width: 0; }
.location-filter-bar label { display: block; margin-bottom: 6px; }
.status-archived { background: #eef0f4; color: #4b5565; }
.status-locked { background: #f2f4f7; color: #344054; }
.location-lifecycle-actions { align-content: center; }
.location-lifecycle-actions .btn-danger {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}
.location-lifecycle-actions .btn-danger:hover { background: #912018; }
.location-lifecycle-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 760px) {
    .location-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .location-status-card { display: block; padding: 12px; text-align: center; }
    .location-status-card span { display: block; font-size: 0.74rem; }
    .location-status-card strong { display: block; margin-top: 5px; font-size: 1.35rem; }
    .location-filter-bar { grid-template-columns: 1fr; }
    .location-filter-bar .btn { width: 100%; }
    .location-lifecycle-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .location-lifecycle-actions .btn,
    .location-lifecycle-actions form,
    .location-lifecycle-actions form button { width: 100%; }
}

/* Locations lifecycle — Phase 1A Slice 2 bulk actions */
.location-bulk-bar {
    display: grid;
    grid-template-columns: auto auto minmax(210px, 0.55fr) auto;
    align-items: center;
    gap: 12px;
    margin: 18px 0 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}
.location-select-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-weight: 800;
    white-space: nowrap;
}
.location-select-all input,
.location-card-select input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}
.location-selected-count {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}
.location-bulk-bar select { min-width: 0; }
.location-bulk-bar button:disabled { cursor: not-allowed; opacity: 0.5; }
.location-management-card {
    grid-template-columns: auto minmax(230px, 1.2fr) minmax(220px, .8fr) auto;
}
.location-card-select {
    display: flex;
    align-self: stretch;
    align-items: flex-start;
    padding-top: 3px;
}
.location-card-select input { cursor: pointer; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1100px) {
    .location-management-card {
        grid-template-columns: auto 1fr;
    }
    .location-card-select { grid-row: 1 / span 3; }
}

@media (max-width: 760px) {
    .location-bulk-bar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }
    .location-bulk-bar select,
    .location-bulk-bar .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
    .location-selected-count { justify-self: end; }
    .location-management-card {
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 10px;
    }
    .location-card-select { grid-row: 1 / span 3; }
    .location-management-card .user-card-primary,
    .location-management-card .user-card-meta,
    .location-management-card .location-lifecycle-actions {
        grid-column: 2;
    }
}


/* Locations Slice 3 — labels and live location record */
.location-record-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 22px; }
.record-detail-list { display: grid; gap: 0; margin: 0; }
.record-detail-list > div { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr); gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.record-detail-list > div:last-child { border-bottom: 0; }
.record-detail-list dt { color: var(--muted); font-weight: 700; }
.record-detail-list dd { margin: 0; font-weight: 700; }
.location-lifecycle-actions { flex-wrap: wrap; }
@media (max-width: 820px) { .location-record-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .record-detail-list > div { grid-template-columns: 1fr; gap: 4px; } }

/* Locations Slice 3 final polish — directory filters and filtered label printing */
.location-filter-bar {
    grid-template-columns: minmax(180px, 1.15fr) minmax(170px, 1fr) minmax(190px, 1.15fr) minmax(150px, .8fr) auto;
    align-items: end;
}
.location-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.location-filter-actions .btn { white-space: nowrap; }
.location-bulk-bar {
    grid-template-columns: auto minmax(150px, .65fr) minmax(210px, 1fr) auto auto auto;
}
.location-bulk-bar > .btn { white-space: nowrap; }

@media (max-width: 1180px) {
    .location-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .location-filter-actions { grid-column: 1 / -1; }
    .location-bulk-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .location-filter-bar { grid-template-columns: 1fr; }
    .location-filter-actions { grid-column: auto; display: grid; grid-template-columns: 1fr 1fr; }
    .location-filter-actions .btn { width: 100%; }
    .location-bulk-bar { grid-template-columns: 1fr; }
    .location-selected-count { justify-self: start; }
}

/* Locations Slice 3 — unified responsive KDSS repair v0.2.8 */
.location-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}
.location-filter-bar > div:not(.location-filter-actions) {
    flex: 1 1 210px;
    min-width: 0;
}
.location-filter-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}
.location-filter-actions .btn,
.location-filter-actions a {
    white-space: nowrap;
}

.location-bulk-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, .9fr) repeat(3, max-content);
    align-items: center;
    gap: 12px;
    width: 100%;
}
.location-bulk-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    min-width: 0;
}
.location-bulk-summary .location-select-all,
.location-bulk-summary .location-selected-count {
    min-width: 0;
    white-space: normal;
}
.location-bulk-bar > select,
.location-bulk-bar > .btn {
    min-width: 0;
}
.location-bulk-bar > .btn {
    white-space: nowrap;
}

@media (max-width: 1220px) {
    .location-filter-actions {
        flex: 1 1 100%;
        min-width: 0;
    }
    .location-bulk-bar {
        grid-template-columns: minmax(260px, 1fr) minmax(220px, 1fr) repeat(2, minmax(160px, auto));
    }
    .location-bulk-bar > .btn:last-child {
        grid-column: 3 / -1;
        width: 100%;
    }
}

@media (max-width: 900px) {
    .location-filter-bar > div:not(.location-filter-actions) {
        flex-basis: calc(50% - 7px);
    }
    .location-filter-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }
    .location-filter-actions .btn {
        width: 100%;
    }
    .location-bulk-bar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .location-bulk-summary,
    .location-bulk-bar > select {
        grid-column: 1 / -1;
        width: 100%;
    }
    .location-bulk-bar > .btn,
    .location-bulk-bar > .btn:last-child {
        grid-column: auto;
        width: 100%;
    }
    .location-bulk-bar > .btn:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .location-filter-bar > div:not(.location-filter-actions) {
        flex: 1 1 100%;
    }
    .location-filter-actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .location-filter-actions a {
        width: 100%;
        text-align: center;
    }
    .location-bulk-bar {
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
    }
    .location-bulk-summary,
    .location-bulk-bar > select,
    .location-bulk-bar > .btn,
    .location-bulk-bar > .btn:last-child {
        grid-column: 1;
        width: 100%;
        max-width: 100%;
    }
    .location-bulk-summary {
        align-items: flex-start;
    }
    .location-select-all {
        width: 100%;
    }
    .location-selected-count {
        width: 100%;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }
    .location-management-card {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .location-management-card .user-card-primary,
    .location-management-card .user-card-meta,
    .location-management-card .location-lifecycle-actions {
        grid-column: 2;
        min-width: 0;
    }
    .location-lifecycle-actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .location-lifecycle-actions .btn,
    .location-lifecycle-actions form,
    .location-lifecycle-actions form button {
        width: 100%;
        min-width: 0;
    }
}

/* Locations Slice 3 — PAMP responsive lock v0.2.9
   Natural wrapping replaces breakpoint-dependent bulk grids. */
.location-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.location-bulk-bar > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.location-bulk-summary {
    flex: 2 1 300px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}
.location-bulk-summary .location-select-all,
.location-bulk-summary .location-selected-count {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.location-bulk-bar > select {
    flex: 1 1 220px;
    width: auto;
}
.location-bulk-bar > .btn {
    flex: 1 1 165px;
    width: auto;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}
.location-bulk-bar > .btn:last-child {
    flex-basis: 220px;
}

/* Keep every location card and its actions inside the directory frame. */
.location-management-card,
.location-management-card > *,
.location-lifecycle-actions,
.location-lifecycle-actions > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.location-lifecycle-actions {
    flex-wrap: wrap;
}
.location-lifecycle-actions .btn,
.location-lifecycle-actions form,
.location-lifecycle-actions form .btn {
    min-width: 0;
}

/* Medium widths: controls form balanced rows without a layout snap. */
@media (max-width: 980px) {
    .location-bulk-summary {
        flex-basis: 100%;
    }
    .location-bulk-bar > select {
        flex-basis: 100%;
    }
    .location-bulk-bar > .btn {
        flex: 1 1 calc(50% - 6px);
    }
    .location-bulk-bar > .btn:last-child {
        flex-basis: 100%;
    }
}

/* Phone widths: one clean vertical control stack. */
@media (max-width: 640px) {
    .location-bulk-bar {
        padding: 12px;
        overflow: hidden;
    }
    .location-bulk-summary,
    .location-bulk-bar > select,
    .location-bulk-bar > .btn,
    .location-bulk-bar > .btn:last-child {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }
    .location-bulk-summary {
        align-items: flex-start;
    }
    .location-select-all,
    .location-selected-count {
        width: 100%;
    }
}

/* Products & Units — Phase 1 Slice 1 */
.product-filter-bar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:14px; margin:18px 0; }
.product-filter-bar > div:not(.product-filter-actions) { flex:1 1 230px; min-width:0; }
.product-filter-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.product-management-card { grid-template-columns:minmax(280px,1.25fr) minmax(220px,.75fr) auto; }
.form-grid-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }

@media (max-width:980px) { .product-management-card { grid-template-columns:1fr; } .product-management-card .user-card-actions { justify-content:flex-start; } }
@media (max-width:640px) { .product-filter-bar > div:not(.product-filter-actions), .product-filter-actions { flex:1 1 100%; width:100%; } .product-filter-actions .btn, .product-filter-actions a { width:100%; text-align:center; } .form-grid-two { grid-template-columns:1fr; gap:0; } .product-management-card .user-card-actions, .product-management-card .user-card-actions form, .product-management-card .user-card-actions .btn { width:100%; } }


/* Products & Units — Phase 1 Slice 2 */
.product-record-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; margin-bottom:18px; }
.product-subrecord-panel { margin-top:18px; }
.subrecord-list { display:grid; gap:10px; margin-top:16px; }
.subrecord-row { display:grid; grid-template-columns:minmax(220px,1fr) auto auto; align-items:center; gap:14px; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft,#f8fafc); min-width:0; }
.subrecord-primary { min-width:0; display:grid; gap:3px; }
.subrecord-primary strong { overflow-wrap:anywhere; }
.subrecord-primary span { color:var(--muted); font-size:.9rem; }
.subrecord-meta,.subrecord-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.subrecord-actions form { margin:0; }
.base-unit-row { border-style:dashed; }
.inline-record-form { display:grid; grid-template-columns:minmax(180px,1.5fr) minmax(130px,.7fr) minmax(180px,1fr) auto auto; align-items:end; gap:12px; margin-top:18px; padding-top:18px; border-top:1px solid var(--border); }
.inline-record-form > div { min-width:0; }
.inline-record-form label { margin-top:0; }
.inline-check { display:flex; align-items:center; gap:8px; min-height:44px; white-space:nowrap; }
.inline-check input { width:auto; margin:0; }
.inline-edit-form { margin:0 0 12px; padding:14px; border:1px solid var(--border); border-top:1px solid var(--border); border-radius:12px; background:#fff; grid-template-columns:minmax(120px,.6fr) minmax(180px,1fr) minmax(180px,1fr) auto; }
.btn-small { padding:8px 11px; font-size:.86rem; }
@media (max-width:980px){ .product-record-grid{grid-template-columns:1fr;} .inline-record-form{grid-template-columns:repeat(2,minmax(0,1fr));} .inline-record-form .inline-check,.inline-record-form>.btn{width:100%;} .subrecord-row{grid-template-columns:minmax(0,1fr) auto;} .subrecord-actions{grid-column:1/-1;} }
@media (max-width:640px){ .inline-record-form,.inline-edit-form{grid-template-columns:1fr;} .inline-record-form>.btn,.inline-record-form .inline-check{width:100%;} .subrecord-row{grid-template-columns:1fr;} .subrecord-meta,.subrecord-actions{grid-column:1;} .subrecord-actions,.subrecord-actions form,.subrecord-actions .btn{width:100%;} }


/* Products & Units — Phase 1 Slice 2.1 terminology + CSV import v0.3.2 */
.page-action-group { display:flex; flex-wrap:wrap; gap:10px; }
.pack-structure-guide { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.pack-structure-guide > div { display:grid; gap:4px; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft,#f8fafc); }
.pack-structure-guide .eyebrow { color:var(--primary,#0563d8); font-size:.75rem; font-weight:800; letter-spacing:.08em; }
.pack-structure-guide small { color:var(--muted); }
.pack-unit-form { grid-template-columns:minmax(120px,.6fr) minmax(180px,1fr) minmax(220px,1.2fr) auto; }
.pack-unit-form .form-help { display:block; margin-top:5px; }
.import-guide-panel,.import-result-panel,.import-preview-panel { margin-top:18px; }
.import-column-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:16px; }
.import-column-grid span { display:grid; gap:2px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface-soft,#f8fafc); }
.import-column-grid small { color:var(--muted); }
.product-import-form { display:grid; grid-template-columns:minmax(220px,1.2fr) minmax(220px,1fr) minmax(200px,.8fr) auto; gap:14px; align-items:end; }
.product-import-form > div { min-width:0; }
.table-scroll { width:100%; overflow:auto; margin-top:16px; }
.import-preview-table { width:100%; border-collapse:collapse; min-width:850px; }
.import-preview-table th,.import-preview-table td { padding:12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
.import-preview-table th { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.import-row-error { background:#fff1f1; }
.import-result-panel ul { margin:12px 0 0; padding-left:22px; }
@media (max-width:980px){ .product-import-form{grid-template-columns:repeat(2,minmax(0,1fr));} .product-import-form>.btn{width:100%;} .pack-unit-form{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:640px){ .page-action-group,.page-action-group .btn{width:100%;} .pack-structure-guide,.product-import-form,.pack-unit-form{grid-template-columns:1fr;} .product-import-form>.btn,.pack-unit-form>.btn{width:100%;} }

/* Products & Units — Excel template + import quick reference v0.3.3 */
.import-template-heading { align-items:flex-start; gap:18px; }
.import-template-actions { justify-content:flex-end; }
.import-reference-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:16px; margin-top:18px; }
.import-reference-card { min-width:0; padding:16px; border:1px solid var(--border); border-radius:14px; background:var(--surface-soft,#f8fafc); }
.import-reference-card h3 { margin:0 0 12px; }
.import-reference-list { display:grid; gap:0; }
.import-reference-list > div { display:grid; grid-template-columns:minmax(150px,.42fr) minmax(0,1fr); gap:14px; padding:10px 0; border-bottom:1px solid var(--border); }
.import-reference-list > div:last-child { border-bottom:0; }
.import-reference-list span,.uom-key-grid span,.import-example-box span { color:var(--muted); }
.uom-key-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.uom-key-grid span { display:flex; gap:8px; align-items:baseline; padding:9px 10px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.uom-key-grid strong { color:var(--text); min-width:34px; }
.import-example-box { display:grid; gap:5px; margin-top:14px; padding:13px; border-radius:11px; background:#eaf2ff; }
.import-example-box strong { color:var(--text); }
@media (max-width:980px){ .import-reference-grid{grid-template-columns:1fr;} .import-template-actions{justify-content:flex-start;} }
@media (max-width:640px){ .import-template-actions,.import-template-actions .btn{width:100%;} .import-reference-list>div{grid-template-columns:1fr;gap:4px;} .uom-key-grid{grid-template-columns:1fr;} }

/* Products import result summary — v0.3.4.3 */
.import-summary-panel {
    margin: 0 0 22px;
    border-width: 1px;
    overflow: hidden;
}
.import-summary-panel.is-success {
    border-color: #abefc6;
    background: linear-gradient(180deg, #f3fff7 0%, #ffffff 100%);
}
.import-summary-panel.has-errors {
    border-color: #fecdca;
    background: linear-gradient(180deg, #fff6f5 0%, #ffffff 100%);
}
.import-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.import-summary-heading h2 {
    margin: 5px 0 6px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}
.import-summary-heading p {
    margin: 0;
    color: var(--muted);
}
.import-summary-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.import-summary-status.status-success {
    color: #067647;
    background: #dcfae6;
}
.import-summary-status.status-error {
    color: #b42318;
    background: #fee4e2;
}
.import-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding-top: 20px;
}
.import-summary-stat {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
.import-summary-stat span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.import-summary-stat strong {
    display: block;
    font-size: 32px;
    line-height: 1;
}
.import-summary-stat.stat-error {
    border-color: #fecdca;
    background: #fff6f5;
    color: #b42318;
}
@media (max-width: 760px) {
    .import-summary-heading {
        flex-direction: column;
        gap: 12px;
    }
    .import-summary-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 430px) {
    .import-summary-stats {
        grid-template-columns: 1fr;
    }
    .import-summary-stat {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }
    .import-summary-stat span {
        margin: 0;
    }
    .import-summary-stat strong {
        font-size: 28px;
    }
}


/* Location Storage Rules — v0.3.5 */
.location-storage-rule-heading {
    margin: 22px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.location-storage-rule-heading h3 { margin: 4px 0 5px; }
.location-storage-rule-heading p { margin: 0; color: var(--muted); }
.location-storage-rule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 6px;
}
.storage-rule-option {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft, #f8fafc);
}
.storage-rule-option:has(input:checked) {
    border-color: #98bdf2;
    background: #eef5ff;
}
.location-storage-preview {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}
.location-storage-preview > div {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft, #f8fafc);
}
.location-storage-preview strong { display: block; margin-bottom: 4px; }
.location-storage-preview p { margin: 0; color: var(--muted); }
.location-storage-preview .is-blocked { border-color: #fecdca; background: #fff6f5; }
@media (max-width: 700px) {
    .location-storage-rule-grid { grid-template-columns: 1fr; }
}

/* Desktop consistency polish — v0.5.3.7 */
.inventory-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1180px) {
    .inventory-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .inventory-stat-grid { grid-template-columns: 1fr; }
}

/* Inventory Foundation — v0.4.0 */
.inventory-stat-grid .stat-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}
.inventory-foundation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}
.inventory-foundation-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}
.inventory-foundation-list > div {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft, #f8fafc);
}
.inventory-foundation-list strong { display: block; margin-bottom: 4px; }
.inventory-foundation-list p { margin: 0; color: var(--muted); }
.inventory-roadmap-list {
    display: grid;
    gap: 11px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: inventory-roadmap;
}
.inventory-roadmap-list li {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    counter-increment: inventory-roadmap;
}
.inventory-roadmap-list li::before {
    content: counter(inventory-roadmap);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    grid-row: span 2;
    border-radius: 50%;
    background: #eaf2ff;
    color: #174ea6;
    font-weight: 800;
}
.inventory-roadmap-list strong { align-self: end; }
.inventory-roadmap-list span { color: var(--muted); }
.inventory-ledger-panel { margin-top: 18px; }
.inventory-empty-state { padding: 34px 18px; }
.inventory-ledger-list { display: grid; margin-top: 16px; }
.inventory-ledger-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(130px, .55fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.inventory-ledger-row > div { min-width: 0; }
.inventory-ledger-row strong,
.inventory-ledger-row span { display: block; }
.inventory-ledger-row span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.location-direct-balance-list { display: grid; gap: 8px; margin-top: 12px; }
.location-direct-balance-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.location-direct-balance-list span { min-width: 0; }
.location-direct-balance-list small { display: block; margin-top: 2px; color: var(--muted); }
.location-direct-balance-list b { white-space: nowrap; }
@media (max-width: 860px) {
    .inventory-foundation-grid { grid-template-columns: 1fr; }
    .inventory-ledger-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 520px) {
    .location-direct-balance-list a { align-items: flex-start; flex-direction: column; }
}

/* Quick Add Inventory — v0.4.1 */
.quick-add-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
    gap: 18px;
    align-items: start;
}
.quick-add-form { margin-top: 18px; }
.quick-add-form > label,
.quick-add-form .form-grid-two { margin-top: 14px; }
.quick-add-form > label:first-of-type { margin-top: 0; }
.quick-add-conversion {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #b8cff3;
    border-radius: 12px;
    background: #eef5ff;
    color: #163d78;
}
.quick-add-conversion strong { margin-right: 5px; }
.quick-add-warning {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #f3d58a;
    border-radius: 13px;
    background: #fff9e8;
    color: #6b4e00;
}
.quick-add-warning span { font-size: 13px; }
.quick-add-rules-panel { position: sticky; top: 90px; }
@media (max-width: 900px) {
    .quick-add-layout { grid-template-columns: 1fr; }
    .quick-add-rules-panel { position: static; }
}
@media (max-width: 620px) {
    .quick-add-form .form-grid-two { grid-template-columns: 1fr; }
}

/* =========================================================
   KDWT Application Shell v2.0 — mock-driven visual foundation
   ========================================================= */
:root {
    --shell-sidebar: 276px;
    --shell-sidebar-collapsed: 84px;
    --shell-topbar: 78px;
    --shell-canvas: #f7f9fc;
    --shell-ink: #10233f;
    --shell-muted: #6f8098;
    --shell-line: #e2e8f1;
    --shell-blue: #1268f3;
    --shell-blue-soft: #edf4ff;
}
body.app-shell { display:block; background:var(--shell-canvas); font-family:"Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif; color:var(--shell-ink); }
.app-frame { min-height:100vh; display:grid; grid-template-columns:var(--shell-sidebar) minmax(0,1fr); transition:grid-template-columns .22s ease; }
.app-frame.sidebar-collapsed { grid-template-columns:var(--shell-sidebar-collapsed) minmax(0,1fr); }
.app-sidebar { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; background:#fff; border-right:1px solid var(--shell-line); z-index:50; overflow:hidden; }
.sidebar-brand-row { min-height:var(--shell-topbar); display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 18px; border-bottom:1px solid var(--shell-line); }
.app-brand { min-width:0; color:var(--shell-ink); gap:12px; overflow:hidden; }
.app-brand-mark { flex:0 0 46px; width:46px; height:46px; border-radius:10px; background:transparent; color:var(--shell-ink); font-size:12px; box-shadow:none; }
.app-brand-copy { min-width:0; white-space:nowrap; }
.app-brand-copy strong { font-size:16px; letter-spacing:-.02em; }
.app-brand-copy span { display:flex; align-items:center; gap:7px; margin-top:4px; }
.app-brand-copy small { margin:0; color:var(--shell-muted); letter-spacing:0; font-size:12px; }
.app-brand-copy em { padding:3px 6px; border-radius:999px; background:var(--shell-blue-soft); color:var(--shell-blue); font-size:9px; font-style:normal; font-weight:900; }
.sidebar-close { display:none; background:transparent; font-size:28px; color:var(--shell-muted); }
.sidebar-nav { flex:1; overflow:auto; padding:18px 12px; }
.sidebar-section { margin-bottom:22px; }
.sidebar-section-title { display:block; padding:0 10px 8px; color:#8a98ad; font-size:10px; font-weight:850; letter-spacing:.12em; }
.sidebar-link { display:flex; align-items:center; gap:12px; min-height:44px; margin:3px 0; padding:9px 12px; border-radius:10px; color:#53647d; text-decoration:none; font-size:14px; font-weight:650; transition:.16s ease; }
.sidebar-link:hover { color:var(--shell-blue); background:#f5f8fd; }
.sidebar-link.active { color:var(--shell-blue); background:var(--shell-blue-soft); box-shadow:inset 3px 0 0 var(--shell-blue); }
.sidebar-icon { width:20px; height:20px; display:grid; place-items:center; flex:0 0 20px; }
.sidebar-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.sidebar-collapse { min-height:58px; display:flex; align-items:center; gap:12px; padding:0 22px; border-top:1px solid var(--shell-line); background:#fff; color:#708097; font-weight:700; }
.app-frame.sidebar-collapsed .app-brand-copy,
.app-frame.sidebar-collapsed .sidebar-section-title,
.app-frame.sidebar-collapsed .sidebar-label { display:none; }
.app-frame.sidebar-collapsed .sidebar-brand-row { justify-content:center; padding-inline:10px; }
.app-frame.sidebar-collapsed .sidebar-link { justify-content:center; padding-inline:10px; }
.app-frame.sidebar-collapsed .sidebar-collapse { justify-content:center; padding-inline:10px; }
.app-workspace { min-width:0; min-height:100vh; display:flex; flex-direction:column; }
.app-topbar { position:sticky; top:0; z-index:40; min-height:var(--shell-topbar); display:grid; grid-template-columns:minmax(280px,520px) auto; justify-content:space-between; align-items:center; gap:24px; padding:0 30px; background:rgba(255,255,255,.95); backdrop-filter:blur(14px); border-bottom:1px solid var(--shell-line); }
.mobile-menu-button { display:none; width:42px; height:42px; border-radius:10px; background:#f4f7fb; color:var(--shell-ink); }
.topbar-search { min-height:44px; display:flex; align-items:center; gap:12px; padding:0 14px; border:1px solid #dbe3ee; border-radius:11px; background:#fff; color:#7b8ba0; box-shadow:0 2px 8px rgba(17,35,62,.03); text-align:left; }
.topbar-search span:nth-child(2) { flex:1; }
.topbar-search kbd { padding:4px 7px; border:1px solid #e2e8f1; border-radius:6px; background:#f6f8fb; color:#8090a4; font-size:11px; }
.topbar-tools { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.topbar-icon { width:40px; height:40px; border-radius:10px; background:transparent; color:#61738c; font-weight:800; }
.topbar-icon:hover { background:#f3f6fa; color:var(--shell-blue); }
.account-menu { position:relative; }
.account-menu summary { list-style:none; display:flex; align-items:center; gap:9px; cursor:pointer; padding:4px 6px; border-radius:10px; }
.account-menu summary::-webkit-details-marker { display:none; }
.account-avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:#eaf2ff; color:var(--shell-blue); font-size:13px; font-weight:900; }
.account-name { font-size:14px; font-weight:750; }
.account-popover { position:absolute; right:0; top:52px; width:210px; display:grid; gap:4px; padding:14px; border:1px solid var(--shell-line); border-radius:14px; background:#fff; box-shadow:0 18px 45px rgba(16,35,63,.14); }
.account-popover small { color:var(--shell-muted); margin-bottom:8px; }
.account-popover a { padding:9px 10px; border-radius:8px; color:var(--shell-ink); text-decoration:none; }
.account-popover a:hover { background:#f4f7fb; color:var(--shell-blue); }
.app-main { width:100%; max-width:none; margin:0; padding:22px 30px 40px; flex:1; }
.app-breadcrumbs { margin-bottom:18px; }
.app-breadcrumbs ol { padding:0; }
.app-footer { min-height:54px; display:flex; align-items:center; justify-content:space-between; padding:0 30px; background:#fff; border-top:1px solid var(--shell-line); color:#8593a6; font-size:12px; }
.page-header,.hero { box-shadow:none; border-color:var(--shell-line); }

/* Dashboard v2 */
.dashboard-titlebar { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin:4px 0 24px; }
.dashboard-titlebar h1 { margin:0 0 6px; font-size:32px; line-height:1.1; letter-spacing:-.035em; }
.dashboard-titlebar p { margin:0; color:var(--shell-muted); }
.shell-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; margin-bottom:20px; }
.shell-kpi-card { min-height:124px; display:flex; align-items:center; gap:17px; padding:22px; border:1px solid var(--shell-line); border-radius:14px; background:#fff; box-shadow:0 5px 18px rgba(16,35,63,.035); }
.kpi-icon { width:52px; height:52px; display:grid; place-items:center; flex:0 0 52px; border-radius:14px; font-size:24px; font-weight:900; }
.kpi-blue{background:#eaf2ff;color:#1268f3}.kpi-green{background:#ebf9f0;color:#159757}.kpi-purple{background:#f2edff;color:#7446e8}.kpi-amber{background:#fff5e5;color:#e58a00}
.shell-kpi-card div { min-width:0; }
.shell-kpi-card small { display:block; color:#74839a; font-size:10px; font-weight:850; letter-spacing:.08em; }
.shell-kpi-card strong { display:block; margin:5px 0 4px; font-size:28px; letter-spacing:-.03em; }
.shell-kpi-card p { margin:0; color:#8190a3; font-size:12px; }
.dashboard-panel { border:1px solid var(--shell-line); border-radius:15px; background:#fff; box-shadow:0 5px 18px rgba(16,35,63,.03); }
.quick-actions-panel { padding:20px; margin-bottom:20px; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.panel-heading h2 { margin:0 0 4px; font-size:17px; letter-spacing:-.02em; }
.panel-heading p { margin:0; color:var(--shell-muted); font-size:13px; }
.panel-heading a { font-size:13px; font-weight:750; text-decoration:none; }
.quick-action-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.quick-action-card { min-height:126px; display:grid; grid-template-columns:48px 1fr auto; align-items:center; gap:14px; padding:18px; border:1px solid var(--shell-line); border-radius:13px; text-align:left; text-decoration:none; color:var(--shell-ink); background:#fff; }
.quick-action-card>span { width:48px; height:48px; display:grid; place-items:center; border-radius:12px; font-size:22px; font-weight:900; }
.quick-action-card strong { display:block; margin-bottom:6px; font-size:14px; }
.quick-action-card p { margin:0; color:#65768e; font-size:12px; line-height:1.45; }
.quick-action-card b { color:currentColor; font-size:20px; }
.qa-blue{background:#f8fbff}.qa-blue>span{background:#e7f1ff;color:#1268f3}.qa-green{background:#f8fdfa}.qa-green>span{background:#e5f8ed;color:#159757}.qa-purple{background:#fbf9ff}.qa-purple>span{background:#efe9ff;color:#7446e8}.qa-amber{background:#fffdf8}.qa-amber>span{background:#fff2d9;color:#e58a00}
.quick-action-card:hover { transform:translateY(-1px); box-shadow:0 10px 22px rgba(16,35,63,.07); }
.dashboard-lower-grid { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:20px; }
.operations-summary,.recent-activity-panel { padding:20px; }
.operation-list { display:grid; }
.operation-list>div { display:grid; grid-template-columns:12px 1fr auto; align-items:center; gap:10px; min-height:52px; border-top:1px solid #edf1f6; }
.operation-list>div:first-child { border-top:0; }
.operation-list span:nth-child(2) { font-size:13px; }
.operation-list strong { color:#53647c; font-size:12px; }
.status-dot { width:8px;height:8px;border-radius:50%;}.status-dot.success{background:#24b36b}.status-dot.warning{background:#f1a11a}.status-dot.muted{background:#a9b4c2}
.activity-list { display:grid; }
.activity-row { display:grid; grid-template-columns:72px 110px minmax(160px,1fr) auto minmax(150px,auto); align-items:center; gap:12px; min-height:62px; border-top:1px solid #edf1f6; }
.activity-row:first-child { border-top:0; }
.activity-row time,.activity-row small { color:#718198; font-size:11px; }
.activity-row div strong,.activity-row div small { display:block; }
.activity-type { width:max-content; padding:5px 7px; border-radius:999px; font-size:9px; font-weight:900; }
.activity-type.positive{background:#e8f8ef;color:#118e51}.activity-type.negative{background:#fff0f0;color:#cc3a3a}.activity-qty{font-size:12px;font-weight:850}.activity-qty.positive{color:#159757}.activity-qty.negative{color:#d13b3b}
.activity-empty { padding:40px 10px; text-align:center; color:var(--shell-muted); }

@media (max-width:1180px){
 .shell-kpi-grid,.quick-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .dashboard-lower-grid{grid-template-columns:1fr}
 .activity-row{grid-template-columns:65px 100px 1fr auto}.activity-row>small:last-child{grid-column:3/-1}
}
@media (max-width:860px){
 .app-frame,.app-frame.sidebar-collapsed{display:block}
 .app-sidebar{position:fixed;left:0;top:0;width:min(86vw,300px);transform:translateX(-105%);box-shadow:0 20px 60px rgba(10,25,50,.25);transition:transform .22s ease}
 .app-sidebar.mobile-open{transform:translateX(0)}
 .sidebar-close{display:block}.sidebar-collapse{display:none}
 .app-frame.sidebar-collapsed .app-brand-copy,.app-frame.sidebar-collapsed .sidebar-section-title,.app-frame.sidebar-collapsed .sidebar-label{display:initial}
 .app-frame.sidebar-collapsed .sidebar-link{justify-content:flex-start;padding-inline:12px}
 .app-topbar{grid-template-columns:auto minmax(0,1fr) auto;padding:0 16px;gap:10px}.mobile-menu-button{display:block}
 .topbar-search{min-width:0}.topbar-search span:nth-child(2),.topbar-search kbd,.account-name{display:none}
 .app-main{padding:18px 16px 34px}.app-footer{padding:0 16px}
 .sidebar-backdrop{position:fixed;inset:0;background:rgba(7,20,38,.45);z-index:45}
 body.nav-open{overflow:hidden}
}
@media (max-width:640px){
 .shell-kpi-grid,.quick-action-grid{grid-template-columns:1fr}
 .dashboard-titlebar{align-items:stretch;flex-direction:column}.dashboard-title-actions .btn{width:100%}
 .activity-row{grid-template-columns:1fr auto;gap:6px;padding:12px 0}.activity-row time{grid-column:1}.activity-type{grid-column:2;grid-row:1}.activity-row div{grid-column:1/-1}.activity-qty{grid-column:1}.activity-row>small:last-child{grid-column:2;text-align:right}
 .app-footer{flex-direction:column;justify-content:center;gap:4px;padding-block:10px}
}

/* =========================================================
   Shell v2.0.1 — Mobile brand containment fix
   ========================================================= */
@media (max-width: 860px) {
    .app-sidebar {
        width: min(92vw, 340px);
    }

    .sidebar-brand-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding-inline: 14px;
    }

    .app-brand {
        width: 100%;
        min-width: 0;
        gap: 10px;
        overflow: visible;
    }

    .app-brand-copy {
        min-width: 0;
        white-space: normal;
    }

    .app-brand-copy strong {
        display: block;
        max-width: 100%;
        font-size: 15px;
        line-height: 1.08;
        overflow-wrap: normal;
    }

    .sidebar-close {
        flex: 0 0 auto;
    }
}

/* =========================================================
   Shell v2.0.2 — Responsive content containment lock
   Prevent legacy directory cards from escaping the workspace
   at desktop/tablet transition widths.
   ========================================================= */
.app-workspace,
.app-main,
.app-main > *,
.panel,
.user-management-list,
.user-management-card,
.product-management-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.product-management-card > *,
.product-management-card .user-card-primary,
.product-management-card .user-card-meta,
.product-management-card .user-card-actions {
    min-width: 0;
    max-width: 100%;
}

.product-management-card .user-card-name,
.product-management-card .user-card-username,
.product-management-card .badge {
    overflow-wrap: anywhere;
}

/* The sidebar reduces usable content width long before the viewport
   reaches mobile size. Reflow product cards sooner instead of squeezing. */
@media (max-width: 1280px) {
    .product-management-card {
        grid-template-columns: minmax(0, 1fr) minmax(170px, .55fr);
        gap: 16px;
    }

    .product-management-card .user-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 1040px) {
    .product-management-card {
        grid-template-columns: 1fr !important;
    }

    .product-management-card .user-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
    }

    .product-management-card .user-card-actions form {
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .product-management-card .user-card-actions,
    .product-management-card .user-card-actions form,
    .product-management-card .user-card-actions .btn,
    .product-management-card .user-card-actions form button {
        width: 100%;
        max-width: 100%;
    }
}

/* =========================================================
   Shell v2.0.3 — Mobile wordmark lock
   Give the full KD Warehouse Tools name a deliberate two-line
   mobile layout so it can never be clipped by the close control.
   ========================================================= */
@media (max-width: 860px) {
    .app-sidebar {
        width: min(96vw, 360px);
    }

    .sidebar-brand-row {
        grid-template-columns: minmax(0, 1fr) 36px;
        column-gap: 10px;
        padding: 13px 12px;
    }

    .app-brand {
        display: flex;
        align-items: center;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .app-brand-copy {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        overflow: visible;
        white-space: normal;
    }

    .app-brand-copy strong {
        display: block;
        width: 100%;
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: normal;
        word-break: normal;
        font-size: 14px;
        line-height: 1.08;
    }

    .app-brand-copy span {
        flex-wrap: wrap;
        gap: 5px;
    }

    .sidebar-close {
        width: 36px;
        min-width: 36px;
        padding: 0;
        justify-self: end;
    }
}

@media (max-width: 390px) {
    .app-brand-copy strong {
        max-width: none;
        font-size: 13px;
    }
}

/* =========================================================
   Shell v2.1 — Operate / Manage / Maintain + User Favorites
   ========================================================= */
.sidebar-brand-row {
    align-items: flex-start;
    min-width: 0;
}
.app-brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}
.app-brand-copy {
    min-width: 0;
    white-space: normal;
    overflow: visible;
}
.app-brand-copy strong {
    display: flex;
    flex-wrap: wrap;
    column-gap: .28em;
    line-height: 1.08;
    white-space: normal;
}
.app-brand-copy strong span {
    display: inline;
    margin: 0;
}
.app-brand-context {
    min-width: 0;
    flex-wrap: wrap;
}

.sidebar-nav {
    padding: 14px 12px 20px;
}
.sidebar-favorites {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--shell-line);
}
.sidebar-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-right: 9px;
}
.favorite-help {
    color: #f3a515;
    font-size: 12px;
}
.favorite-list {
    display: grid;
    gap: 3px;
}
.favorite-empty {
    margin: 0 10px;
    padding: 10px 11px;
    border: 1px dashed #d6dfeb;
    border-radius: 9px;
    color: #7c8ba0;
    font-size: 12px;
    line-height: 1.35;
}
.nav-category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 0 4px 14px;
    padding: 4px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    background: #f6f8fb;
}
.nav-category-tab {
    min-width: 0;
    min-height: 36px;
    padding: 7px 5px;
    border-radius: 7px;
    background: transparent;
    color: #6f7f95;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .01em;
}
.nav-category-tab:hover {
    color: var(--shell-blue);
    background: #fff;
}
.nav-category-tab.active {
    color: #fff;
    background: var(--shell-blue);
    box-shadow: 0 4px 12px rgba(20, 100, 225, .2);
}
.sidebar-category-panel {
    display: none;
}
.sidebar-category-panel.active {
    display: block;
}
.sidebar-module-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    gap: 2px;
}
.sidebar-module-row .sidebar-link {
    min-width: 0;
    margin-right: 0;
}
.sidebar-module-row .sidebar-label {
    min-width: 0;
}
.sidebar-module-row .sidebar-label strong,
.sidebar-module-row .sidebar-label small {
    display: block;
}
.sidebar-module-row .sidebar-label strong {
    color: inherit;
    font-size: 13px;
}
.sidebar-module-row .sidebar-label small {
    margin-top: 2px;
    overflow: hidden;
    color: #8a98aa;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.favorite-row .sidebar-label {
    font-size: 13px;
    font-weight: 750;
}
.favorite-toggle {
    width: 28px;
    height: 32px;
    padding: 0;
    border-radius: 7px;
    background: transparent;
    color: #9aa8ba;
    font-size: 17px;
    line-height: 1;
}
.favorite-toggle:hover {
    color: #f3a515;
    background: #fff8e8;
}
.favorite-toggle.is-favorite {
    color: #f3a515;
}
.favorite-toggle:disabled {
    opacity: .45;
    cursor: wait;
}

.app-frame.sidebar-collapsed .sidebar-favorites,
.app-frame.sidebar-collapsed .nav-category-tabs,
.app-frame.sidebar-collapsed .favorite-toggle,
.app-frame.sidebar-collapsed .sidebar-category-panel .sidebar-label small {
    display: none;
}
.app-frame.sidebar-collapsed .sidebar-category-panel.active {
    display: block;
}
.app-frame.sidebar-collapsed .sidebar-module-row {
    display: block;
}

@media (max-width: 860px) {
    .app-sidebar {
        width: min(92vw, 340px);
    }
    .sidebar-brand-row {
        min-height: 92px;
        gap: 12px;
        padding: 16px 16px 15px;
    }
    .app-brand {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr);
        align-items: center;
        gap: 13px;
        width: calc(100% - 42px);
    }
    .app-brand-mark {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 15px;
        font-size: 13px;
    }
    .app-brand-copy strong {
        display: block;
        font-size: clamp(17px, 4.7vw, 20px);
        line-height: 1.02;
    }
    .app-brand-copy strong span {
        display: block;
        width: 100%;
    }
    .app-brand-context {
        display: flex;
        margin-top: 7px;
    }
    .app-brand-copy small {
        max-width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }
    .sidebar-close {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        margin-top: 7px;
    }
    .nav-category-tab {
        font-size: 12px;
    }
    .sidebar-module-row .sidebar-label small {
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .app-sidebar {
        width: 96vw;
    }
    .sidebar-brand-row {
        padding-inline: 13px;
    }
    .app-brand {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 11px;
    }
    .app-brand-mark {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }
    .app-brand-copy strong {
        font-size: 17px;
    }
}

/* =========================================================
   Locations + Products responsive workspace — authoritative
   Desktop and mobile layouts are scoped to their module roots.
   ========================================================= */
.location-module,
.product-module {
    min-width: 0;
}

.location-overview-grid,
.product-overview-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
}
.location-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.location-status-card,
.product-status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 112px;
    padding: 18px 20px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
}
.location-status-card::after,
.product-status-card::after {
    content: '';
    position: absolute;
    right: -22px;
    bottom: -34px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(36, 119, 255, .07);
}
.location-status-card.is-current,
.product-status-card.is-current {
    background: #f4f8ff;
    border-color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}
.location-status-card span,
.location-status-card strong,
.product-status-card span,
.product-status-card strong,
.product-status-card small { position: relative; z-index: 1; }
.location-status-card span,
.product-status-card span {
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.location-status-card strong,
.product-status-card strong {
    margin-top: 8px;
    font-size: 2rem;
    line-height: 1;
}
.product-status-card small {
    margin-top: auto;
    padding-top: 10px;
    color: var(--muted);
}

.location-directory-panel,
.product-directory-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}
.location-directory-heading,
.product-directory-heading {
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}
.location-directory-panel > .empty-state,
.product-directory-panel > .empty-state { margin: 24px; }
.location-directory-list,
.product-directory-list { margin: 0; }

/* Filters */
.location-workspace-filter,
.product-workspace-filter {
    margin: 0;
    padding: 18px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.location-workspace-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
}
.location-workspace-filter > div,
.product-workspace-filter-fields > div { min-width: 0; }
.location-workspace-filter label,
.product-workspace-filter label {
    display: block;
    margin-bottom: 6px;
}
.location-workspace-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-workspace-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}
.product-workspace-filter-fields {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(170px, 225px);
    gap: 16px;
    min-width: 0;
}
.product-workspace-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

/* Location bulk controls */
.location-workspace-bulk {
    display: grid;
    gap: 12px;
    margin: 20px 24px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}
.location-workspace-bulk-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    min-width: 0;
}
.location-select-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 750;
}
.location-select-all input[type="checkbox"],
.location-card-select input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 3px;
    box-shadow: none;
    flex: 0 0 18px;
}
.location-selected-count { color: var(--muted); font-weight: 700; }
.location-workspace-bulk-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 210px) minmax(160px, 210px) minmax(190px, 240px);
    gap: 10px;
    min-width: 0;
}
.location-workspace-bulk-controls > * { min-width: 0; }
.location-workspace-bulk-controls .btn { width: 100%; }
.location-workspace-bulk-controls .btn-primary { grid-column: auto; }

/* Location rows */
.location-workspace-card {
    display: grid;
    grid-template-columns: 28px minmax(280px, 1fr) minmax(250px, .78fr);
    grid-template-areas:
        "select primary meta"
        ". actions actions";
    align-items: start;
    gap: 16px 22px;
    min-width: 0;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}
.location-workspace-card:last-child { border-bottom: 0; }
.location-workspace-card > * { min-width: 0; }
.location-card-select { grid-area: select; padding-top: 3px; }
.location-workspace-primary { grid-area: primary; }
.location-workspace-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.location-workspace-name { margin: 0; font-size: 1.02rem; }
.location-code-link { color: var(--text); text-decoration: none; }
.location-code-link:hover { color: var(--primary); }
.location-workspace-description {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.location-workspace-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.location-workspace-meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(90px, .55fr);
    gap: 14px;
    margin: 0;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}
.location-workspace-meta > div,
.product-workspace-meta > div { min-width: 0; }
.location-workspace-meta dt,
.product-workspace-meta dt {
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.location-workspace-meta dd,
.product-workspace-meta dd {
    margin: 4px 0 0;
    padding: 0;
    font-weight: 750;
    overflow-wrap: anywhere;
}
.location-workspace-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.location-workspace-actions form,
.product-workspace-actions form { margin: 0; }
.location-workspace-actions .btn,
.product-workspace-actions .btn { white-space: nowrap; }
.location-workspace-card-no-select {
    grid-template-columns: minmax(280px, 1fr) minmax(250px, .78fr);
    grid-template-areas:
        "primary meta"
        "actions actions";
}

/* Product rows */
.product-workspace-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
    grid-template-areas:
        "primary meta"
        "actions actions";
    align-items: start;
    gap: 16px 24px;
    min-width: 0;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}
.product-workspace-card:last-child { border-bottom: 0; }
.product-workspace-card > * { min-width: 0; }
.product-workspace-primary { grid-area: primary; }
.product-workspace-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.product-workspace-sku { margin: 0; font-size: 1.02rem; }
.product-workspace-sku a { color: var(--text); text-decoration: none; }
.product-workspace-sku a:hover { color: var(--primary); }
.product-workspace-description {
    margin: 5px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.product-workspace-barcode {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 9px;
    margin-top: 11px;
}
.product-workspace-barcode span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.product-workspace-barcode strong { font-size: .88rem; overflow-wrap: anywhere; }
.product-workspace-meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}
.product-workspace-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1220px) {
    .location-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .location-workspace-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .location-workspace-card,
    .location-workspace-card-no-select {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-areas:
            "select primary"
            ". meta"
            ". actions";
    }
    .location-workspace-card-no-select {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "primary" "meta" "actions";
    }
    .location-workspace-meta {
        padding-left: 0;
        border-left: 0;
    }
    .product-workspace-filter { grid-template-columns: minmax(0, 1fr); }
    .product-workspace-filter-actions { justify-content: flex-start; }
    .location-workspace-bulk-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .location-workspace-bulk-controls select { grid-column: 1 / -1; }
    .location-workspace-bulk-controls .btn-primary { grid-column: auto; }
}

/* Phone workspace. Scoped and intentionally stronger than shared legacy rules. */
/* Intermediate product summary density — v0.6.12.2 */
@media screen and (min-width: 861px) and (max-width: 1180px) {
    .product-module .product-status-card {
        min-height: 96px;
        padding: 14px 16px;
    }

    .product-module .product-status-card strong {
        margin-top: 6px;
        font-size: 1.75rem;
    }

    .product-module .product-status-card small {
        padding-top: 6px;
    }
}

@media screen and (max-width: 860px) {
    .page-header,
    .hero {
        padding: 16px;
        gap: 14px;
    }
    .page-header h1,
    .hero h1 { font-size: 28px; }
    .page-header-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }
    .page-header-actions .btn { width: 100%; }

    .location-module .location-overview-grid,
    .product-module .product-overview-grid {
        gap: 10px;
        margin-bottom: 16px;
    }
    .location-module .location-overview-grid,
    .product-module .product-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .product-module .product-status-card:last-child { grid-column: 1 / -1; }
    .location-module .location-status-card,
    .product-module .product-status-card {
        min-height: 86px;
        padding: 12px;
        border-radius: 15px;
    }
    .location-module .location-status-card span,
    .product-module .product-status-card span { font-size: .66rem; }
    .location-module .location-status-card strong,
    .product-module .product-status-card strong { font-size: 1.45rem; }
    .product-module .product-status-card small { padding-top: 7px; font-size: .72rem; }

    .location-module .location-directory-heading,
    .product-module .product-directory-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 10px;
        padding: 17px 16px 14px;
    }
    .location-module .location-directory-heading h2,
    .product-module .product-directory-heading h2 { font-size: 1.45rem; line-height: 1.15; }
    .location-module .location-directory-heading p,
    .product-module .product-directory-heading p { margin-top: 5px; font-size: .92rem; line-height: 1.35; }

    .location-module .location-workspace-filter,
    .product-module .product-workspace-filter,
    .product-module .product-workspace-filter-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        min-width: 0;
    }
    .location-module .location-workspace-filter,
    .product-module .product-workspace-filter { padding: 15px 16px; }
    .location-module .location-workspace-filter-actions,
    .product-module .product-workspace-filter-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        justify-content: stretch;
        gap: 8px;
        min-width: 0;
    }
    .location-module .location-workspace-filter-actions .btn:first-child,
    .product-module .product-workspace-filter-actions .btn:first-child { width: 100%; }

    .location-module .location-workspace-bulk {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin: 14px 16px 0;
        padding: 13px;
    }
    .location-module .location-workspace-bulk-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }
    .location-module .location-select-all {
        display: inline-flex;
        width: max-content;
        max-width: 100%;
    }
    .location-module .location-workspace-bulk-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
    .location-module .location-workspace-bulk-controls > *,
    .location-module .location-workspace-bulk-controls .btn,
    .location-module .location-workspace-bulk-controls .btn-primary {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
    }
    .location-module .location-select-all input[type="checkbox"],
    .location-module .location-card-select input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        min-height: 18px !important;
        max-height: 18px !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }

    .location-module .location-workspace-card,
    .location-module .location-workspace-card-no-select {
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr);
        grid-template-areas:
            "select primary"
            ". meta"
            ". actions";
        gap: 11px 12px;
        padding: 16px;
    }
    .location-module .location-workspace-card-no-select {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "primary" "meta" "actions";
    }
    .location-module .location-card-select {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 2px 0 0;
    }
    .location-module .location-workspace-name { font-size: 1rem; }
    .location-module .location-workspace-description { font-size: .92rem; }
    .location-module .location-workspace-badges { margin-top: 8px; gap: 5px; }
    .location-module .location-workspace-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .location-module .location-workspace-meta > div,
    .product-module .product-workspace-meta > div {
        display: grid;
        grid-template-columns: 86px minmax(0, 1fr);
        align-items: start;
        gap: 8px;
        margin: 0;
        padding: 0;
    }
    .location-module .location-workspace-meta dt,
    .product-module .product-workspace-meta dt {
        padding-top: 2px;
        font-size: .68rem;
    }
    .location-module .location-workspace-meta dd,
    .product-module .product-workspace-meta dd {
        margin: 0;
        padding: 0;
        font-size: .9rem;
        line-height: 1.35;
    }
    .location-module .location-workspace-actions,
    .product-module .product-workspace-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }
    .location-module .location-workspace-actions > *,
    .product-module .product-workspace-actions > *,
    .location-module .location-workspace-actions form,
    .product-module .product-workspace-actions form,
    .location-module .location-workspace-actions .btn,
    .product-module .product-workspace-actions .btn,
    .location-module .location-workspace-actions form .btn,
    .product-module .product-workspace-actions form .btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .location-module .location-workspace-actions .btn,
    .product-module .product-workspace-actions .btn {
        min-height: 42px;
        padding: 9px 10px;
        justify-content: center;
        white-space: normal;
        text-align: center;
        font-size: .84rem;
        line-height: 1.1;
    }

    .product-module .product-workspace-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "primary" "meta" "actions";
        gap: 12px;
        padding: 16px;
    }
    .product-module .product-workspace-description { font-size: .92rem; }
    .product-module .product-workspace-barcode { margin-top: 9px; }
    .product-module .product-workspace-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin: 0;
        padding: 0;
        border: 0;
    }
}

@media screen and (max-width: 430px) {
    .location-module .location-directory-heading,
    .product-module .product-directory-heading {
        grid-template-columns: minmax(0, 1fr);
    }
    .location-module .location-directory-heading .badge,
    .product-module .product-directory-heading .badge { width: max-content; }
    .location-module .location-workspace-actions,
    .product-module .product-workspace-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Inventory Transactions v0.6.0 */
/* ==========================================================
   Inventory Transactions v0.6.0.2 — operational workspace
   ========================================================== */
.transaction-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
    gap: 24px;
    align-items: start;
}
.transaction-panel,
.transaction-activity { min-width: 0; }
.transaction-form { margin-top: 20px; }

.transaction-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.transaction-mode label {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}
.transaction-mode input[type="radio"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.transaction-mode label > span {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 78px;
    padding: 16px 18px 16px 52px;
    border: 1px solid var(--border-color, #d9e2ef);
    border-radius: 14px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.transaction-mode label > span::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 18px;
    width: 20px;
    height: 20px;
    border: 2px solid #a9b8cc;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: inset 0 0 0 4px #fff;
}
.transaction-mode input:checked + span {
    border-color: #1677ff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
    background: #f5f9ff;
}
.transaction-mode input:checked + span::before {
    border-color: #1677ff;
    background: #1677ff;
}
.transaction-mode input:focus-visible + span {
    outline: 3px solid rgba(22, 119, 255, .22);
    outline-offset: 2px;
}
.transaction-mode strong { line-height: 1.25; }
.transaction-mode small {
    color: var(--text-muted, #6d7d95);
    line-height: 1.35;
}

.transaction-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--border-color, #e1e8f1);
}
.transaction-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eaf2ff;
    color: #0565e8;
    font-weight: 800;
}
.transaction-step-body { min-width: 0; }
.transaction-step-body > label,
.transaction-step-body > .form-grid-two,
.transaction-step-body > textarea { margin-top: 10px; }
.transaction-step-body > label:first-child { margin-top: 0; }

.picker-wrap { position: relative; }
.picker-results {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(20, 43, 78, .16);
    padding: 6px;
}
.picker-result {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}
.picker-result:hover,
.picker-result:focus { background: #f1f6ff; outline: none; }
.picker-result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-result small { color: #71819a; }
.picker-empty { padding: 16px; color: #71819a; }

.selected-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #dce7f4;
    border-radius: 12px;
    background: #f8fbff;
}
.selected-record strong { min-width: 0; overflow-wrap: anywhere; }
.text-button {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #0969e8;
    font-weight: 800;
    cursor: pointer;
}
.transaction-conversion {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eefaf3;
    color: #166534;
    line-height: 1.45;
}
.transaction-conversion.is-error { background: #fff1f1; color: #b42318; }

.transaction-review {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #dfe8f3;
    border-radius: 14px;
    background: #f5f8fc;
}
.transaction-review > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #e4ebf4;
    border-radius: 10px;
    background: #fff;
}
.transaction-review span {
    font-size: 11px;
    color: #73839a;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 800;
}
.transaction-review strong {
    display: block;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.transaction-warning {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff7e8;
    border: 1px solid #f3dfb5;
}
.transaction-warning strong,
.transaction-warning span { display: block; }
.transaction-warning span { font-size: 13px; color: #6f5a2f; line-height: 1.45; }

.transaction-activity { position: sticky; top: 88px; }
.transaction-activity-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.transaction-activity-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #e6edf5;
}
.transaction-activity-row:first-child { border-top: 0; }
a.transaction-activity-row {
    color: inherit;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
a.transaction-activity-row:hover {
    background: #f7faff;
    box-shadow: 0 0 0 8px #f7faff;
    transform: translateX(2px);
}
a.transaction-activity-row:focus-visible {
    outline: 3px solid rgba(37, 117, 252, .28);
    outline-offset: 4px;
    background: #f7faff;
}
.transaction-activity-row div { display: flex; flex-direction: column; min-width: 0; }
.transaction-activity-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #74839a; }
.transaction-activity-row b { white-space: nowrap; }
.transaction-activity-row b.positive { color: #17854b; }
.transaction-activity-row b.negative { color: #c43c3c; }
.transaction-activity-row b.neutral { color: #53657d; }
.activity-type.neutral { background: #eef2f6; color: #53657d; }

[data-inventory-transaction] [hidden] { display: none !important; }

@media (max-width: 1050px) {
    .transaction-shell { grid-template-columns: 1fr; }
    .transaction-activity { position: static; }
}

@media (max-width: 680px) {
    .transaction-shell { gap: 16px; }
    .transaction-panel,
    .transaction-activity { padding: 16px; }
    .transaction-panel .panel-title-row,
    .transaction-activity .panel-title-row { display: block; }
    .transaction-panel .panel-title-row .status-pill { display: inline-flex; margin-top: 10px; }
    .transaction-panel .panel-title-row h2,
    .transaction-activity .panel-title-row h2 { font-size: 25px; line-height: 1.12; }
    .transaction-panel .panel-title-row p,
    .transaction-activity .panel-title-row p { line-height: 1.45; }
    .transaction-form { margin-top: 16px; }

    .transaction-mode { grid-template-columns: 1fr; gap: 9px; margin-bottom: 18px; }
    .transaction-mode label > span {
        min-height: 66px;
        padding: 13px 14px 13px 48px;
    }
    .transaction-mode label > span::before { left: 15px; width: 19px; height: 19px; }

    .transaction-step {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 16px 0;
    }
    .transaction-step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .transaction-step-body label { line-height: 1.35; }
    .form-grid-two { grid-template-columns: 1fr; gap: 12px; }

    .picker-result { grid-template-columns: 1fr; gap: 3px; }
    .picker-results { max-height: 250px; }
    .selected-record { align-items: flex-start; padding: 12px; }
    .selected-record .text-button { min-height: auto; padding: 2px 0 2px 8px; }

    .transaction-review { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
    .transaction-review > div {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 11px 12px;
    }
    .transaction-review span { padding-top: 2px; }

    .transaction-warning { padding: 13px 14px; }
    .transaction-panel .form-actions { gap: 10px; margin-top: 18px; }
    .transaction-panel .form-actions .btn { min-height: 48px; }

    .transaction-activity-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 8px 10px;
    }
    .transaction-activity-row > b {
        grid-column: 2;
        justify-self: start;
    }
    .transaction-activity-row small { white-space: normal; line-height: 1.35; }
}



/* Product record — live location inventory v0.6.1.4 */
.product-inventory-panel,
.product-movement-locations-panel { min-width:0; container-type:inline-size; container-name:product-inventory; }
.product-inventory-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:16px 0; }
.product-inventory-summary > div { display:grid; gap:4px; padding:13px; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft,#f8fafc); }
.product-inventory-summary span { color:var(--muted); font-size:.78rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.product-inventory-summary strong { font-size:1.05rem; overflow-wrap:anywhere; }
.product-inventory-list { display:grid; gap:10px; }
.product-inventory-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:16px; padding:14px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.product-inventory-location { min-width:0; display:grid; gap:3px; }
.product-inventory-location strong { font-size:1rem; overflow-wrap:anywhere; }
.product-inventory-location span { font-weight:700; overflow-wrap:anywhere; }
.product-inventory-location small { color:var(--muted); overflow-wrap:anywhere; }
.product-inventory-quantities { display:grid; grid-template-columns:repeat(3,minmax(64px,auto)) auto; align-items:end; gap:12px; text-align:right; }
.product-inventory-quantities > span { display:grid; gap:2px; }
.product-inventory-quantities small { color:var(--muted); font-size:.72rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.product-inventory-quantities strong { font-size:1rem; }
.product-inventory-quantities em { color:var(--muted); font-style:normal; font-weight:800; padding-bottom:1px; }
.product-inventory-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
@container product-inventory (max-width:620px) {
    .product-inventory-summary { grid-template-columns:1fr; }
    .product-inventory-row { grid-template-columns:1fr; gap:12px; }
    .product-inventory-quantities { grid-template-columns:repeat(3,minmax(0,1fr)); text-align:left; }
    .product-inventory-quantities em { grid-column:1/-1; }
    .product-inventory-actions, .product-inventory-actions .btn { width:100%; }
    .product-inventory-actions .btn { text-align:center; }
}

/* Inventory History v0.6.2 */
.history-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:end}.history-filter-grid label{display:grid;gap:7px;font-weight:700}.history-filter-grid input,.history-filter-grid select{width:100%}.history-filter-actions{display:flex;gap:10px;align-items:center}.history-list{display:grid}.history-row{display:grid;grid-template-columns:minmax(260px,1.4fr) minmax(210px,1fr) minmax(220px,1fr) 24px;gap:18px;align-items:center;padding:18px 4px;border-top:1px solid var(--border-color,#dfe5ea);color:inherit;text-decoration:none}.history-row:hover{background:rgba(30,91,120,.04)}.history-row>div{display:grid;gap:4px;min-width:0}.history-row span{color:var(--text-muted,#687681);overflow-wrap:anywhere}.history-row-main{grid-template-columns:auto 1fr;align-items:center}.history-row-main>span:last-child{grid-column:1/-1}.history-type{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:5px 9px;font-size:.75rem;font-weight:800;letter-spacing:.03em;background:#eef4f7;color:#254b60}.history-type-adjustment_in{background:#e9f7ef;color:#23633c}.history-type-adjustment_out{background:#fff0ed;color:#9b3528}.history-type-cycle_count{background:#f2edff;color:#5d3ca1}.history-type-move{background:#eaf4ff;color:#245f94}.history-row-arrow{font-size:1.7rem;color:#78909c}.history-pagination{display:flex;justify-content:space-between;align-items:center;padding-top:20px}.history-detail-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:20px}.history-detail-list{display:grid;margin:20px 0 0}.history-detail-list>div{display:grid;grid-template-columns:140px 1fr;gap:18px;padding:14px 0;border-top:1px solid var(--border-color,#dfe5ea)}.history-detail-list dt{font-weight:800;color:var(--text-muted,#687681)}.history-detail-list dd{margin:0;font-weight:700;overflow-wrap:anywhere}.history-detail-list small{display:block;margin-top:4px;font-weight:400;color:var(--text-muted,#687681)}
@media(max-width:1280px){.history-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.history-row{grid-template-columns:1fr 1fr}.history-row-arrow{display:none}.history-row>div:nth-child(3){grid-column:1/-1}.history-detail-grid{grid-template-columns:1fr}}
@media(max-width:600px){.history-filter-grid{grid-template-columns:1fr}.history-filter-actions{display:grid;grid-template-columns:1fr 1fr}.history-row{grid-template-columns:1fr;gap:12px;padding:18px 0}.history-row>div:nth-child(3){grid-column:auto}.history-row-main{grid-template-columns:auto 1fr}.history-detail-list>div{grid-template-columns:1fr;gap:5px}.history-pagination{gap:10px;flex-wrap:wrap}.history-pagination .btn{flex:1}}

/* Inventory History v0.6.2.1 — desktop/mobile display polish */
.history-filter-panel,
.history-filter-grid,
.history-filter-grid > *,
.history-list,
.history-row,
.history-row > div {
    min-width: 0;
}

.history-filter-grid input,
.history-filter-grid select,
.history-filter-actions,
.history-filter-actions .btn {
    min-width: 0;
    max-width: 100%;
}

.history-filter-grid input[type="date"] {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
}

.history-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.history-filter-actions .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
}

.history-row > div strong,
.history-row > div span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1400px) {
    .history-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-filter-actions {
        grid-column: 1 / -1;
        max-width: 420px;
        justify-self: end;
    }

    .history-row {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
        gap: 12px 18px;
        padding: 18px 4px;
    }

    .history-row > div:nth-child(3) {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px dashed var(--border-color, #dfe5ea);
    }

    .history-row-arrow {
        display: none;
    }
}

@media (max-width: 680px) {
    .history-filter-panel {
        padding: 16px;
    }

    .history-filter-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .history-filter-grid label {
        min-width: 0;
        width: 100%;
    }

    .history-filter-actions {
        grid-column: auto;
        justify-self: stretch;
        max-width: none;
        gap: 10px;
    }

    .history-filter-actions .btn {
        min-height: 48px;
        padding-inline: 12px;
    }

    .history-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 18px 0;
    }

    .history-row > div:nth-child(3) {
        grid-column: auto;
    }

    .history-row-main {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .history-row-main > strong {
        align-self: center;
    }

    .history-row > div:not(.history-row-main) {
        padding: 0;
        border: 0;
    }

    .history-row > div:nth-child(2) {
        padding-top: 10px;
        border-top: 1px solid var(--border-color, #dfe5ea);
    }

    .history-row > div:nth-child(3) {
        padding-top: 10px;
        border-top: 1px dashed var(--border-color, #dfe5ea);
    }
}

@media (max-width: 390px) {
    .history-filter-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Inventory History v0.6.2.2 — structural responsive correction */
.history-filter-panel { overflow: hidden; }
.history-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: end !important;
    width: 100% !important;
}
.history-filter-field {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
}
.history-filter-field > span { font-weight: 800; }
.history-filter-field input,
.history-filter-field select {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.history-filter-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    min-width: 0 !important;
    width: 100% !important;
}
.history-filter-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: center !important;
}
.history-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1fr) 20px !important;
    gap: 18px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.history-row-product,
.history-row-movement,
.history-row-audit { min-width: 0 !important; }

@media (max-width: 1280px) {
    .history-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .history-filter-actions {
        grid-column: 1 / -1 !important;
        max-width: 440px !important;
        justify-self: end !important;
    }
    .history-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) !important;
        gap: 14px 20px !important;
    }
    .history-row-audit {
        grid-column: 1 / -1 !important;
        padding-top: 10px !important;
        border-top: 1px dashed var(--border-color, #dfe5ea) !important;
    }
    .history-row-arrow { display: none !important; }
}

@media (max-width: 680px) {
    .history-filter-panel { padding: 16px !important; }
    .history-filter-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }
    .history-filter-actions {
        grid-column: auto !important;
        justify-self: stretch !important;
        max-width: none !important;
    }
    .history-filter-field input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        inline-size: 100% !important;
        min-inline-size: 0 !important;
    }
    .history-row {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 18px 0 !important;
    }
    .history-row-product,
    .history-row-movement,
    .history-row-audit {
        grid-column: auto !important;
        width: 100% !important;
    }
    .history-row-movement,
    .history-row-audit {
        padding-top: 10px !important;
        border-top: 1px solid var(--border-color, #dfe5ea) !important;
    }
    .history-row-main {
        grid-template-columns: auto minmax(0, 1fr) !important;
    }
}

@media (max-width: 390px) {
    .history-filter-actions { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Inventory transactions — clickable recent activity mobile polish v0.6.2.4 */
@media (max-width: 680px) {
    .transaction-activity-list {
        gap: 0;
        margin-top: 10px;
    }

    a.transaction-activity-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "type details quantity";
        align-items: center;
        gap: 10px;
        min-height: 0;
        padding: 14px 0;
        border-radius: 0;
        box-shadow: none;
        transform: none;
    }

    a.transaction-activity-row:hover,
    a.transaction-activity-row:active {
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    .transaction-activity-row .activity-type {
        grid-area: type;
        align-self: center;
    }

    .transaction-activity-row > div {
        grid-area: details;
        min-width: 0;
        gap: 2px;
    }

    .transaction-activity-row > div strong {
        line-height: 1.15;
    }

    .transaction-activity-row small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }

    .transaction-activity-row > b {
        grid-area: quantity;
        grid-column: auto;
        justify-self: end;
        align-self: center;
        margin: 0;
        font-size: 1rem;
        line-height: 1.1;
    }
}

@media (max-width: 390px) {
    a.transaction-activity-row {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "type details"
            ". quantity";
        row-gap: 5px;
    }

    .transaction-activity-row > b {
        justify-self: start;
    }
}

/* v0.6.3 Product Movement */
.product-movement-summary-grid { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:20px; }
.product-movement-identity { display:flex; flex-direction:column; justify-content:center; }
.product-movement-identity h2 { margin:.35rem 0 .25rem; font-size:clamp(1.8rem,3vw,2.5rem); }
.product-movement-identity p { margin:0; color:var(--muted); font-size:1.02rem; }
.product-movement-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.product-movement-locations-panel { margin-top:20px; }
.product-movement-filter-panel { margin-top:20px; }
.product-movement-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:end; min-width:0; }
.product-movement-filter-grid > * { min-width:0; }
.product-movement-filter-grid input,
.product-movement-filter-grid select { width:100%; min-width:0; }
.product-movement-filter-grid .history-filter-actions { grid-column:1/-1; justify-content:flex-end; }
.product-movement-timeline .history-row-main { grid-template-columns:auto 1fr; }
.product-movement-timeline .history-row-main > span:last-child { grid-column:1/-1; }

@media (max-width: 980px) {
    .product-movement-summary-grid { grid-template-columns:1fr; }
    .product-movement-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
    .product-movement-filter-grid { grid-template-columns:1fr; }
    .product-movement-filter-grid .history-filter-actions { display:grid; grid-template-columns:1fr 1fr; }
    .product-movement-filter-grid .history-filter-actions .btn { width:100%; text-align:center; }
    .product-movement-timeline .history-row-main { grid-template-columns:auto 1fr; }
}


/* =========================================================
   Dashboard recent activity containment — v0.6.3.1
   ========================================================= */
.recent-activity-panel { min-width: 0; overflow: hidden; }
.recent-activity-panel .activity-list { min-width: 0; }
.recent-activity-panel .activity-row {
    grid-template-columns: 64px 96px minmax(0, 1fr) 72px minmax(0, 118px);
    column-gap: 10px;
    width: 100%;
    min-width: 0;
}
.recent-activity-panel .activity-row > * { min-width: 0; }
.recent-activity-panel .activity-row div strong,
.recent-activity-panel .activity-row div small,
.recent-activity-panel .activity-row > small:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-activity-panel .activity-qty { text-align: right; white-space: normal; line-height: 1.15; }

@media (max-width: 1320px) and (min-width: 1181px) {
    .recent-activity-panel .activity-row {
        grid-template-columns: 58px 88px minmax(0, 1fr) 64px;
    }
    .recent-activity-panel .activity-row > small:last-child {
        grid-column: 3 / -1;
        padding-bottom: 8px;
    }
}

@media (max-width: 1180px) {
    .recent-activity-panel .activity-row {
        grid-template-columns: 60px 92px minmax(0, 1fr) 70px;
    }
    .recent-activity-panel .activity-row > small:last-child {
        grid-column: 3 / -1;
    }
}

@media (max-width: 640px) {
    .recent-activity-panel .activity-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
    }
    .recent-activity-panel .activity-row > small:last-child {
        grid-column: 2;
        max-width: 130px;
    }
}

/* v0.6.4 Location History */
.location-history-summary-grid { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:20px; }
.location-history-identity { display:flex; flex-direction:column; justify-content:center; }
.location-history-identity h2 { margin:.35rem 0 .25rem; font-size:clamp(1.8rem,3vw,2.5rem); }
.location-history-identity p { margin:0; color:var(--muted); font-size:1.02rem; }
.location-history-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.location-history-balance-panel { container-type:inline-size; container-name:location-balance; min-width:0; }
.location-history-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:18px; }
.location-history-summary > div { min-width:0; padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface-soft,#f7f9fa); }
.location-history-summary span { display:block; color:var(--muted); font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.location-history-summary strong { display:block; margin-top:5px; font-size:1.2rem; white-space:nowrap; }


@container location-balance (max-width: 620px) {
    .location-history-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@container location-balance (max-width: 360px) {
    .location-history-summary { grid-template-columns:1fr; }
}
.location-history-unit-note { margin:12px 0 0; color:var(--muted); font-size:.84rem; }
.location-history-contents-panel,
.location-history-filter-panel { margin-top:20px; }
.location-history-product-list { display:grid; }
.location-history-product-row { display:grid; grid-template-columns:minmax(240px,1.5fr) repeat(3,minmax(110px,.55fr)) 20px; gap:16px; align-items:center; padding:16px 4px; border-top:1px solid var(--border); color:inherit; text-decoration:none; }
.location-history-product-row:hover,
.location-history-product-row:focus-visible { background:rgba(30,91,120,.04); outline:none; }
.location-history-product-copy { display:grid; gap:3px; min-width:0; }
.location-history-product-copy small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.location-history-product-copy em { color:var(--muted); font-size:.78rem; font-style:normal; }
.location-history-product-qty { display:grid; gap:3px; text-align:right; }
.location-history-product-qty small { color:var(--muted); font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.location-history-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:end; min-width:0; }
.location-history-filter-grid > * { min-width:0; }
.location-history-filter-grid input,
.location-history-filter-grid select { width:100%; min-width:0; }
.location-history-filter-grid .history-filter-actions { grid-column:1/-1; justify-content:flex-end; }
.product-location-history-link { display:grid; gap:3px; color:inherit; text-decoration:none; border-radius:8px; }
.product-location-history-link:hover strong,
.product-location-history-link:focus-visible strong { text-decoration:underline; }
.product-location-history-link:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }

@media (max-width:980px) {
    .location-history-summary-grid { grid-template-columns:1fr; }
    .location-history-product-row { grid-template-columns:minmax(220px,1fr) repeat(3,minmax(90px,.45fr)); }
    .location-history-product-row .history-row-arrow { display:none; }
    .location-history-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:640px) {
    .location-history-product-row { grid-template-columns:1fr 1fr; gap:10px; padding:16px 0; }
    .location-history-product-copy { grid-column:1/-1; }
    .location-history-product-copy small { white-space:normal; }
    .location-history-product-qty { text-align:left; padding:10px; border:1px solid var(--border); border-radius:12px; }
    .location-history-product-qty:last-of-type { grid-column:1/-1; }
    .location-history-filter-grid { grid-template-columns:1fr; }
    .location-history-filter-grid .history-filter-actions { display:grid; grid-template-columns:1fr 1fr; }
    .location-history-filter-grid .history-filter-actions .btn { width:100%; text-align:center; }
}

/* =========================================================
   Shell v2.1.11 — KDWT mobile brand identity
   ========================================================= */
.app-brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-brand:hover .app-brand-mark,
.app-brand:focus-visible .app-brand-mark,
.topbar-mobile-brand:hover img,
.topbar-mobile-brand:focus-visible img {
    filter: drop-shadow(0 5px 10px rgba(16, 35, 63, .14));
}

.topbar-mobile-brand {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--shell-ink);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: -.02em;
}

.topbar-mobile-brand img {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

@media (max-width: 860px) {
    .app-topbar {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        grid-template-areas: "menu brand search tools";
        min-height: 78px;
    }

    .mobile-menu-button { grid-area: menu; }
    .topbar-mobile-brand { display: flex; grid-area: brand; }
    .topbar-search { grid-area: search; }
    .topbar-tools { grid-area: tools; }
}

@media (max-width: 640px) {
    .app-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "menu brand tools"
            "search search search";
        gap: 10px 12px;
        padding: 12px 16px;
    }

    .topbar-mobile-brand {
        justify-self: start;
        font-size: 16px;
    }

    .topbar-search {
        width: 100%;
        min-height: 42px;
    }

    .topbar-search span:nth-child(2) {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 390px) {
    .app-topbar {
        padding-inline: 12px;
    }

    .topbar-mobile-brand span {
        display: none;
    }

    .topbar-mobile-brand img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .topbar-tools {
        gap: 3px;
    }

    .topbar-icon {
        width: 36px;
        height: 36px;
    }
}

/* Utility bar contextual help */
.utility-help-open { overflow: hidden; }
.utility-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    justify-content: flex-end;
    background: rgba(12, 27, 48, .46);
    opacity: 0;
    transition: opacity .16s ease;
}
.utility-help-backdrop[hidden] { display: none; }
.utility-help-backdrop.is-open { opacity: 1; }
.utility-help-panel {
    width: min(480px, 92vw);
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    box-shadow: -18px 0 50px rgba(14, 31, 55, .18);
    transform: translateX(24px);
    transition: transform .16s ease;
}
.utility-help-backdrop.is-open .utility-help-panel { transform: translateX(0); }
.utility-help-header,
.utility-help-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-color: var(--shell-line, #e2e8f0);
}
.utility-help-header { border-bottom: 1px solid var(--shell-line, #e2e8f0); }
.utility-help-header h2 { margin: 5px 0 0; font-size: 23px; line-height: 1.2; }
.utility-help-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: #f3f6fa;
    color: #40536d;
    font-size: 25px;
    line-height: 1;
}
.utility-help-close:hover,
.utility-help-close:focus-visible { background: #e8f1ff; color: var(--shell-blue, #1769d2); }
.utility-help-body { min-height: 0; overflow-y: auto; padding: 22px; }
.utility-help-section + .utility-help-section { margin-top: 24px; }
.utility-help-section h3 { margin: 0 0 12px; font-size: 15px; color: #233954; }
.utility-help-intro { margin: 0; color: #53667e; font-size: 15px; line-height: 1.7; }
.utility-help-actions { display: grid; gap: 10px; margin: 0; padding-left: 22px; color: #334b66; }
.utility-help-actions li { padding-left: 4px; line-height: 1.55; }
.utility-help-faq-list { display: grid; gap: 9px; }
.utility-help-faq {
    border: 1px solid #e1e8f0;
    border-radius: 11px;
    background: #fbfcfe;
    overflow: hidden;
}
.utility-help-faq summary {
    cursor: pointer;
    padding: 13px 15px;
    color: #29415d;
    font-weight: 800;
    list-style-position: inside;
}
.utility-help-faq[open] summary { background: #f2f7ff; color: var(--shell-blue, #1769d2); }
.utility-help-faq p { margin: 0; padding: 0 15px 15px; color: #5d6f84; line-height: 1.6; }
.utility-help-tip {
    margin-top: 24px;
    padding: 15px 16px;
    border-left: 4px solid var(--shell-blue, #1769d2);
    border-radius: 0 10px 10px 0;
    background: #eef6ff;
}
.utility-help-tip strong { display: block; color: #1f4f88; }
.utility-help-tip p { margin: 5px 0 0; color: #48647f; line-height: 1.55; }
.utility-help-footer {
    border-top: 1px solid var(--shell-line, #e2e8f0);
    color: #7a899b;
    font-size: 12px;
}

@media (max-width: 720px) {
    .utility-help-backdrop { align-items: flex-end; justify-content: stretch; }
    .utility-help-panel {
        width: 100%;
        height: min(82vh, 720px);
        border-radius: 20px 20px 0 0;
        transform: translateY(24px);
    }
    .utility-help-backdrop.is-open .utility-help-panel { transform: translateY(0); }
    .utility-help-header,
    .utility-help-footer { padding: 17px 18px; }
    .utility-help-header h2 { font-size: 20px; }
    .utility-help-body { padding: 18px; }
    .utility-help-footer span { max-width: 58%; }
}

/* ==========================================================
   Utility Bar v0.6.7 — Scanner action menu
   ========================================================== */
.utility-scanner-wrap { position: relative; }
.utility-scanner-wrap.is-open .topbar-icon {
    background: #eef5ff;
    color: var(--shell-blue, #1769d2);
}
.utility-scanner-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1150;
    width: min(330px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--shell-line, #e2e8f0);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(13, 27, 42, .2);
}
.utility-scanner-menu[hidden] { display: none; }
.utility-scanner-menu-heading {
    display: grid;
    gap: 4px;
    padding: 16px 17px 13px;
    border-bottom: 1px solid var(--shell-line, #e2e8f0);
}
.utility-scanner-menu-heading strong { color: #243a55; font-size: 15px; }
.utility-scanner-action {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    border-radius: 0;
    padding: 14px 16px;
    background: #fff;
    color: #263f5c;
    text-align: left;
}
.utility-scanner-action:last-child { border-bottom: 0; }
.utility-scanner-action:hover,
.utility-scanner-action:focus-visible { background: #f2f7ff; color: var(--shell-blue, #1769d2); }
.utility-scanner-action-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #edf4fd;
    color: #245d9d;
    font-size: 20px;
    font-weight: 900;
}
.utility-scanner-action span:last-child { display: grid; gap: 3px; min-width: 0; }
.utility-scanner-action strong { font-size: 14px; }
.utility-scanner-action small { color: #6d7f94; font-size: 12px; line-height: 1.4; }

@media (max-width: 720px) {
    .utility-scanner-menu {
        position: fixed;
        top: 90px;
        right: 12px;
        bottom: auto;
        left: 12px;
        width: auto;
        max-height: calc(100dvh - 102px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 17px;
        box-shadow: 0 24px 70px rgba(13, 27, 42, .28);
    }
    .utility-scanner-menu-heading { padding: 17px 18px 14px; }
    .utility-scanner-action { min-height: 68px; padding: 14px 18px; }
}

@media (max-width: 640px) {
    .utility-scanner-menu {
        top: 132px;
        max-height: calc(100dvh - 144px);
    }
}

@media (max-width: 640px) and (max-height: 560px) {
    .utility-scanner-menu {
        top: 12px;
        max-height: calc(100dvh - 24px);
    }
}

/* ==========================================================
   Tools v0.6.8 — Generic Barcode Generator
   ========================================================== */
.barcode-generator-page {
    max-width: 1220px;
    container-type: inline-size;
    container-name: barcode-page;
}
.barcode-generator-workspace {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 0;
    overflow: hidden;
    padding: 0;
}
.barcode-generator-form-panel,
.barcode-generator-preview-panel { padding: 26px; }
.barcode-generator-form-panel { border-right: 1px solid var(--shell-line, #e2e8f0); }
.barcode-generator-form { display: grid; gap: 18px; margin-top: 24px; }
.barcode-generator-form .form-group { display: grid; gap: 7px; }
.barcode-generator-form label { color: #243a55; font-size: 13px; font-weight: 850; }
.barcode-generator-form textarea { min-height: 92px; resize: vertical; }
.barcode-generator-form small { color: #728197; line-height: 1.45; }
.barcode-generator-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px;
    gap: 14px;
}
.barcode-generator-check {
    display: inline-flex !important;
    width: fit-content;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    margin: -2px 0 0;
    padding: 9px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #243a55 !important;
    font-weight: 750 !important;
    line-height: 1.35;
    cursor: pointer;
}
.barcode-generator-check:hover { border-color: #bfd0e5; background: #f3f7fc; }
.barcode-generator-check:focus-within {
    border-color: #2b78ff;
    box-shadow: 0 0 0 3px rgba(43, 120, 255, .14);
}
.barcode-generator-check input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: #1677ff;
}
.barcode-generator-check span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}
.barcode-generator-form .barcode-generator-check {
    box-sizing: border-box;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    align-items: center;
    margin: 0;
}
.barcode-generator-form .barcode-generator-check input[type="checkbox"] {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 22px;
    min-height: 22px;
    padding: 0;
}
.barcode-generator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: -2px; }
.barcode-generator-status {
    min-height: 22px;
    margin: 0;
    color: #68798e;
    font-size: 13px;
    line-height: 1.5;
}
.barcode-generator-status.is-success { color: #12724a; font-weight: 750; }
.barcode-generator-status.is-error { color: #b42318; font-weight: 750; }
.barcode-generator-preview-panel { display: flex; min-width: 0; flex-direction: column; background: #f6f8fb; }
.barcode-generator-preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.barcode-generator-preview-heading h2 { margin: 4px 0 0; }
.barcode-preview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.barcode-generator-preview {
    min-height: 390px;
    display: grid;
    place-items: center;
    padding: 22px;
    border: 1px dashed #c8d3df;
    border-radius: 16px;
    background: #e9eef5;
}
.barcode-label-card {
    width: min(100%, 520px);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 34px 30px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #fff;
    color: #000;
    box-shadow: 0 12px 30px rgba(13, 27, 42, .12);
    text-align: center;
}
.barcode-label-heading { font-size: clamp(20px, 3vw, 34px); line-height: 1.1; letter-spacing: .02em; }
.barcode-label-items { width: 100%; display: grid; gap: 16px; }
.barcode-label-item { min-width: 0; display: grid; gap: 7px; place-items: center; }
.barcode-label-graphic { width: 100%; display: grid; place-items: center; overflow: hidden; }
.barcode-label-graphic svg { display: block; max-width: 100%; background: #fff; }
.barcode-generator-preview[data-type="qr"] .barcode-label-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.barcode-generator-preview[data-type="qr"] .barcode-label-graphic svg { width: min(100%, 230px); height: auto; }
.barcode-label-card[data-orientation="landscape"] { width: min(100%, 720px); min-height: 300px; }
.barcode-label-card[data-orientation="landscape"] .barcode-label-items { gap: 12px 18px; }
.barcode-label-value {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(16px, 2.6vw, 26px);
    font-weight: 800;
    letter-spacing: .04em;
}
.barcode-preview-empty { display: grid; gap: 8px; padding: 50px 18px; color: #6f7e91; }
.barcode-preview-empty strong { color: #334a65; font-size: 18px; }
.barcode-generator-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-left: 4px solid #314a67;
    border-radius: 0 10px 10px 0;
    background: #fff;
}
.barcode-generator-note strong { color: #243a55; }
.barcode-generator-note p { margin: 5px 0 0; color: #66788d; line-height: 1.55; }
.barcode-print-area { display: none; }
.barcode-label-card:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border: 0;
    border-radius: 0;
    padding: clamp(24px, 6vw, 80px);
    box-shadow: none;
}
.barcode-generator-preview.is-screen-full {
    position: fixed;
    inset: 0;
    z-index: 2000;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    background: #fff;
}
.barcode-generator-preview.is-screen-full .barcode-label-card { width: min(92vw, 1000px); max-width: none; box-shadow: none; }

@media (max-width: 960px) {
    .barcode-generator-workspace { grid-template-columns: 1fr; }
    .barcode-generator-form-panel { border-right: 0; border-bottom: 1px solid var(--shell-line, #e2e8f0); }
}

@media (max-width: 640px) {
    .barcode-generator-form-panel,
    .barcode-generator-preview-panel { padding: 20px 18px; }
    .barcode-generator-field-grid { grid-template-columns: 1fr; }
    .barcode-generator-preview-heading { align-items: stretch; flex-direction: column; }
    .barcode-preview-actions { justify-content: stretch; }
    .barcode-preview-actions .btn { flex: 1 1 0; }
    .barcode-generator-preview { min-height: 320px; padding: 12px; }
    .barcode-label-card { min-height: 270px; padding: 26px 18px; }
}


/* Container-aware responsiveness for the barcode workspace.
   The app sidebar can leave a narrow content column even when the browser
   viewport is wider than a traditional mobile breakpoint. */
@container barcode-page (max-width: 920px) {
    .barcode-generator-workspace { grid-template-columns: minmax(0, 1fr); }
    .barcode-generator-form-panel {
        border-right: 0;
        border-bottom: 1px solid var(--shell-line, #e2e8f0);
    }
}

@container barcode-page (max-width: 680px) {
    .barcode-generator-field-grid { grid-template-columns: minmax(0, 1fr); }
    .barcode-generator-field-grid > *,
    .barcode-generator-form .form-group,
    .barcode-generator-form select,
    .barcode-generator-form input:not([type="checkbox"]),
    .barcode-generator-form textarea {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .barcode-generator-preview-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .barcode-preview-actions { justify-content: stretch; }
    .barcode-preview-actions .btn { flex: 1 1 0; }
}

@media print {
    html,
    body {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }
    body.is-barcode-printing > *:not(.barcode-print-area) { display: none !important; }
    body.is-barcode-printing .barcode-print-area { display: block !important; }
    .barcode-print-area {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .barcode-print-area.is-portrait { width: 4in; }
    .barcode-print-area.is-landscape { width: 6in; }
    .barcode-print-area .barcode-label-card {
        box-sizing: border-box;
        display: flex !important;
        justify-content: center;
        gap: .16in;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-after: always;
        break-after: page;
        overflow: hidden;
    }
    .barcode-print-area.is-portrait .barcode-label-card {
        width: 4in !important;
        height: 6in !important;
        min-height: 6in !important;
        padding: .30in .24in !important;
    }
    .barcode-print-area.is-landscape .barcode-label-card {
        width: 6in !important;
        height: 4in !important;
        min-height: 4in !important;
        padding: .22in .30in !important;
    }
    .barcode-print-area .barcode-label-card:last-child {
        page-break-after: auto;
        break-after: auto;
    }
    .barcode-print-area .barcode-label-heading {
        font-size: 22pt !important;
        line-height: 1.05;
    }
    .barcode-print-area .barcode-label-items {
        width: 100%;
        display: grid !important;
        gap: .10in !important;
        align-content: center;
    }
    .barcode-print-area .barcode-label-item {
        min-height: 0;
        gap: .03in !important;
        break-inside: avoid;
    }
    .barcode-print-area .barcode-label-value {
        font-size: 12pt !important;
        line-height: 1.05;
    }
    .barcode-print-area .barcode-label-graphic svg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: .92in !important;
    }
    .barcode-print-area [data-type="qr"] .barcode-label-items,
    .barcode-print-area .barcode-label-card:has(.barcode-label-item:nth-child(2)) .barcode-label-items {
        align-content: center;
    }
    .barcode-print-area .barcode-label-item:only-child .barcode-label-graphic svg {
        max-height: 2.0in !important;
    }
    .barcode-print-area .barcode-label-items:has(.barcode-label-item:nth-child(4)) .barcode-label-graphic svg {
        max-height: .66in !important;
    }
    .barcode-print-area .barcode-label-items:has(.barcode-label-item:nth-child(5)) .barcode-label-graphic svg,
    .barcode-print-area .barcode-label-items:has(.barcode-label-item:nth-child(6)) .barcode-label-graphic svg {
        max-height: .48in !important;
    }
    .barcode-print-area .barcode-label-items:has(.barcode-label-item .barcode-label-graphic svg[aria-label^="QR code"]) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .12in !important;
    }
    .barcode-print-area .barcode-label-items:has(.barcode-label-item .barcode-label-graphic svg[aria-label^="QR code"]) .barcode-label-graphic svg {
        width: 1.18in !important;
        height: 1.18in !important;
        max-height: 1.18in !important;
    }
}

/* Receiving module — Slice 1 */
.receiving-workspace,.receiving-detail-shell{display:grid;gap:22px}.receiving-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.receiving-kpi-grid article{background:#fff;border:1px solid var(--border,#d8e1ee);border-radius:18px;padding:20px;display:grid;gap:5px;box-shadow:0 10px 28px rgba(15,38,72,.05)}.receiving-kpi-grid small,.receipt-summary-bar small{font-size:.72rem;font-weight:900;letter-spacing:.11em;color:#71809a}.receiving-kpi-grid strong{font-size:2rem;color:#0d2748}.receiving-kpi-grid span{color:#71809a}.receiving-filter-bar{display:grid;grid-template-columns:minmax(260px,1.5fr) minmax(180px,.6fr) auto;gap:16px;align-items:end;padding:18px}.receiving-filter-bar>div{display:grid;gap:7px}.receiving-filter-actions{display:flex!important;grid-auto-flow:column;grid-template-columns:none!important;gap:10px!important}.receiving-directory{display:grid;gap:12px}.receiving-card{position:relative;display:grid;grid-template-columns:minmax(240px,.9fr) minmax(420px,1.6fr) auto;gap:24px;align-items:center;padding:20px 58px 20px 22px;background:#fff;border:1px solid var(--border,#d8e1ee);border-radius:18px;text-decoration:none;color:inherit;box-shadow:0 8px 24px rgba(15,38,72,.04);transition:.16s ease}.receiving-card:hover{border-color:#9db9e6;transform:translateY(-1px);box-shadow:0 12px 30px rgba(15,38,72,.08)}.receiving-card-number{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.receiving-card-number>span{font-weight:900;color:#1263df;letter-spacing:.03em}.receiving-card h2{margin:8px 0 3px;font-size:1.22rem;color:#0d2748}.receiving-card p{margin:0;color:#71809a}.receiving-card-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0}.receiving-card-meta div{min-width:0}.receiving-card-meta dt,.receipt-detail-card dt{font-size:.7rem;font-weight:900;letter-spacing:.08em;color:#7b89a0;text-transform:uppercase}.receiving-card-meta dd,.receipt-detail-card dd{margin:4px 0 0;color:#172c49;font-weight:700;overflow-wrap:anywhere}.receiving-card-arrow{position:absolute;right:22px;font-size:1.5rem;color:#1263df}.receipt-status{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:5px 9px;font-size:.72rem;font-style:normal;font-weight:900;letter-spacing:.04em;text-transform:uppercase}.receipt-status-draft{background:#eaf1ff;color:#245fbd}.receipt-status-receiving{background:#e9f8ef;color:#187545}.receipt-status-review{background:#fff4d8;color:#8a5b00}.receipt-status-finalized{background:#e9f7f4;color:#126a60}.receipt-status-cancelled{background:#f2f4f7;color:#667085}.receiving-form-shell{max-width:1060px}.receiving-form-panel{padding:24px}.receiving-form-panel form{display:grid;gap:17px}.receiving-form-panel textarea{resize:vertical;min-height:110px}.receiving-slice-notice{border-left:4px solid #2477f3;background:#f1f6ff;border-radius:0 14px 14px 0;padding:14px 16px}.receiving-slice-notice strong{color:#0d2748}.receiving-slice-notice p{margin:4px 0 0;color:#5d6f8b}.receipt-summary-bar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:#dbe4f1;border:1px solid #dbe4f1;border-radius:18px;overflow:hidden}.receipt-summary-bar>div{background:#fff;padding:18px;display:grid;gap:5px}.receipt-summary-bar>div>strong:not(.receipt-status){font-size:1.03rem;color:#0d2748}.receipt-summary-bar span:not(.receipt-status){color:#71809a;font-size:.86rem}.receipt-detail-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:18px}.receipt-detail-card{padding:22px}.receipt-detail-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:20px 0 0}.receipt-detail-card dl div{border-top:1px solid #e4eaf2;padding-top:12px}.receipt-notes{color:#51637f;line-height:1.65}.receipt-lines-placeholder{display:flex;justify-content:space-between;align-items:center;padding:26px;border-style:dashed;background:#f8faff}.receipt-lines-placeholder h2{margin:5px 0}.receipt-lines-placeholder p{margin:0;max-width:720px;color:#61728d}.receipt-placeholder-icon{font-size:3rem;color:#9bb8df}.form-grid-three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.form-grid-three>div{display:grid;gap:7px}
@media(max-width:1080px){.receiving-card{grid-template-columns:1fr;padding-right:54px}.receiving-card-meta{grid-template-columns:repeat(2,minmax(0,1fr))}.receipt-detail-grid{grid-template-columns:1fr}.receipt-summary-bar{grid-template-columns:repeat(2,minmax(0,1fr))}.receiving-header-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.receiving-kpi-grid{grid-template-columns:1fr}.receiving-filter-bar{grid-template-columns:1fr}.receiving-filter-actions{justify-content:flex-start}.receiving-card{padding:18px 48px 18px 18px}.receiving-card-meta{grid-template-columns:1fr 1fr}.receipt-summary-bar{grid-template-columns:1fr}.receipt-detail-card dl{grid-template-columns:1fr}.form-grid-three{grid-template-columns:1fr}.receipt-lines-placeholder{align-items:flex-start}.receipt-placeholder-icon{display:none}}
@media(max-width:480px){.receiving-card-meta{grid-template-columns:1fr}.receiving-card-number{align-items:flex-start;flex-direction:column}.receiving-filter-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.receiving-filter-actions .btn{width:100%}}

/* Receiving module — Slice 2 receipt lines */
.receiving-line-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.receiving-line-kpis article{background:#fff;border:1px solid var(--border,#d8e1ee);border-radius:16px;padding:18px;display:grid;gap:5px;box-shadow:0 8px 22px rgba(15,38,72,.04)}.receiving-line-kpis small{font-size:.69rem;font-weight:900;letter-spacing:.1em;color:#71809a}.receiving-line-kpis strong{font-size:1.65rem;color:#0d2748}.receiving-line-kpis span{color:#71809a;font-size:.84rem}.receipt-lines-panel{padding:22px;min-width:0}.receipt-lines-heading{align-items:center;gap:16px}.receipt-lines-heading h2{margin:4px 0}.receipt-lines-heading p{margin:0;color:#61728d}.receipt-lines-empty{padding:38px 18px;text-align:center;display:grid;justify-items:center;gap:10px}.receipt-lines-empty>span{font-size:2.8rem;color:#9ab4da}.receipt-lines-empty h3,.receipt-lines-empty p{margin:0}.receipt-lines-empty p{max-width:620px;color:#687994}.receipt-lines-table-wrap{overflow:auto;border:1px solid #e0e7f1;border-radius:14px}.receipt-lines-table{width:100%;border-collapse:collapse;min-width:1080px}.receipt-lines-table th{background:#f4f7fb;color:#60718d;font-size:.68rem;letter-spacing:.08em;text-align:left;text-transform:uppercase;padding:12px;border-bottom:1px solid #dfe7f2}.receipt-lines-table td{padding:14px 12px;border-bottom:1px solid #e8edf4;vertical-align:top;color:#223955}.receipt-lines-table tbody tr:last-child td{border-bottom:0}.receipt-lines-table td>strong{display:block;color:#0d2748}.receipt-lines-table td>span,.receipt-lines-table td>small{display:block;margin-top:3px;color:#71809a;font-size:.8rem}.receipt-line-actions{display:flex;gap:8px;align-items:flex-start}.receipt-line-actions form{margin:0}.receipt-hold-badge,.receipt-available-badge{display:inline-flex!important;width:max-content;border-radius:999px;padding:4px 8px;font-size:.69rem!important;font-weight:900;letter-spacing:.04em;text-transform:uppercase}.receipt-hold-badge{background:#fff0e8;color:#a94418}.receipt-available-badge{background:#e9f8ef;color:#187545}.receipt-line-product-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:16px}.receipt-line-product-grid>div{display:grid;gap:7px}.receipt-product-description{border:1px solid #dbe4f1;border-radius:14px;background:#f8faff;padding:12px 14px;align-content:center}.receipt-product-description span{font-size:.7rem;font-weight:900;letter-spacing:.08em;color:#72819a;text-transform:uppercase}.receipt-product-description strong{color:#0d2748;line-height:1.35}.field-note{margin:6px 0 0;color:#71809a;font-size:.78rem;line-height:1.4}.btn-small{min-height:36px!important;padding:7px 11px!important;font-size:.78rem!important}.receipt-line-form-shell{max-width:1120px}
@media(max-width:1180px){.receiving-line-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.receipt-line-product-grid{grid-template-columns:1fr}}
@media(max-width:760px){.receiving-line-kpis{grid-template-columns:1fr 1fr}.receipt-lines-panel{padding:16px}.receipt-lines-heading{align-items:flex-start;flex-direction:column}.receipt-lines-heading .btn{width:100%}.receipt-lines-table-wrap{border:0;overflow:visible}.receipt-lines-table{min-width:0;display:block}.receipt-lines-table thead{display:none}.receipt-lines-table tbody{display:grid;gap:12px}.receipt-lines-table tr{display:grid;border:1px solid #dfe7f2;border-radius:14px;background:#fff;padding:8px 14px;box-shadow:0 6px 18px rgba(15,38,72,.04)}.receipt-lines-table td{display:grid;grid-template-columns:118px minmax(0,1fr);gap:10px;border-bottom:1px solid #edf1f6;padding:10px 0}.receipt-lines-table td:last-child{border-bottom:0}.receipt-lines-table td::before{content:attr(data-label);font-size:.67rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#7a889f}.receipt-line-actions{display:grid!important;grid-template-columns:118px minmax(0,1fr)!important}.receipt-line-actions::before{grid-column:1}.receipt-line-actions>a,.receipt-line-actions>form{grid-column:2}.receipt-line-actions .btn{width:100%}.receiving-line-quantity-grid,.receiving-line-trace-grid{grid-template-columns:1fr}}
@media(max-width:480px){.receiving-line-kpis{grid-template-columns:1fr}.receipt-lines-table td{grid-template-columns:1fr;gap:4px}.receipt-line-actions{grid-template-columns:1fr!important}.receipt-line-actions::before,.receipt-line-actions>a,.receipt-line-actions>form{grid-column:1}.receipt-line-product-grid{grid-template-columns:1fr}}

/* Receiving Slice 2.1 — product lookup and receipt-line action cleanup */
.receiving-product-lookup{position:relative}
.receiving-product-lookup input[type="search"]{width:100%}
.receiving-product-results{position:absolute;z-index:30;top:calc(100% - 26px);left:0;right:0;max-height:320px;overflow:auto;background:#fff;border:1px solid #cfdbea;border-radius:12px;box-shadow:0 16px 34px rgba(13,39,72,.16);padding:6px}
.receiving-product-result{display:grid;width:100%;gap:3px;padding:11px 12px;border:0;border-radius:9px;background:transparent;text-align:left;cursor:pointer;color:#0d2748}
.receiving-product-result:hover,.receiving-product-result.is-active{background:#edf5ff}
.receiving-product-result strong{font-size:.92rem}
.receiving-product-result span{font-size:.79rem;color:#687994;line-height:1.35}
.receiving-product-result-empty{padding:13px 12px;color:#7a889f;font-size:.84rem}
.receiving-product-lookup .field-note.is-error{color:#b42318;font-weight:700}
.receipt-lines-heading>div{min-width:0}
@media(min-width:761px){.receipt-lines-heading{display:flex;justify-content:space-between;align-items:flex-start}.receipt-lines-heading .btn{flex:0 0 auto;margin-top:4px}}

/* Receiving v0.6.9.3 — unified open worksheet redesign */
.receiving-workspace{display:grid;gap:18px;min-width:0;padding-bottom:8px}
.receiver-header-card{background:#fff;border:1px solid var(--border,#d8e1ee);border-radius:18px;padding:18px 20px;box-shadow:0 8px 24px rgba(15,38,72,.04)}
.receiver-header-primary{display:grid;grid-template-columns:1.15fr .75fr 1.35fr 1fr 1.15fr 1fr;gap:0;border:1px solid #e1e8f2;border-radius:14px;overflow:hidden}
.receiver-header-primary>div,.receiver-header-secondary>div{display:grid;align-content:start;gap:4px;min-width:0}
.receiver-header-primary>div{padding:14px 16px;border-right:1px solid #e1e8f2;background:#fbfcfe}
.receiver-header-primary>div:last-child{border-right:0}
.receiver-header-primary small,.receiver-header-secondary small,.receiver-header-notes small,.receiver-kpis small{font-size:.66rem;font-weight:900;letter-spacing:.09em;color:#71809a;text-transform:uppercase}
.receiver-header-primary strong,.receiver-header-secondary strong{color:#0d2748;overflow-wrap:anywhere}
.receiver-header-primary span:not(.receipt-status),.receiver-header-secondary span{font-size:.8rem;color:#71809a}
.receiver-header-id strong{font-size:1.08rem;color:#1263df}
.receiver-header-details{margin-top:12px;border-top:1px solid #e7edf5;padding-top:10px}
.receiver-header-details summary{width:max-content;cursor:pointer;color:#245fbd;font-size:.8rem;font-weight:900;list-style:none}
.receiver-header-details summary::-webkit-details-marker{display:none}
.receiver-header-details summary::after{content:' +';font-size:.95rem}
.receiver-header-details[open] summary::after{content:' –'}
.receiver-header-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px}
.receiver-header-secondary>div{padding:12px 14px;background:#f8faff;border:1px solid #e3eaf4;border-radius:12px}
.receiver-header-notes{border-left:3px solid #2477f3;background:#f5f8ff;border-radius:0 12px 12px 0;margin-top:14px;padding:12px 14px}
.receiver-header-notes p{margin:4px 0 0;color:#51637f;line-height:1.5}
.receiver-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:16px}
.receiver-kpis article{display:grid;gap:3px;background:#f8faff;border:1px solid #e1e8f2;border-radius:12px;padding:13px 15px}
.receiver-kpis strong{font-size:1.24rem;color:#0d2748}
.receiver-kpis span{font-size:.74rem;color:#71809a}
.receiver-kpi-secondary{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:10px;color:#64758f;font-size:.78rem}
.receiver-kpi-secondary strong{color:#173354}
.receiver-toolbar{position:sticky;top:8px;z-index:18;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;background:#f7faff;border:1px solid #cfe0f8;border-radius:14px;padding:10px 12px;box-shadow:0 8px 22px rgba(15,38,72,.07)}
.receiver-toolbar-main{display:flex;align-items:center;gap:12px;min-width:0}
.receiver-toolbar-intro{display:flex;align-items:center;gap:10px;padding-right:12px;border-right:1px solid #dbe5f2;white-space:nowrap}
.receiver-toolbar-intro>div{display:grid;gap:1px}
.receiver-toolbar-intro strong{font-size:.8rem;color:#173354}
.receiver-toolbar-intro span{font-size:.7rem;color:#71809a}
.receiver-toolbar-actions,.receiver-save-actions{display:flex;gap:7px;flex-wrap:wrap}
.receiver-save-actions{justify-content:flex-end;flex-wrap:nowrap}
.receiver-grid-shell{background:#fff;border:1px solid #dce5f0;border-radius:16px;overflow:hidden;box-shadow:0 8px 22px rgba(15,38,72,.035)}
.receiver-grid-help{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:12px 16px;background:#f8fbff;border-bottom:1px solid #e2e9f3}
.receiver-grid-help>div{display:grid;gap:2px}.receiver-grid-help strong{color:#0d2748}.receiver-grid-help span{color:#6a7b95;font-size:.78rem}.receiver-grid-tip{white-space:nowrap}
.receiver-table-wrap{overflow:auto;scrollbar-gutter:stable}
.receiver-table{width:100%;min-width:1450px;border-collapse:collapse;table-layout:fixed}
.receiver-table th{position:sticky;top:0;z-index:2;background:#edf3fb;color:#536986;font-size:.65rem;font-weight:900;letter-spacing:.055em;text-align:left;text-transform:uppercase;padding:9px 8px;border-bottom:1px solid #d6e0ed}
.receiver-table td{padding:7px 8px;border-bottom:1px solid #e7edf5;vertical-align:middle;background:#fff}
.receiver-table tbody tr:last-child td{border-bottom:0}
.receiver-row{transition:background .15s ease,box-shadow .15s ease}
.receiver-row:hover td{background:#fbfdff}.receiver-row:focus-within td{background:#f6faff}.receiver-row.is-selected td{background:#edf5ff}
.receiver-select-column,.receiver-select-cell{width:42px;text-align:center}.receiver-table th:nth-child(2){width:145px}.receiver-table th:nth-child(3){width:205px}.receiver-table th:nth-child(4),.receiver-table th:nth-child(5){width:92px}.receiver-table th:nth-child(6){width:80px}.receiver-table th:nth-child(7){width:118px}.receiver-table th:nth-child(8){width:130px}.receiver-table th:nth-child(9){width:145px}.receiver-table th:nth-child(10){width:120px}.receiver-table th:nth-child(11){width:145px}.receiver-table th:nth-child(12){width:155px}.receiver-table th:nth-child(13){width:48px}
.receiver-control{width:100%;min-width:0;border:1px solid #cfdaea;border-radius:8px;background:#fff;padding:8px 9px;font:inherit;color:#16304f}
.receiver-control:focus{border-color:#2477f3;box-shadow:0 0 0 3px rgba(36,119,243,.12);outline:none}
.receiver-sku{font-weight:800;color:#1263df}.receiver-number{text-align:right}.receiver-description{color:#233c5a;line-height:1.35;padding:7px 2px;font-size:.82rem}.receiver-description.is-error{color:#b42318;font-weight:700}
.receiver-remove{width:32px;height:32px;border:1px solid #e0e6ef;border-radius:8px;background:#fff;color:#9b2c2c;font-size:1.1rem;cursor:pointer}.receiver-remove:hover{background:#fff1f1}
.receiver-empty{display:grid;justify-items:center;gap:5px;padding:30px;color:#667895}.receiver-mobile-savebar{display:none}.receiver-row-select,.receiver-table input[type="checkbox"]{width:18px;height:18px;accent-color:#2477f3}.receiver-toolbar button:disabled,.receiver-mobile-savebar button:disabled{opacity:.48;cursor:not-allowed}
@media(max-width:1450px){.receiver-header-primary{grid-template-columns:repeat(3,minmax(0,1fr))}.receiver-header-primary>div:nth-child(3){border-right:0}.receiver-header-primary>div:nth-child(-n+3){border-bottom:1px solid #e1e8f2}.receiver-toolbar{grid-template-columns:1fr}.receiver-save-actions{justify-content:flex-start}.receiver-toolbar-main{flex-wrap:wrap}}
@media(max-width:980px){.receiver-header-secondary{grid-template-columns:repeat(2,minmax(0,1fr))}.receiver-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.receiver-toolbar-intro{width:100%;border-right:0;border-bottom:1px solid #dbe5f2;padding:0 0 9px}.receiver-toolbar-main{display:grid}.receiver-save-actions{display:none}}
@media(max-width:760px){.receiving-workspace{padding-bottom:84px;gap:14px}.receiver-header-card{padding:12px}.receiver-header-primary{grid-template-columns:1fr 1fr}.receiver-header-primary>div{padding:11px 12px;border-right:1px solid #e1e8f2;border-bottom:1px solid #e1e8f2}.receiver-header-primary>div:nth-child(even){border-right:0}.receiver-header-primary>div:nth-last-child(-n+2){border-bottom:0}.receiver-header-primary>div:nth-child(3){border-right:1px solid #e1e8f2}.receiver-header-secondary{grid-template-columns:1fr}.receiver-header-notes{display:block}.receiver-kpis{grid-template-columns:1fr 1fr;gap:8px}.receiver-kpis article{padding:11px 12px}.receiver-kpi-secondary{justify-content:space-between}.receiver-toolbar{position:static;display:block;padding:10px}.receiver-toolbar-main{display:grid;gap:9px}.receiver-toolbar-intro{display:flex}.receiver-toolbar-actions{display:grid;grid-template-columns:1fr 1fr}.receiver-toolbar-actions .btn{width:100%}.receiver-grid-help{display:grid;gap:4px}.receiver-grid-tip{white-space:normal}.receiver-table-wrap{overflow:visible}.receiver-table{display:block;min-width:0;table-layout:auto}.receiver-table thead{display:none}.receiver-table tbody{display:grid;gap:12px;padding:12px;background:#f4f7fb}.receiver-table tr{display:grid;grid-template-columns:34px minmax(0,1fr);border:1px solid #d9e3ef;border-radius:16px;background:#fff;padding:12px;box-shadow:0 6px 18px rgba(15,38,72,.04);overflow:hidden}.receiver-table tr.is-selected{border-color:#78aaf0;box-shadow:0 0 0 3px rgba(36,119,243,.1)}.receiver-table td{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;align-items:center;border-bottom:1px solid #edf2f7;padding:9px 0;grid-column:1 / -1;background:transparent!important}.receiver-table td::before{content:attr(data-label);font-size:.63rem;font-weight:900;letter-spacing:.07em;text-transform:uppercase;color:#75849a}.receiver-table .receiver-select-cell{grid-column:1;width:auto;border:0;display:block;padding:2px 0}.receiver-table .receiver-select-cell::before{display:none}.receiver-table td:nth-child(2){grid-column:2;padding:0 0 10px;border-bottom:0}.receiver-table td:nth-child(2)::before{display:none}.receiver-table td:nth-child(3){grid-column:1 / -1;padding:0 0 12px}.receiver-table td:nth-child(3)::before{display:none}.receiver-table .receiver-remove-cell{border:0;padding-bottom:0}.receiver-description{font-size:.88rem;font-weight:700;color:#203a5c}.receiver-control{min-width:0!important}.receiver-mobile-savebar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;padding:10px;background:rgba(255,255,255,.97);border-top:1px solid #d9e2ee;backdrop-filter:blur(10px)}.receiver-mobile-savebar .btn{width:100%;padding-left:8px!important;padding-right:8px!important;font-size:.74rem!important}}
@media(max-width:480px){.receiver-header-primary{grid-template-columns:1fr}.receiver-header-primary>div,.receiver-header-primary>div:nth-child(3){border-right:0;border-bottom:1px solid #e1e8f2}.receiver-header-primary>div:last-child{border-bottom:0}.receiver-kpis{grid-template-columns:1fr 1fr}.receiver-toolbar-actions{grid-template-columns:1fr}.receiver-table td{grid-template-columns:1fr;gap:4px}.receiver-table td::before{margin-bottom:2px}.receiver-table td:nth-child(2){grid-column:1 / -1}.receiver-mobile-savebar{grid-template-columns:1fr 1fr}.receiver-mobile-savebar .btn-primary{grid-column:1 / -1}}

/* =========================================================
   Receiving v0.6.9.8 — authoritative desktop width model
   The shell track is explicitly sized to the viewport minus the
   current sidebar. The page never owns horizontal overflow; the
   worksheet scroller does.
   ========================================================= */
@media (min-width: 861px) {
    html,
    body.app-shell {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-frame {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .app-frame > .app-workspace {
        width: calc(100vw - var(--shell-sidebar));
        max-width: calc(100vw - var(--shell-sidebar));
        min-width: 0;
        overflow-x: hidden;
    }

    .app-frame.sidebar-collapsed > .app-workspace {
        width: calc(100vw - var(--shell-sidebar-collapsed));
        max-width: calc(100vw - var(--shell-sidebar-collapsed));
    }

    .app-main,
    .receiving-workspace,
    .receiver-header-card,
    .receiver-toolbar,
    .receiver-grid-shell,
    .receiver-grid-help {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .app-main {
        overflow-x: hidden;
    }

    .receiver-header-primary,
    .receiver-kpis {
        min-width: 0;
    }

    .receiver-grid-shell {
        overflow: hidden;
    }

    .receiver-table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-gutter: stable;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .receiver-table {
        width: 1450px;
        min-width: 1450px;
        max-width: none;
    }
}

/* Reflow from the actual desktop workspace, which is narrower than the
   browser because the sidebar remains present. */
@media (min-width: 861px) and (max-width: 1900px) {
    .receiver-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .receiver-toolbar-main,
    .receiver-toolbar-actions,
    .receiver-save-actions {
        flex-wrap: wrap;
    }

    .receiver-save-actions {
        justify-content: flex-start;
    }
}

@media (min-width: 861px) and (max-width: 1800px) {
    .receiver-header-primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .receiver-header-primary > div {
        border-bottom: 1px solid #e1e8f2;
    }

    .receiver-header-primary > div:nth-child(3n) {
        border-right: 0;
    }

    .receiver-header-primary > div:nth-last-child(-n + 3) {
        border-bottom: 0;
    }
}

/* =========================================================
   Receiving v0.6.9.9 — grid-item shrink fix
   The receiver form is a direct CSS-grid child. Its default min-width:auto
   was inheriting the worksheet table's 1450px intrinsic width, so the form
   expanded beyond the workspace and was then clipped by shell overflow.
   Allow the form and its descendants to shrink; the table wrapper remains
   the only horizontal scroll owner.
   ========================================================= */
@media (min-width: 861px) {
    .receiving-workspace > form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .receiving-workspace > form > .receiver-toolbar,
    .receiving-workspace > form > .receiver-grid-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .receiver-table-wrap {
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

/* =========================================================
   Receiving v0.6.10.1 — desktop grid alignment and density
   One colgroup now controls both the heading and body widths.
   Mobile card presentation remains unchanged below 760px.
   ========================================================= */
@media (min-width: 761px) {
    .receiver-table {
        width: 1450px;
        min-width: 1450px;
        max-width: 1450px;
        table-layout: fixed;
    }

    .receiver-table col.receiver-col-select { width: 42px; }
    .receiver-table col.receiver-col-sku { width: 145px; }
    .receiver-table col.receiver-col-description { width: 190px; }
    .receiver-table col.receiver-col-expected { width: 90px; }
    .receiver-table col.receiver-col-received { width: 90px; }
    .receiver-table col.receiver-col-uom { width: 76px; }
    .receiver-table col.receiver-col-lot { width: 112px; }
    .receiver-table col.receiver-col-expiration { width: 128px; }
    .receiver-table col.receiver-col-location { width: 142px; }
    .receiver-table col.receiver-col-hold { width: 116px; }
    .receiver-table col.receiver-col-pallet { width: 140px; }
    .receiver-table col.receiver-col-notes { width: 145px; }
    .receiver-table col.receiver-col-remove { width: 34px; }

    .receiver-table th,
    .receiver-table td {
        box-sizing: border-box;
    }

    .receiver-table th {
        height: 46px;
        padding: 7px 8px;
        line-height: 1.15;
        vertical-align: middle;
        white-space: nowrap;
    }

    .receiver-table td {
        height: 58px;
        padding: 6px 8px;
    }

    .receiver-table th:first-child,
    .receiver-table td:first-child,
    .receiver-table th:last-child,
    .receiver-table td:last-child {
        text-align: center;
    }

    .receiver-control {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 40px;
        box-sizing: border-box;
        padding: 7px 9px;
    }

    .receiver-description {
        width: 100%;
        min-width: 0;
        padding: 4px 2px;
        overflow-wrap: anywhere;
    }

    .receiver-select-column,
    .receiver-select-cell {
        width: auto;
        padding-left: 6px;
        padding-right: 6px;
        text-align: center;
    }

    .receiver-remove-cell {
        padding-left: 1px;
        padding-right: 1px;
    }

    .receiver-remove {
        width: 30px;
        height: 30px;
    }

    .receiver-grid-help {
        min-height: 52px;
        padding: 9px 14px;
    }

    .receiver-grid-help > div {
        gap: 1px;
    }

    .receiver-table-wrap {
        scrollbar-width: auto;
        scrollbar-color: #8d939b #edf1f5;
    }

    .receiver-table-wrap::-webkit-scrollbar {
        height: 13px;
    }

    .receiver-table-wrap::-webkit-scrollbar-track {
        background: #edf1f5;
        border-top: 1px solid #d9e1eb;
    }

    .receiver-table-wrap::-webkit-scrollbar-thumb {
        background: #8d939b;
        border: 3px solid #edf1f5;
        border-radius: 999px;
    }
}

@media (min-width: 1500px) {
    .receiver-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 9px 12px;
    }

    .receiver-toolbar-main,
    .receiver-toolbar-actions,
    .receiver-save-actions {
        flex-wrap: nowrap;
    }

    .receiver-toolbar-main {
        gap: 10px;
    }

    .receiver-save-actions {
        justify-content: flex-end;
    }
}

/* =========================================================
   Receiving v0.6.10.2 — rendered desktop density correction
   Built from the deployed saved-page cascade. This block is the
   final desktop authority; mobile card rules remain unchanged.
   ========================================================= */
@media (min-width: 761px) {
    .receiver-toolbar {
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center;
        gap: 10px 14px;
        padding: 9px 12px;
    }

    .receiver-toolbar-main {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px 14px;
        min-width: 0;
    }

    .receiver-toolbar-intro {
        padding-right: 14px;
        gap: 10px;
    }

    .receiver-toolbar-actions {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        flex-wrap: wrap;
        min-width: 0;
    }

    .receiver-save-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        flex-wrap: nowrap;
    }

    .receiver-toolbar .btn {
        min-height: 40px !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }

    .receiver-toolbar .btn-small {
        min-height: 36px !important;
        padding: 7px 10px !important;
    }

    .receiver-grid-help {
        min-height: 44px;
        padding: 7px 14px;
    }

    .receiver-grid-help h2 {
        margin: 0;
        line-height: 1.15;
    }

    .receiver-grid-help p,
    .receiver-grid-tip {
        margin-top: 2px;
        line-height: 1.25;
    }

    .receiver-table thead tr,
    .receiver-table th {
        height: 42px !important;
        min-height: 42px !important;
    }

    .receiver-table th {
        padding: 6px 8px !important;
        vertical-align: middle;
    }

    .receiver-table tbody tr,
    .receiver-table td {
        height: 54px;
    }

    .receiver-table td {
        padding: 5px 8px !important;
        vertical-align: middle;
    }

    .receiver-control {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px;
        padding: 6px 9px !important;
        line-height: 1.2;
    }

    select.receiver-control {
        padding-right: 28px !important;
    }

    .receiver-description {
        display: flex;
        align-items: center;
        min-height: 40px;
        padding: 2px;
        line-height: 1.3;
    }

    .receiver-row-select,
    .receiver-table input[type="checkbox"] {
        display: block;
        margin: 0 auto;
    }

    .receiver-table-wrap {
        background: #fff;
    }
}

@media (min-width: 761px) and (max-width: 1500px) {
    .receiver-toolbar {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    .receiver-toolbar-main {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .receiver-toolbar-actions {
        gap: 6px;
    }

    .receiver-toolbar .btn-small {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: .72rem !important;
    }

    .receiver-save-actions .btn {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: .76rem !important;
    }
}

@media (min-width: 761px) and (max-width: 1180px) {
    .receiver-toolbar {
        grid-template-columns: 1fr !important;
    }

    .receiver-save-actions {
        justify-content: flex-start;
    }
}


/* Location LP visibility — v0.6.11.1 */
.location-storage-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.location-storage-section-heading small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.location-lp-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
.location-lp-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.location-lp-card > header,
.location-lp-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
}
.location-lp-card > header { border-bottom: 1px solid var(--border); }
.location-lp-card > header strong { margin: 0; font-size: 16px; color: var(--navy); }
.location-lp-card > header small { display: block; margin-top: 2px; color: var(--muted); }
.location-lp-lines { display: grid; }
.location-lp-lines a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.location-lp-lines a:last-child { border-bottom: 0; }
.location-lp-lines a:hover { background: #f7faff; }
.location-lp-lines span { min-width: 0; }
.location-lp-lines strong { margin: 0; color: var(--blue); }
.location-lp-lines small { display: block; margin-top: 2px; color: var(--muted); }
.location-lp-lines b { white-space: nowrap; }
.location-lp-card > footer {
    border-top: 1px solid var(--border);
    background: var(--surface-soft, #f8fafc);
    color: var(--muted);
    font-size: 12px;
}
.location-lp-card > footer strong { margin: 0; color: var(--text); }
@media (max-width: 560px) {
    .location-lp-card > header,
    .location-lp-card > footer,
    .location-lp-lines a { align-items: flex-start; flex-direction: column; }
}

/* Location record intermediate resize containment — v0.6.11.2 */
.location-record-grid,
.location-record-grid > *,
.location-record-summary,
.location-record-inventory {
    min-width: 0;
}

.location-record-summary {
    container-type: inline-size;
    container-name: location-summary;
}

.location-record-summary .record-detail-list dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .location-record-grid {
        grid-template-columns: 1fr;
    }
}

@container location-summary (max-width: 520px) {
    .location-record-summary .record-detail-list > div {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 13px 0;
    }

    .location-record-summary .record-detail-list dt,
    .location-record-summary .record-detail-list dd {
        width: 100%;
    }

    .location-record-summary .record-detail-list dd .status-pill {
        max-width: 100%;
        white-space: normal;
        text-align: left;
    }
}


/* Container record foundation — v0.6.12.0 */
.location-container-link { color: var(--navy); text-decoration: none; }
.location-container-link:hover { color: var(--blue); text-decoration: underline; }
.container-record-grid { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr); gap: 22px; }
.container-record-grid > *, .container-record-summary, .container-record-inventory { min-width: 0; }
.container-record-inventory { container-type: inline-size; container-name: container-inventory; }
.container-record-summary .record-detail-list dd { min-width: 0; overflow-wrap: anywhere; }
.container-record-summary .record-detail-list dd small { display: block; margin-top: 3px; color: var(--muted); }
.container-record-summary .record-detail-list dd a { color: var(--blue); font-weight: 700; text-decoration: none; }
.container-record-summary .record-detail-list dd a:hover { text-decoration: underline; }
.container-record-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.container-record-totals > div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft, #f8fafc); }
.container-record-totals span { display: block; color: var(--muted); font-size: 12px; }
.container-record-totals strong { display: block; margin-top: 4px; color: var(--navy); font-size: 20px; }
.container-balance-list { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.container-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.container-balance-row:last-child { border-bottom: 0; }
.container-balance-row:hover { background: #f7faff; }
.container-balance-product { min-width: 0; }
.container-balance-product strong { color: var(--blue); }
.container-balance-product small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.container-balance-quantities { display: grid; grid-template-columns: repeat(3, minmax(72px, auto)) minmax(28px, auto); align-items: end; gap: 14px; flex: 0 0 auto; }
.container-balance-quantities span { display: grid; justify-items: end; }
.container-balance-quantities span small { display: block; color: var(--muted); font-size: 11px; text-align: right; }
.container-balance-quantities span strong { display: block; margin-top: 2px; color: var(--text); text-align: right; }
.container-balance-quantities em { align-self: end; color: var(--muted); font-style: normal; font-weight: 700; text-align: right; }
.container-source-panel { margin-top: 22px; }
.container-source-list { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.container-source-list a { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1fr) minmax(150px, .8fr); gap: 18px; padding: 13px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.container-source-list a:last-child { border-bottom: 0; }
.container-source-list a:hover { background: #f7faff; }
.container-source-list span { min-width: 0; }
.container-source-list strong { color: var(--blue); }
.container-source-list b { color: var(--text); }
.container-source-list small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1180px) { .container-record-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .container-record-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .container-balance-row { align-items: flex-start; flex-direction: column; }
    .container-balance-quantities { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .container-balance-quantities span { justify-items: start; }
    .container-balance-quantities span small,
    .container-balance-quantities span strong { text-align: left; }
    .container-source-list a { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 460px) {
    .container-record-totals { grid-template-columns: 1fr 1fr; }
    .container-balance-quantities { grid-template-columns: 1fr 1fr; }
    .container-balance-quantities em { align-self: end; }
}

/* Pallet findability & reprint UX — v0.6.13.2 / intermediate resize — v0.6.13.3 */
.container-balance-product { color: inherit; text-decoration: none; flex: 1 1 220px; }
.container-balance-product:hover strong { text-decoration: underline; }
.container-label-action { flex: 0 0 auto; padding: 9px 12px; white-space: nowrap; }
@container container-inventory (max-width: 700px) {
    .container-balance-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 14px 18px;
    }
    .container-balance-product { grid-column: 1 / -1; width: 100%; }
    .container-balance-quantities { grid-column: 1; justify-self: stretch; width: 100%; }
    .container-label-action { grid-column: 2; justify-self: end; }
}
@media (max-width: 760px) {
    .container-label-action { width: 100%; margin-left: 0; text-align: center; }
}

/* Receiving batch label actions — v0.6.14.0 */
.receiving-label-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.receiving-label-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
@media (max-width: 760px) {
    .receiving-label-panel-heading {
        flex-direction: column;
    }
    .receiving-label-panel-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
