:root {
    --layout-header-height: 4.5rem;
    --ink: #292929;
    --muted: #696766;
    --brand-orange: #ed6d1e;
    --brand-gray: #727171;
    --primary: #a8460c;
    --primary-hover: #873606;
    --canvas: #f6f6f5;
    --line: #e2e0de;
    --card: #fff;
}

html, body { background: var(--canvas); color: var(--ink); font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
body { margin: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.content { margin: 0 auto; max-width: 1440px; padding-bottom: 4rem; padding-top: 2rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); font-weight: 750; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; font-weight: 700; }
code { background: #f1efed; border-radius: 6px; color: #6d3b22; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; padding: .18rem .4rem; }

.btn { border-radius: 9px; font-weight: 650; padding: .58rem 1rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-hover); border-color: var(--primary-hover); color: white; }
.btn-outline-secondary { border-color: #bcb9b6; color: #4d4b49; }
.btn:focus, .form-control:focus, .form-select:focus { border-color: var(--brand-orange); box-shadow: 0 0 0 .2rem rgba(237,109,30,.16); }
.form-control { border-color: #d8d5d2; border-radius: 9px; min-height: 2.85rem; }
.form-label { color: #44413f; font-size: .87rem; font-weight: 700; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.validation-message { color: #b42318; font-size: .82rem; margin-top: .3rem; }
.invalid { border-color: #dc6860 !important; }
.valid.modified:not([type=checkbox]) { border-color: #54a07b; }
.alert { border: 0; border-radius: 10px; }

.eyebrow { color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .16em; margin-bottom: .45rem; }
.page-heading { align-items: end; display: flex; justify-content: space-between; margin: .5rem 0 1.75rem; gap: 1.5rem; }
.page-heading p:last-child { color: var(--muted); margin-bottom: 0; }
.page-heading.compact { align-items: center; }
.back-link { color: var(--muted); display: inline-block; font-size: .85rem; margin-bottom: .8rem; text-decoration: none; }
.back-link:hover { color: var(--primary); }

.guide-hero { align-items: center; background: linear-gradient(120deg, #2a2929, #4b4948); border-radius: 18px; color: white; display: flex; gap: 2rem; justify-content: space-between; min-height: 145px; padding: clamp(1.5rem, 4vw, 2.6rem); }
.guide-hero .eyebrow { color: #ff9655; }
.guide-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: .6rem; }
.guide-hero p:last-child { color: rgba(255,255,255,.78); margin: 0; max-width: 640px; }
.guide-hero .btn { background: var(--brand-orange); border-color: var(--brand-orange); color: #242424; flex: 0 0 auto; white-space: nowrap; }
.guide-hero .btn:hover, .guide-hero .btn:focus { background: #ff985b; border-color: #ff985b; color: #242424; }
.guide-hero-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .65rem; }
.guide-hero .btn-outline-light { background: transparent; border-color: rgba(255,255,255,.7); color: white; }
.guide-hero .btn-outline-light:hover, .guide-hero .btn-outline-light:focus { background: rgba(255,255,255,.14); border-color: white; color: white; }
.guide-section { margin-top: 2rem; }
.guide-section-heading { align-items: end; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.guide-section-heading h2 { font-size: 1.3rem; margin: 0; }
.guide-section-heading > span { color: var(--muted); font-size: .82rem; }
.guide-flow { background: white; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 1.25rem; }
.guide-flow li { display: flex; gap: .8rem; min-width: 0; padding: .4rem 1.15rem; }
.guide-flow li + li { border-left: 1px solid var(--line); }
.guide-step { color: var(--primary); flex: 0 0 auto; font-size: .82rem; font-weight: 800; }
.guide-flow strong { display: block; font-size: .93rem; margin-bottom: .35rem; }
.guide-flow p { color: var(--muted); font-size: .82rem; line-height: 1.6; margin: 0; }
.guide-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-card { background: white; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; padding: 1.35rem; }
.guide-card-icon { align-items: center; background: #fff0e5; border-radius: 10px; color: var(--primary); display: flex; font-size: 1.25rem; height: 38px; justify-content: center; margin-bottom: 1rem; width: 38px; }
.guide-card h3 { font-size: 1.05rem; font-weight: 750; margin-bottom: .45rem; }
.guide-card p { color: var(--muted); font-size: .87rem; line-height: 1.6; margin-bottom: 1.4rem; }
.guide-card-link, .guide-card-links { margin-top: auto; }
.guide-card-link, .guide-card-links a { color: var(--primary); font-size: .84rem; font-weight: 750; text-decoration: none; }
.guide-card-link:hover, .guide-card-links a:hover { text-decoration: underline; }
.guide-card-links { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; }
.guide-more { background: #f0efed; border: 1px solid #e1dedb; border-radius: 14px; padding: 1.35rem; }
.guide-more-grid { display: grid; gap: .65rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-more-grid a { background: white; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: .2rem; min-width: 0; padding: .85rem 1rem; text-decoration: none; }
.guide-more-grid a:hover, .guide-more-grid a:focus { border-color: #e9a173; box-shadow: 0 2px 10px rgba(80, 48, 28, .09); }
.guide-more-grid strong { color: var(--ink); font-size: .9rem; }
.guide-more-grid span { color: var(--muted); font-size: .8rem; }
.guide-hint { color: var(--muted); font-size: .78rem; margin: 1rem 0 0; }

.section-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.section-card { padding: 1.5rem; }
.section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; }
.section-heading h2, .section-heading p { margin-bottom: 0; }

.toolbar-card { align-items: center; background: white; border: 1px solid var(--line); border-radius: 13px; display: flex; gap: .65rem; margin-bottom: 1rem; padding: .75rem; }
.inventory-toolbar { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(130px, 180px) minmax(140px, 180px) minmax(120px, 155px) minmax(150px, 190px) auto auto; }
.category-filter { flex: 0 1 230px; }
.inventory-stock-filter, .inventory-sort { min-width: 0; }
.search-box { align-items: center; display: flex; flex: 1; position: relative; }
.search-box span { color: #898581; font-size: 1.3rem; left: .8rem; position: absolute; z-index: 1; }
.search-box input { border: 0; box-shadow: none; padding-left: 2.4rem; }
.inventory-view-switcher { background: #f0efed; border-radius: 9px; display: inline-flex; flex: 0 0 auto; gap: .2rem; padding: .2rem; }
.inventory-view-switcher button { background: transparent; border: 0; border-radius: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; padding: .5rem .7rem; white-space: nowrap; }
.inventory-view-switcher button:hover { color: var(--ink); }
.inventory-view-switcher button.active { background: white; box-shadow: 0 1px 4px rgba(20, 48, 34, .12); color: var(--primary); }
.loading-state, .empty-state { color: var(--muted); padding: 5rem 1rem; text-align: center; }
.empty-state { background: white; border: 1px dashed #cad2cc; border-radius: 14px; }
.empty-state h1, .empty-state h2 { color: var(--ink); }
.empty-icon { color: #9baa9f; font-size: 2.8rem; margin-bottom: 1rem; }
.table > :not(caption) > * > * { border-bottom-color: #edf0ee; padding: 1rem 1.1rem; }
.table thead th { background: #f7f6f5; color: #6f6b68; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.part-cell { align-items: center; display: flex; gap: .8rem; }
.part-cell img, .image-placeholder { border-radius: 9px; height: 48px; object-fit: cover; width: 48px; }
.image-placeholder { align-items: center; background: #f0efed; color: #918b86; display: flex; flex: 0 0 48px; justify-content: center; }
.part-cell strong, .part-cell small { display: block; }
.part-cell small { color: var(--muted); font-size: .78rem; margin-top: .18rem; }
.table-actions { white-space: nowrap; }
.mobile-list { display: none; }
.status-badge { border-radius: 999px; display: inline-block; font-size: .72rem; font-weight: 750; padding: .28rem .58rem; white-space: nowrap; }
.status-badge.normal { background: #e4f3ea; color: #236847; }
.status-badge.low { background: #fff0ce; color: #8a5e0f; }
.status-badge.empty { background: #fbe8e6; color: #a33a31; }
.category-badge { background: #f0efed; border-radius: 999px; color: #55514e; display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; white-space: nowrap; }
.category-badge.uncategorized { background: #f1f2f1; color: #7a837e; }

.form-layout { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr) 320px; }
.form-section { padding: 1.6rem; }
.required-note, .form-hint { color: var(--muted); font-size: .76rem; }
.photo-preview { align-items: center; aspect-ratio: 4 / 3; background: #f6f4f2; border: 1px dashed #cbc5c0; border-radius: 12px; display: flex; justify-content: center; margin-bottom: .8rem; overflow: hidden; text-align: center; }
.photo-preview img { height: 100%; object-fit: cover; width: 100%; }
.photo-preview span { color: #87968d; font-size: 2rem; }
.photo-preview p { color: var(--muted); font-size: .8rem; margin: .4rem 0 0; }
.upload-button { cursor: pointer; }
.upload-button input { display: none; }
.form-hint { display: block; margin-top: .65rem; }
.form-actions { align-items: center; display: flex; gap: .7rem; justify-content: flex-end; margin-top: 1.2rem; }

.detail-grid { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); }
.image-detail { align-items: center; display: flex; justify-content: center; min-height: 390px; overflow: hidden; padding: 0; }
.image-detail > img { height: 100%; max-height: 520px; object-fit: contain; width: 100%; }
.large-placeholder { color: var(--muted); text-align: center; }
.large-placeholder span { color: #a4afa8; font-size: 4rem; }
.image-management-surface { height: 100%; min-height: inherit; position: relative; width: 100%; }
.image-upload-surface { align-items: center; cursor: pointer; display: flex; height: 100%; justify-content: center; min-height: inherit; overflow: hidden; position: relative; width: 100%; }
.image-upload-surface input { display: none; }
.image-upload-surface > img { height: 100%; max-height: 520px; object-fit: contain; width: 100%; }
.image-upload-surface .large-placeholder { display: flex; flex-direction: column; gap: .3rem; }
.image-upload-surface .large-placeholder > span:last-child { color: var(--muted); font-size: .85rem; }
.upload-placeholder { align-items: center; border: 2px dashed #d5b69f; border-radius: 16px; justify-content: center; margin: 1.5rem; min-height: 260px; padding: 2rem; width: calc(100% - 3rem); }
.upload-placeholder .photo-upload-icon { align-items: center; background: #fff0e5; border-radius: 50%; color: var(--primary); display: flex; font-size: 2rem; height: 68px; justify-content: center; margin-bottom: .45rem; width: 68px; }
.upload-placeholder strong { color: var(--ink); font-size: 1.05rem; }
.upload-placeholder small { color: var(--muted); font-size: .75rem; }
.image-upload-hint { background: rgba(42, 41, 41, .92); border-radius: 999px; bottom: 1rem; color: white; font-size: .78rem; font-weight: 700; left: 50%; padding: .48rem .85rem; position: absolute; transform: translateX(-50%); white-space: nowrap; }
.image-upload-surface:hover .image-upload-hint { background: var(--primary); }
.image-upload-surface.is-uploading { cursor: wait; opacity: .78; pointer-events: none; }
.image-delete-button { position: absolute; right: 1rem; top: 1rem; z-index: 2; }
.stock-number { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 750; letter-spacing: -.06em; margin: 1.5rem 0; }
.stock-number small { color: var(--muted); font-size: .85rem; letter-spacing: 0; margin-left: .5rem; }
.detail-list { margin: 0; }
.detail-list > div { align-items: center; border-top: 1px solid #edf0ee; display: flex; justify-content: space-between; padding: .85rem 0; }
.detail-list dt { color: var(--muted); font-size: .82rem; font-weight: 500; }
.detail-list dd { margin: 0; text-align: right; }
.preserve-lines { white-space: pre-line; }
.confirm-overlay { align-items: center; background: rgba(9,22,15,.55); display: flex; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 100; }
.confirm-dialog { background: white; border-radius: 14px; box-shadow: 0 20px 70px rgba(0,0,0,.25); max-width: 440px; padding: 1.7rem; width: 100%; }

.inventory-summary { display: flex; gap: 1rem; }
.inventory-summary > div { align-items: center; background: white; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 1rem; padding: .75rem 1rem; }
.inventory-summary small { color: var(--muted); }
.inventory-summary strong { font-size: 1.2rem; }
.inventory-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inventory-card { background: white; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); padding: 1.25rem; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.inventory-card:hover { border-color: #e9a173; box-shadow: 0 8px 24px rgba(68,48,36,.09); color: var(--ink); transform: translateY(-2px); }
.inventory-card h2 { margin: 1rem 0 .35rem; }
.inventory-card p { color: var(--muted); font-size: .82rem; min-height: 1.2rem; }
.inventory-card > small { color: var(--muted); }
.inventory-card-heading { align-items: flex-start; display: flex; gap: .75rem; justify-content: space-between; }
.inventory-main-link { color: var(--ink); display: flex; flex: 1; gap: .75rem; min-width: 0; text-decoration: none; }
.inventory-main-link:hover { color: var(--ink); }
.inventory-main-link h2 { font-size: 1.05rem; margin: .35rem 0; overflow-wrap: anywhere; }
.inventory-main-link p { margin: .45rem 0 0; min-height: 0; }
.inventory-thumb { border-radius: 10px; flex: 0 0 58px; height: 58px; object-fit: cover; width: 58px; }
.inventory-card-actions { border-top: 1px solid #e6ebe7; display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; padding-top: .85rem; }
.inventory-quantity { align-items: baseline; display: flex; gap: .45rem; margin: 1.3rem 0 .35rem; }
.inventory-quantity strong { font-size: 2rem; letter-spacing: -.04em; }
.inventory-quantity span { color: var(--muted); font-size: .8rem; }
.inventory-list-view { display: grid; gap: .65rem; }
.inventory-list-row { align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 1rem; grid-template-columns: 54px minmax(170px, 1.2fr) minmax(90px, .55fr) minmax(300px, 2fr) minmax(105px, .55fr) auto; padding: .8rem 1rem; }
.inventory-list-row:hover { border-color: #e9a173; box-shadow: 0 5px 18px rgba(68,48,36,.08); }
.inventory-list-photo { color: var(--ink); display: block; height: 52px; text-decoration: none; width: 52px; }
.inventory-list-photo img, .inventory-list-photo .image-placeholder { border-radius: 9px; height: 52px; object-fit: cover; width: 52px; }
.inventory-list-identity a { color: var(--ink); display: flex; flex-direction: column; gap: .18rem; min-width: 0; text-decoration: none; }
.inventory-list-identity code { overflow-wrap: anywhere; width: fit-content; }
.inventory-list-identity strong { font-size: .92rem; overflow-wrap: anywhere; }
.inventory-list-identity > small { color: var(--muted); display: block; font-size: .72rem; margin-top: .25rem; overflow-wrap: anywhere; }
.inventory-list-variants { display: grid; gap: .35rem; min-width: 0; }
.inventory-list-variants > div { align-items: center; display: flex; flex-wrap: wrap; gap: .3rem .65rem; }
.inventory-list-variants > div > span:not(.brand-badge) { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.inventory-list-variants b { color: var(--ink); }
.inventory-list-variants small { flex-basis: 100%; font-size: .7rem; }
.inventory-list-total { align-items: flex-end; display: flex; flex-direction: column; gap: .2rem; text-align: right; }
.inventory-list-total > small { color: var(--muted); font-size: .68rem; }
.inventory-list-total > strong { font-size: 1.15rem; }
.inventory-list-total > strong span { color: var(--muted); font-size: .7rem; font-weight: 500; }
.inventory-list-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.inventory-pagination { align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 1rem; justify-content: space-between; margin-top: 1rem; padding: .8rem 1rem; }
.inventory-page-status { align-items: center; color: var(--muted); display: flex; font-size: .78rem; gap: 1rem; }
.inventory-page-status label { align-items: center; display: flex; gap: .4rem; white-space: nowrap; }
.inventory-page-status select { width: 74px; }
.inventory-page-buttons { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }

.movement-layout { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: 330px minmax(0, 1fr); }
.movement-form-card { position: sticky; top: 1rem; }
.form-select { border-color: #d8d5d2; border-radius: 9px; min-height: 2.85rem; }
.form-select:focus { border-color: var(--brand-orange); box-shadow: 0 0 0 .2rem rgba(237,109,30,.16); }
.movement-history-card { min-width: 0; }
.request-rejection-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid #efb4ad; border-radius: 14px; background: #fff; color: #6f2119; }
.request-rejection-notice > div:first-child { display: grid; gap: .15rem; min-width: 0; }
.request-rejection-notice small { display: block; color: #75534f; }
.request-history-table { min-width: 900px; }
.request-status { display: inline-flex; align-items: center; white-space: nowrap; padding: .3rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.request-status.pending { color: #7a4c00; background: #fff2d5; }
.request-status.approved { color: #12613e; background: #dff3e9; }
.request-status.rejected { color: #9a2f24; background: #fbe4e1; }
.movement-history-heading { margin-bottom: .8rem; }
.movement-search { align-items: center; background: #f7f6f5; border: 1px solid var(--line); border-radius: 11px; display: flex; gap: .5rem; padding: .5rem; }
.movement-search .search-box input { background: transparent; }
.movement-history-table { min-width: 980px; }
.movement-table th { white-space: nowrap; }
.movement-table td a { color: var(--ink); text-decoration: none; }
.movement-table td a small { color: var(--muted); display: block; font-size: .75rem; margin-top: .3rem; }
.movement-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.movement-part-cell { min-width: 132px; }
.movement-part-cell code { display: inline-block; font-size: .75rem; white-space: nowrap; }
.movement-balance { white-space: nowrap; }
.movement-note { color: var(--muted); font-size: .8rem; line-height: 1.5; min-width: 165px; overflow-wrap: break-word; word-break: normal; }
.movement-audit { font-size: .8rem; min-width: 195px; }
.movement-audit strong, .movement-audit small { display: block; }
.movement-audit > strong, .movement-audit a strong { font-size: .72rem; letter-spacing: -.015em; white-space: nowrap; }
.movement-audit small { color: var(--muted); margin-top: .25rem; }
.movement-history-group td { border-bottom: 0; }
.movement-history-group td[rowspan], .movement-history-group tr:last-child td { border-bottom: 1px solid var(--line); }
.movement-history-group tr + tr td { padding-top: .35rem; }
.movement-history-group tr:not(:last-child) td:not([rowspan]) { padding-bottom: .35rem; }

.audit-filter-bar { align-items: center; display: grid; gap: .75rem; grid-template-columns: minmax(260px, 1fr) 180px auto; }
.audit-search { margin: 0; }
.audit-area-select { min-width: 0; }
.audit-result-heading { align-items: center; color: var(--muted); display: flex; font-size: .8rem; justify-content: space-between; margin: 1rem 0 .5rem; }
.audit-table { min-width: 980px; }
.audit-table th { white-space: nowrap; }
.audit-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-area-badge { background: #f0efed; border-radius: 999px; color: #55514e; display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; white-space: nowrap; }
.audit-action { display: block; font-size: .82rem; margin-top: .4rem; }
.audit-subtext { color: var(--muted); display: block; font-size: .72rem; margin-top: .25rem; max-width: 220px; overflow-wrap: anywhere; }
.audit-summary { min-width: 260px; }
.audit-summary details, .audit-mobile-card details { color: var(--muted); font-size: .78rem; margin-top: .45rem; }
.audit-summary summary, .audit-mobile-card summary { cursor: pointer; font-weight: 700; }
.audit-summary details div, .audit-mobile-card details div { background: #f5f4f2; border-radius: 8px; margin-top: .4rem; padding: .55rem; white-space: pre-wrap; }
.audit-mobile-list { margin-top: 1rem; }
.audit-mobile-card time { color: var(--muted); font-size: .72rem; }
.audit-mobile-card h2 { font-size: 1rem; margin: .8rem 0 .5rem; }
.audit-mobile-card p { margin: 0 0 .6rem; }
.audit-mobile-card > small { color: var(--muted); }

@media (max-width: 700px) {
    .audit-filter-bar { grid-template-columns: 1fr; }
    .audit-area-select { width: 100%; }
    .inventory-card { padding: 1rem; }
    .inventory-card-heading { align-items: flex-start; }
    .inventory-thumb { flex-basis: 52px; height: 52px; width: 52px; }
    .inventory-card .inventory-variant-list > span { align-items: flex-start; flex-direction: column; flex-wrap: nowrap; max-width: 100%; }
    .inventory-card .inventory-variant-list strong, .inventory-card .inventory-variant-list small { max-width: 100%; overflow-wrap: anywhere; text-align: left; white-space: normal; }
}
.movement-badge { border-radius: 999px; display: inline-block; font-size: .72rem; font-weight: 750; padding: .28rem .58rem; white-space: nowrap; }
.movement-badge.receipt { background: #e2f3e9; color: #236847; }
.movement-badge.issue { background: #fbe8e6; color: #a33a31; }
.movement-badge.return { background: #e8eef9; color: #395f9a; }
.movement-badge.opening { background: #eeeaf8; color: #65518f; }
.movement-badge.stocktake { background: #e8f0f0; color: #35676a; }
.movement-badge.transfer-out { background: #f4e9df; color: #8b5127; }
.movement-badge.transfer-in { background: #e5f1ec; color: #28634b; }
.movement-badge.transfer-reversal-out { background: #fbe8e6; color: #9a3c34; }
.movement-badge.transfer-reversal-in { background: #eeeaf8; color: #65518f; }
.movement-change { font-size: .95rem; font-weight: 750; white-space: nowrap; }
.movement-change.positive { color: #23704b; }
.movement-change.negative { color: #b24036; }
.movement-change.neutral { color: var(--muted); }
.empty-state.compact { padding: 3rem 1rem; }
.movement-mobile-card { background: #fdfefd; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); display: grid; gap: .8rem; padding: 1rem; text-decoration: none; }
.movement-mobile-card time { color: var(--muted); font-size: .72rem; }
.movement-mobile-card > div:nth-child(2) { display: grid; gap: .35rem; }
.movement-mobile-card > div:nth-child(2) strong { font-size: .92rem; }
.movement-mobile-card a { color: var(--ink); text-decoration: none; }
.movement-mobile-values { align-items: baseline; display: flex; justify-content: space-between; }
.movement-mobile-values small, .movement-mobile-card p { color: var(--muted); font-size: .76rem; margin: 0; }
.movement-mobile-audit { background: #f5f4f2; border-radius: 8px; color: var(--muted); display: flex; flex-wrap: wrap; font-size: .72rem; gap: .35rem 1rem; padding: .55rem .65rem; }
.movement-mobile-lines { display: grid; gap: .8rem; }
.movement-mobile-line { display: grid; gap: .4rem; }
.movement-mobile-line > div:first-child { display: grid; gap: .35rem; }
.movement-mobile-line strong { font-size: .92rem; }
.stocktake-quantity-input { font-size: 1.2rem; font-weight: 700; }
.stocktake-preview { background: #f5f4f2; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 1px; grid-template-columns: 1fr 1fr; overflow: hidden; }
.stocktake-preview > div { background: white; display: grid; grid-template-columns: 1fr auto; padding: .85rem; }
.stocktake-preview small { color: var(--muted); font-size: .72rem; grid-column: 1 / -1; margin-bottom: .3rem; }
.stocktake-preview strong { font-size: 1.25rem; }
.stocktake-preview span { align-self: end; color: var(--muted); font-size: .72rem; margin-bottom: .15rem; }
.stocktake-part-link { color: var(--ink); text-decoration: none; }
.stocktake-part-link small { color: var(--muted); display: block; font-size: .75rem; margin-top: .3rem; }
.stocktake-mobile-values { align-items: baseline; display: grid; gap: .35rem; grid-template-columns: 1fr auto; }
.stocktake-mobile-values small { color: var(--muted); grid-column: 1 / -1; }
.stocktake-mobile-values .movement-change { justify-self: end; }
.transfer-preview { align-items: center; background: #f5f4f2; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: .5rem; grid-template-columns: 1fr auto 1fr; padding: .8rem; }
.transfer-preview > div { display: grid; text-align: center; }
.transfer-preview small { color: var(--muted); font-size: .72rem; }
.transfer-preview strong { font-size: 1.25rem; margin-top: .2rem; }
.transfer-preview span:not(.transfer-arrow) { color: var(--muted); font-size: .72rem; }
.transfer-arrow { color: var(--primary); font-size: 1.5rem; font-weight: 800; }
.transfer-reversal-panel { background: #fff9f7; border: 1px solid #efd8d2; border-radius: 12px; padding: 1rem; }
.transfer-reversal-panel h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
.transfer-reversal-panel p:not(.eyebrow) { color: var(--muted); font-size: .82rem; }
.transfer-status { border-radius: 999px; display: inline-block; font-size: .7rem; font-weight: 750; padding: .28rem .55rem; white-space: nowrap; }
.transfer-status.open { background: #e5f1ec; color: #28634b; }
.transfer-status.partial { background: #fff0d8; color: #8a5d19; }
.transfer-status.reversed { background: #e8eaeb; color: #596166; }
.transfer-status.reversal { background: #fbe8e6; color: #9a3c34; }
.batch-movement-layout { grid-template-columns: 330px minmax(0, 1fr); }
.batch-line-adder { align-items: end; background: #f7f6f5; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: .75rem; grid-template-columns: minmax(240px, 1fr) 150px auto; padding: .9rem; }
.batch-line-adder .btn { min-height: 2.85rem; white-space: nowrap; }
.batch-candidate-stock { align-items: center; background: #fff4eb; border-radius: 9px; color: var(--muted); display: flex; flex-wrap: wrap; font-size: .78rem; gap: .5rem 1.5rem; justify-content: space-between; padding: .65rem .8rem; }
.batch-lines-table td:first-child small { color: var(--muted); display: block; font-size: .74rem; margin-top: .25rem; }
.batch-lines-mobile { display: none; }
.batch-submit-bar { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 1rem; justify-content: space-between; padding-top: 1rem; }
.batch-submit-bar span { color: var(--muted); font-size: .8rem; }
.document-summary-grid > div { background: #f7f6f5; border-radius: 10px; display: grid; gap: .25rem; padding: .8rem; }
.document-summary-grid small, .document-note small { color: var(--muted); font-size: .72rem; }
.document-note { background: #f7f6f5; border-radius: 10px; padding: .8rem; }
.document-note p { margin: .25rem 0 0; }

.part-picker { position: relative; }
.part-picker-search { position: relative; }
.part-picker-search-icon { color: #898581; font-size: 1.3rem; left: .8rem; position: absolute; top: .58rem; z-index: 1; }
.part-picker-search input { padding-left: 2.4rem; }
.part-picker-results { background: white; border: 1px solid #d9e0db; border-radius: 11px; box-shadow: 0 14px 35px rgba(20, 49, 33, .13); display: grid; left: 0; margin-top: .35rem; max-height: min(420px, 55vh); overflow-y: auto; position: absolute; right: 0; z-index: 20; }
.part-picker-message { color: var(--muted); font-size: .8rem; padding: 1rem; text-align: center; }
.part-picker-message.error { color: #a33a31; }
.part-picker-option { background: white; border: 0; border-bottom: 1px solid #edf0ee; color: var(--ink); cursor: pointer; display: grid; gap: .45rem; padding: .85rem .9rem; text-align: left; width: 100%; }
.part-picker-option:last-child { border-bottom: 0; }
.part-picker-option:hover, .part-picker-option:focus, .part-picker-option.active { background: #fff3eb; outline: none; }
.part-picker-option-title { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; }
.part-picker-option-title strong { font-size: .88rem; }
.part-picker-option-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: .72rem; gap: .25rem .7rem; }
.part-picker-option-meta > span:not(:last-child)::after { color: #b6c0ba; content: "·"; margin-left: .7rem; }
.part-picker-option-meta .part-picker-stock { color: var(--primary); font-weight: 700; }
.part-picker-selected { align-items: center; background: #fff9f4; border: 1px solid #ecd2be; border-radius: 11px; display: flex; gap: .75rem; justify-content: space-between; min-height: 2.85rem; padding: .75rem; }
.part-picker-selected-main { display: grid; gap: .32rem; min-width: 0; }
.part-picker-selected-main > strong { font-size: .9rem; }
.part-picker-selected-main > small { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-picker-selected-main > span { color: var(--primary); font-size: .74rem; font-weight: 700; }
.part-picker-selected > .btn { flex: 0 0 auto; }

.bulk-tools-grid { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr); }
.import-card, .bulk-category-card { min-width: 0; }
.import-instructions { background: #f7f6f5; border: 1px solid var(--line); border-radius: 11px; display: grid; font-size: .8rem; gap: .35rem; padding: .9rem 1rem; }
.import-instructions span { color: var(--muted); }
.file-drop { align-items: center; border: 1.5px dashed #aebeb3; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; justify-content: center; min-height: 135px; padding: 1.2rem; position: relative; text-align: center; transition: background .15s, border-color .15s; }
.file-drop:hover { background: #fff4eb; border-color: var(--brand-orange); }
.file-drop-icon { color: var(--primary); font-size: 1.8rem; }
.file-drop small { color: var(--muted); }
.file-drop input { cursor: pointer; inset: 0; opacity: 0; position: absolute; width: 100%; }
.import-options { display: grid; gap: .7rem; }
.import-options .form-check { align-items: start; border: 1px solid #e4e9e5; border-radius: 10px; display: flex; gap: .7rem; margin: 0; padding: .75rem .9rem .75rem 2.2rem; }
.import-options .form-check-input { margin-left: -1.35rem; margin-top: .2rem; }
.import-options span { display: grid; gap: .2rem; }
.import-options small { color: var(--muted); font-size: .74rem; }
.loading-state.compact-import { padding: 2.5rem 1rem; }
.import-summary { display: grid; gap: .6rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.import-summary > div { background: #f5f7f5; border-radius: 10px; display: grid; padding: .7rem .8rem; }
.import-summary small { color: var(--muted); font-size: .7rem; }
.import-summary strong { font-size: 1.3rem; }
.import-summary .add { background: #eaf5ee; color: #226847; }
.import-summary .add-variant { background: #eef5e8; color: #4e6d2d; }
.import-summary .update { background: #eaf0f7; color: #395f83; }
.import-summary .invalid { background: #fbeceb; color: #a33a31; }
.import-preview-table { border: 1px solid #e5eae6; border-radius: 11px; max-height: 480px; }
.import-preview-table td, .import-preview-table th { font-size: .76rem; white-space: nowrap; }
.import-preview-table .import-errors { max-width: 270px; white-space: normal; }
.import-preview-table .import-errors.warning { color: #8a641e; }
.import-action { border-radius: 999px; display: inline-block; font-size: .7rem; font-weight: 750; padding: .22rem .5rem; }
.import-action.add { background: #e2f3e9; color: #236847; }
.import-action.add-variant { background: #edf4df; color: #55712e; }
.import-action.update { background: #e8eef9; color: #395f9a; }
.import-action.skip { background: #eff1ef; color: #6f7973; }
.import-action.invalid { background: #fbe8e6; color: #a33a31; }
.import-actions { align-items: center; display: flex; gap: 1rem; justify-content: space-between; }
.import-actions span { color: var(--muted); font-size: .8rem; }
.bulk-filter-grid { align-items: end; display: grid; gap: .7rem; grid-template-columns: 1fr 1fr auto; }
.bulk-selection-toolbar { align-items: center; background: #f7f6f5; border-radius: 10px; display: flex; gap: .8rem; justify-content: space-between; padding: .65rem .8rem; }
.bulk-selection-toolbar > div { display: flex; gap: .4rem; }
.bulk-part-list { border: 1px solid #e5eae6; border-radius: 11px; display: grid; margin-top: .7rem; max-height: 520px; overflow-y: auto; }
.bulk-part-row { align-items: center; border-bottom: 1px solid #edf0ee; cursor: pointer; display: grid; gap: .75rem; grid-template-columns: auto minmax(0, 1fr) auto; margin: 0; padding: .75rem .85rem; }
.bulk-part-row:last-child { border-bottom: 0; }
.bulk-part-row:hover { background: #fff8f2; }
.bulk-part-main { display: grid; gap: .2rem; min-width: 0; }
.bulk-part-main strong { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-part-main small { color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-apply { align-items: end; border-top: 1px solid #e8ece9; display: grid; gap: .7rem; grid-template-columns: 1fr auto; padding-top: 1rem; }
.brand-badge { background: #f0efed; border: 1px solid #dfdbd7; border-radius: 999px; color: #55514e; display: inline-flex; font-size: .76rem; font-weight: 700; line-height: 1.25; padding: .28rem .55rem; }
.brand-management-grid { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.brand-admin-list { display: grid; gap: .7rem; }
.brand-admin-row { align-items: center; background: #f8faf8; border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 1rem; justify-content: space-between; padding: .85rem; }
.variant-identity { align-items: flex-start; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.variant-identity strong { overflow-wrap: anywhere; }
.variant-identity small { color: var(--muted); }
.variant-stock { align-items: flex-end; display: flex; flex-direction: column; gap: .15rem; }
.variant-stock strong { font-size: 1.15rem; }
.variant-stock small { color: var(--muted); }
.inventory-variant-list { border-bottom: 1px solid #e6ebe7; border-top: 1px solid #e6ebe7; display: grid; gap: .45rem; margin: .8rem 0; padding: .75rem 0; }
.inventory-variant-list > span { align-items: center; display: flex; flex-wrap: wrap; gap: .3rem .65rem; justify-content: space-between; min-width: 0; width: 100%; }
.inventory-variant-list strong { font-size: .82rem; white-space: nowrap; }
.inventory-variant-list small { color: var(--muted); flex-basis: 100%; text-align: right; }
.inventory-quantity small { color: var(--muted); font-size: .72rem; margin-right: auto; }

.account-shell { align-items: center; background: linear-gradient(145deg, #f3f2f1 0%, #faf9f7 52%, #f5e9df 100%); display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.account-container { max-width: 460px; width: 100%; }
.account-brand { align-items: center; display: flex; justify-content: center; margin-bottom: 1.4rem; text-decoration: none; }
.account-brand img { display: block; height: auto; max-width: 100%; width: 330px; }
.account-card { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 55px rgba(56, 44, 35, .10); max-width: 460px; padding: clamp(1.5rem, 5vw, 2.2rem); width: 100%; }
.account-card h1 { font-size: 1.75rem; margin-bottom: .45rem; }
.account-card > p { color: var(--muted); font-size: .88rem; margin-bottom: 1.5rem; }
.account-form { display: grid; gap: 1rem; }
.account-form .form-actions { margin-top: .3rem; }
.account-form .form-actions .btn { width: 100%; }
.first-run-callout { background: #fff4eb; border: 1px solid #f0d7c3; border-radius: 11px; color: #744525; font-size: .82rem; margin-top: 1rem; padding: .85rem 1rem; }
.first-run-callout a { font-weight: 700; }

.user-management-grid { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.compact-form { display: grid; gap: .9rem; }
.compact-form .form-actions { margin-top: .25rem; }
.user-list-card { min-width: 0; }
.user-count { background: #f0efed; border-radius: 999px; color: #55514e; font-size: .75rem; font-weight: 700; padding: .3rem .65rem; }
.user-list { display: grid; gap: .7rem; }
.user-row { align-items: center; border: 1px solid #e7ebe8; border-radius: 12px; display: grid; gap: .8rem; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; padding: .9rem 1rem; }
.user-avatar { align-items: center; background: #fff0e5; border-radius: 50%; color: var(--primary); display: flex; font-size: 1.1rem; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.user-identity { min-width: 0; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: var(--muted); font-size: .76rem; margin-top: .18rem; }
.role-badge { background: #f2eee4; border-radius: 999px; color: #715b2e; font-size: .72rem; font-weight: 700; padding: .3rem .6rem; white-space: nowrap; }
.role-badge.operator { background: #e9f0f4; color: #3e6175; }
.user-actions { display: flex; gap: .45rem; justify-content: flex-end; }
.password-card { margin: 0 auto; max-width: 560px; }
.reset-password-dialog { max-width: 500px; }
.edit-user-dialog { max-width: 500px; }
.category-management-grid { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.role-management-grid { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
.role-list { display: grid; gap: .75rem; }
.role-row { align-items: center; border: 1px solid var(--line); border-radius: 13px; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto auto; padding: 1rem; }
.role-row small { color: var(--muted); display: block; margin-top: .2rem; }
.permission-fieldset { border: 0; display: grid; gap: .55rem; margin: 0; padding: 0; }
.permission-fieldset legend { font-size: .88rem; font-weight: 800; margin-bottom: .2rem; }
.permission-option { align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; display: flex; gap: .7rem; padding: .7rem .8rem; }
.permission-option input { flex: 0 0 auto; margin-top: .2rem; }
.permission-option span { display: grid; gap: .1rem; }
.permission-option small { color: var(--muted); font-size: .75rem; }
.role-editor-dialog { max-width: 620px; }
.warehouse-permission-editor { margin-top: .2rem; }
.warehouse-permission-row { align-items: center; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: .8rem; grid-template-columns: minmax(90px, 1fr) auto auto; padding: .7rem .8rem; }
.warehouse-permission-row .form-check { align-items: center; display: flex; gap: .4rem; }
.warehouse-permission-row .form-check-input { margin: 0; }
.category-list { display: grid; gap: .7rem; }
.category-row { align-items: center; border: 1px solid #e7ebe8; border-radius: 12px; display: grid; gap: .8rem; grid-template-columns: auto minmax(0, 1fr) auto auto; padding: .9rem 1rem; }
.category-icon { align-items: center; background: #fff0e5; border-radius: 10px; color: var(--primary); display: flex; height: 42px; justify-content: center; width: 42px; }
.category-identity strong, .category-identity small { display: block; }
.category-identity small { color: var(--muted); font-size: .76rem; margin-top: .18rem; }

@media (max-width: 1000px) {
    .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guide-flow { grid-template-columns: 1fr; }
    .guide-flow li { padding: .7rem .4rem; }
    .guide-flow li + li { border-left: 0; border-top: 1px solid var(--line); }
    .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inventory-toolbar { grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr); }
    .inventory-toolbar .search-box { grid-column: 1 / -1; }
    .inventory-list-row { grid-template-columns: 54px minmax(160px, 1fr) minmax(250px, 1.6fr) minmax(105px, .55fr) auto; }
    .inventory-list-category { display: none; }
    .form-layout { grid-template-columns: 1fr; }
    .movement-layout { grid-template-columns: 1fr; }
    .movement-form-card { position: static; }
    .photo-section { max-width: none; }
    .photo-preview { aspect-ratio: 16 / 7; }
    .user-management-grid { grid-template-columns: 1fr; }
    .category-management-grid { grid-template-columns: 1fr; }
    .role-management-grid { grid-template-columns: 1fr; }
    .brand-management-grid { grid-template-columns: 1fr; }
    .bulk-tools-grid { grid-template-columns: 1fr; }
    .batch-movement-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640.98px) {
    .content { padding: 1.2rem 1rem 5rem !important; }
    .guide-hero { align-items: stretch; flex-direction: column; gap: 1.4rem; min-height: 0; padding: 1.5rem; }
    .guide-hero .btn { align-self: flex-start; }
    .guide-section { margin-top: 1.5rem; }
    .guide-section-heading { align-items: flex-start; flex-direction: column; gap: .3rem; }
    .guide-section-heading > span { display: none; }
    .guide-grid, .guide-more-grid, .inventory-grid, .detail-grid { grid-template-columns: 1fr; }
    .guide-more { padding: 1rem; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading > .btn { width: 100%; }
    .toolbar-card { align-items: stretch; flex-direction: column; }
    .inventory-toolbar { display: grid; grid-template-columns: 1fr; }
    .inventory-toolbar .search-box { grid-column: auto; }
    .toolbar-card > .btn { width: 100%; }
    .category-filter { flex-basis: auto; width: 100%; }
    .inventory-view-switcher { width: 100%; }
    .inventory-view-switcher button { flex: 1; }
    .desktop-table { display: none; }
    .mobile-list { display: grid; gap: .75rem; }
    .mobile-part-card { align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); display: flex; gap: .8rem; padding: .9rem; text-decoration: none; }
    .mobile-part-card img, .mobile-part-card .image-placeholder { border-radius: 9px; flex: 0 0 68px; height: 68px; object-fit: cover; width: 68px; }
    .mobile-part-card h2 { font-size: 1rem; margin: .3rem 0 .55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-part-card code { font-size: .7rem; }
    .min-width-0 { min-width: 0; }
    .form-section { padding: 1.1rem; }
    .photo-preview { aspect-ratio: 4 / 3; }
    .form-actions { background: rgba(244,246,243,.94); bottom: 0; margin: 0 -1rem; padding: .8rem 1rem; position: sticky; z-index: 4; }
    .form-actions .btn { flex: 1; }
    .image-detail { min-height: 260px; }
    .inventory-summary { display: grid; grid-template-columns: 1fr 1fr; }
    .inventory-summary > div { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .inventory-list-row { align-items: start; gap: .7rem; grid-template-columns: 48px minmax(0, 1fr) auto; padding: .85rem; }
    .inventory-list-photo, .inventory-list-photo img, .inventory-list-photo .image-placeholder { height: 46px; width: 46px; }
    .inventory-list-category { display: block; grid-column: 2 / -1; }
    .inventory-list-variants { border-top: 1px solid #e6ebe7; grid-column: 1 / -1; padding-top: .65rem; }
    .inventory-list-variants > div { align-items: flex-start; }
    .inventory-list-variants > div > span:not(.brand-badge) { white-space: normal; }
    .inventory-list-total { grid-column: 3; grid-row: 1; }
    .inventory-list-total .status-badge { display: none; }
    .inventory-list-actions { border-top: 1px solid #e6ebe7; grid-column: 1 / -1; padding-top: .65rem; }
    .inventory-pagination { align-items: stretch; flex-direction: column; }
    .inventory-page-status { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .inventory-page-buttons { justify-content: center; }
    .movement-search { align-items: stretch; flex-direction: column; }
    .movement-search > .btn { width: 100%; }
    .request-rejection-notice { align-items: stretch; flex-direction: column; }
    .request-rejection-notice .btn { flex: 1; }
    .batch-line-adder { align-items: stretch; grid-template-columns: 1fr; }
    .batch-lines-mobile { display: grid; gap: .75rem; }
    .batch-submit-bar { align-items: stretch; flex-direction: column; }
    .batch-submit-bar .btn { width: 100%; }
    .account-shell { align-items: flex-start; padding-top: 1.2rem; }
    .account-card { border-radius: 14px; }
    .user-row { align-items: start; grid-template-columns: auto minmax(0, 1fr) auto; }
    .user-row > div:nth-child(3) { grid-column: 2; }
    .user-row > div:nth-child(4) { grid-column: 2; }
    .user-row > div:nth-child(5) { grid-column: 2; }
    .user-actions { flex-direction: column; grid-column: 3; grid-row: 1 / span 4; }
    .user-actions .btn { white-space: nowrap; }
    .category-row { align-items: start; grid-template-columns: auto minmax(0, 1fr); }
    .role-row { align-items: start; grid-template-columns: minmax(0, 1fr) auto; }
    .role-row > .btn { grid-column: 1 / -1; width: 100%; }
    .category-row > .status-badge { grid-column: 2; justify-self: start; }
    .category-row > .user-actions { flex-direction: row; grid-column: 1 / -1; grid-row: auto; }
    .part-picker-results { max-height: 50vh; }
    .part-picker-selected { align-items: stretch; flex-direction: column; }
    .part-picker-selected > .btn { width: 100%; }
    .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-admin-row { align-items: stretch; flex-direction: column; }
    .import-actions { align-items: stretch; flex-direction: column; }
    .import-actions .btn { width: 100%; }
    .bulk-filter-grid, .bulk-apply { grid-template-columns: 1fr; }
    .bulk-filter-grid > .btn, .bulk-apply > .btn { width: 100%; }
    .bulk-selection-toolbar { align-items: stretch; flex-direction: column; }
    .bulk-selection-toolbar > div { display: grid; grid-template-columns: 1fr 1fr; }
    .bulk-part-row { align-items: start; grid-template-columns: auto minmax(0, 1fr); }
    .bulk-part-row > .category-badge { grid-column: 2; justify-self: start; }
}

h1:focus { outline: none; }
.blazor-error-boundary { background: #b42318; color: white; padding: 1rem; }
.blazor-error-boundary::after { content: "系統發生錯誤。"; }
