:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #152238;
    background: #f4f7fa;
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f7fa; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
    min-height: 68px;
    padding: 0 3.5vw;
    display: flex;
    align-items: center;
    gap: 3rem;
    color: #fff;
    background: #102a43;
    box-shadow: 0 2px 12px rgba(15, 39, 65, .18);
}

.brand { display: inline-flex; align-items: center; gap: .58rem; font-size: 1.18rem; font-weight: 800; letter-spacing: -.045em; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; flex: 0 0 34px; }
.brand-wordmark { color: #ffffff; white-space: nowrap; }
.brand-wordmark .brand-bay { color: #29c293; -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.25px #29c293; }
.topbar nav { display: flex; align-items: stretch; gap: 1.6rem; align-self: stretch; }
.topbar nav a { display: flex; align-items: center; color: #bfd1e1; font-size: .92rem; font-weight: 650; border-bottom: 3px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; border-bottom-color: #29c293; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.user-menu > div { display: flex; flex-direction: column; align-items: flex-end; font-size: .83rem; }
.user-menu span { color: #9db4c8; font-size: .68rem; font-weight: 750; letter-spacing: .1em; }
.text-button { padding: .5rem .65rem; color: #d8e5ee; background: transparent; border: 1px solid #49657b; border-radius: 8px; cursor: pointer; }
.text-button:hover { background: #1b3b56; }

.page-shell { width: min(94vw, 1500px); margin: 0 auto; padding: 2.5rem 0 4rem; }
.narrow-shell { width: min(92vw, 1040px); }
.page-heading, .detail-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 1.8rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: .35rem; font-size: 1.2rem; letter-spacing: -.02em; }
.eyebrow { margin-bottom: .55rem; color: #188764; font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
.muted { margin-bottom: 0; color: #67788a; }

.primary-button, .secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .7rem 1rem;
    border-radius: 9px;
    border: 1px solid transparent;
    font-weight: 720;
    cursor: pointer;
}
.primary-button { color: #fff; background: #12825f; box-shadow: 0 5px 12px rgba(18, 130, 95, .18); }
.primary-button:hover { background: #0d6e50; }
.secondary-button { color: #17324d; background: #fff; border-color: #c9d5df; }
.secondary-button:hover { background: #f6f8fa; }
.primary-button:disabled, .secondary-button:disabled { color: #8b9ba8; background: #eef2f4; border-color: #d8e0e5; box-shadow: none; cursor: not-allowed; }
.invoice-readiness { margin: .75rem 0 0; color: #7b5a16; font-size: .82rem; }
.full-width { width: 100%; }
.text-link, .back-link { color: #167b5e; font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 1.2rem; }

.alert { margin: 0 0 1.25rem; padding: .9rem 1rem; border: 1px solid; border-radius: 10px; font-size: .92rem; }
.alert-warning { color: #744f0b; background: #fff8e6; border-color: #ead49c; }
.alert-error { color: #9a2e36; background: #fff0f1; border-color: #efc5c9; }
.alert-success { color: #126448; background: #ebfaf3; border-color: #b9e5d3; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat-card, .panel { background: #fff; border: 1px solid #dfe7ed; border-radius: 14px; box-shadow: 0 6px 22px rgba(24, 48, 72, .045); }
.stat-card { min-height: 118px; padding: 1.15rem 1.25rem; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card span { color: #6d7d8d; font-size: .84rem; font-weight: 650; }
.stat-card strong { font-size: 2.15rem; line-height: 1; letter-spacing: -.04em; }
.panel { overflow: hidden; }

.search-bar { padding: 1rem; display: flex; align-items: center; gap: .7rem; border-bottom: 1px solid #e5ebf0; }
.search-bar input { flex: 1; }
.warehouse-filter { width: min(260px, 30vw); }
input, select, textarea {
    width: 100%;
    min-height: 43px;
    padding: .7rem .8rem;
    color: #152238;
    background: #fff;
    border: 1px solid #bac8d3;
    border-radius: 8px;
    outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #1b9671; box-shadow: 0 0 0 3px rgba(27, 150, 113, .13); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { padding: .82rem 1rem; color: #697a8a; background: #f8fafc; border-bottom: 1px solid #dfe7ed; text-align: left; font-size: .69rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: .95rem 1rem; border-bottom: 1px solid #ebf0f4; vertical-align: top; }
.operations-table th, .operations-table td { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
td > span:not(.status-badge):not(.type-chip), td > strong { display: block; margin-top: .2rem; color: #728190; font-size: .76rem; font-weight: 500; }
.job-link { color: #126e53; font-weight: 800; }
.job-link:hover { color: #0b5c44; }
.status-badge { display: inline-block; max-width: 230px; padding: .38rem .55rem; color: #284861; background: #edf4f8; border-radius: 7px; font-size: .72rem; font-weight: 700; line-height: 1.25; }
.type-chip { display: inline-block; padding: .3rem .48rem; color: #17654e; background: #e8f7f1; border-radius: 999px; font-size: .67rem; font-weight: 800; letter-spacing: .04em; }
.empty-state { padding: 2.5rem 1rem; color: #718191; text-align: center; }

.jobs-table-wrap { overflow-x: clip; }
.jobs-table { table-layout: fixed; font-size: .78rem; }
.jobs-table .status-column { width: 16%; }
.jobs-table .model-column { width: 7%; }
.jobs-table .serial-column { width: 11%; }
.jobs-table .simpro-column { width: 8%; }
.jobs-table .variation-column { width: 7%; }
.jobs-table .store-column { width: 10%; }
.jobs-table .fz-column { width: 11%; }
.jobs-table .type-column { width: 6%; }
.jobs-table .engineer-column { width: 11%; }
.jobs-table .completion-column { width: 10%; }
.jobs-table .warehouse-column { width: 10%; }
.jobs-table th { padding: .68rem .5rem; white-space: normal; line-height: 1.2; }
.jobs-table td { padding: .7rem .5rem; vertical-align: middle; }
.jobs-table .status-cell, .jobs-table .wrapping-cell { white-space: normal; overflow-wrap: anywhere; }
.jobs-table .compact-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs-table .status-badge { max-width: none; padding: .28rem .42rem; font-size: .7rem; font-weight: 400; }
.job-table-row { cursor: pointer; transition: background-color .09s ease, box-shadow .09s ease; }
.job-table-row:hover { background: #f0faf6; box-shadow: inset 3px 0 #31a67f; }
.job-table-row:focus-visible { outline: 2px solid #208c69; outline-offset: -2px; background: #f0faf6; }
.job-table-row.row-clicked { background: #d9f2e8; box-shadow: inset 5px 0 #12825f; }

.form-panel { padding: 0 1.7rem; }
.form-section { padding: 1.7rem 0; border-bottom: 1px solid #e6edf2; }
.section-title { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.2rem; }
.section-title > span { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; color: #fff; background: #183b56; border-radius: 9px; font-weight: 750; }
.section-title h2, .section-title p { margin: 0; }
.section-title p { color: #7a8997; font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.form-grid .full-width { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.6rem .85rem; }
.panel-heading h2 { margin: .1rem 0 0; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label, .stack-form label { display: flex; flex-direction: column; gap: .42rem; color: #334b61; font-size: .82rem; font-weight: 700; }
.field-error { min-height: .1rem; color: #b33b44; font-weight: 600; }
.form-actions { padding: 1.3rem 0; display: flex; justify-content: flex-end; gap: .7rem; }
.wide-field { grid-column: span 2; }
.checkbox-row { margin-top: 1rem; display: flex; align-items: center; gap: .7rem; color: #334b61; cursor: pointer; }
.checkbox-row input { width: 19px; min-height: 19px; flex: 0 0 auto; }
.checkbox-row span { display: flex; flex-direction: column; gap: .15rem; }
.checkbox-row small { color: #728190; }
.form-alert { margin-top: 1.3rem; margin-bottom: 0; }

.detail-hero { align-items: center; padding: 1.5rem 1.7rem; color: #fff; background: linear-gradient(120deg, #102a43, #194c65); border-radius: 15px; }
.detail-hero .eyebrow { color: #54d2aa; }
.detail-hero p:last-child { margin-bottom: 0; color: #c4d5e1; }
.detail-hero .back-link { color: #cbe1ec; }
.hero-status { max-width: 360px; display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; text-align: right; }
.hero-status .type-chip { color: #d8fff2; background: rgba(63, 214, 166, .18); }
.serial-title-row, .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.serial-title-row h1 { margin-bottom: 0; }
.serial-title-row button:disabled { opacity: .72; cursor: not-allowed; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.detail-card { padding: 1.25rem; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-heading h2, .card-heading p { margin-bottom: 0; }
.card-heading > span { color: #7b8b99; font-size: .75rem; }
.details-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.details-list div { min-width: 0; }
.details-list div.wide { grid-column: 1 / -1; }
.details-list dt { margin-bottom: .2rem; color: #7a8997; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.details-list dd { margin: 0; overflow-wrap: anywhere; font-size: .88rem; font-weight: 650; }
.section-panel { margin-top: 1rem; padding-top: 1.2rem; }
.section-panel > .card-heading { padding: 0 1.2rem; }
.heading-actions { display: flex; align-items: center; gap: .8rem; color: #7b8b99; font-size: .75rem; }
.compact-button { min-height: 36px; padding: .5rem .72rem; font-size: .78rem; }
.order-strip { display: flex; gap: .7rem; padding: 0 1.2rem 1.1rem; overflow-x: auto; }
.order-strip a { min-width: 180px; padding: .75rem .85rem; display: flex; flex-direction: column; gap: .18rem; background: #f4f9f7; border: 1px solid #cfe5dc; border-radius: 9px; }
.order-strip a:hover { border-color: #68b99d; }
.order-strip span, .part-label { color: #738594; font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.order-strip strong { color: #126e53; }
.order-strip small { color: #687d8d; font-size: .68rem; }
.part-workflow-list { display: grid; gap: 1px; background: #e2e9ee; border-top: 1px solid #e2e9ee; }
.part-workflow-card { padding: 1.2rem; background: #fff; }
.part-summary { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1rem; align-items: center; }
.part-summary > div { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.receipt-form { margin-top: 1rem; padding: 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; align-items: end; background: #f7fafb; border: 1px solid #e0e8ed; border-radius: 10px; }
.receipt-form label, .inline-part-form label, .inline-reference-form label { display: flex; flex-direction: column; gap: .35rem; color: #40586c; font-size: .74rem; font-weight: 750; }
.receipt-notes { grid-column: span 2; }
.read-only-part { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e8edf1; }
.add-part-panel { margin-top: 1rem; padding: 1.2rem; }
.add-part-panel > .card-heading { padding: 0; }
.inline-part-form { display: grid; grid-template-columns: 2fr .7fr 1fr auto; gap: .8rem; align-items: end; }
.inline-reference-form { display: grid; grid-template-columns: 1fr 1.3fr .8fr auto; gap: .8rem; align-items: end; }
.part-reference-form { margin-top: .8rem; display: flex; align-items: end; gap: .6rem; }
.part-reference-form label { width: min(320px, 100%); display: flex; flex-direction: column; gap: .35rem; color: #40586c; font-size: .74rem; font-weight: 750; }
.light-text-button { min-height: 34px; padding: .4rem .55rem; color: #255268; background: #fff; border-color: #b9cad5; white-space: nowrap; }
.light-text-button:hover { background: #edf6f3; }
.receipt-form input:disabled, .form-grid input:disabled { color: #8997a3; background: #eef2f4; border-color: #d8e0e5; cursor: not-allowed; }
.parts-table-wrap { overflow-x: clip; }
.parts-table { table-layout: fixed; font-size: .74rem; }
.parts-table th { padding: .62rem .38rem; white-space: normal; line-height: 1.15; }
.parts-table td { padding: .62rem .38rem; vertical-align: middle; overflow-wrap: anywhere; }
.parts-table th:nth-child(1) { width: 4%; }
.parts-table th:nth-child(2) { width: 13%; }
.parts-table th:nth-child(3) { width: 7%; }
.parts-table th:nth-child(4) { width: 7%; }
.parts-table th:nth-child(5) { width: 8%; }
.parts-table th:nth-child(6), .parts-table th:nth-child(8) { width: 7%; }
.parts-table th:nth-child(7) { width: 8%; }
.parts-table th:nth-child(9) { width: 12%; }
.parts-table th:nth-child(10) { width: 20%; }
.parts-table th:nth-child(11) { width: 6%; }
.parts-table .compact-part-type, .parts-table td:nth-child(4) > select { min-width: 0; width: 62px; padding: .28rem; }
.parts-table td > strong, .parts-table td > span:not(.type-chip) { margin-top: 0; font-size: .72rem; }
.part-table-row.clickable-part-row { cursor: pointer; transition: background-color .09s ease, box-shadow .09s ease; }
.part-table-row.clickable-part-row:hover { background: #f0faf6; box-shadow: inset 3px 0 #31a67f; }
.part-table-row.row-clicked { background: #d9f2e8; box-shadow: inset 5px 0 #12825f; }
.return-status-form { align-items: stretch; }
.return-status-form select { min-width: 0; padding: .32rem .4rem; font-size: .7rem; }
.part-actions-cell { display: grid; grid-template-columns: 185px; justify-content: start; align-items: center; gap: .22rem; }
.part-actions-cell .inline-form { display: contents; }
.part-actions-cell select { min-width: 0; width: 185px; }
.part-actions-cell .light-text-button { width: 29px; min-width: 29px; height: 29px; padding: 0; font-size: 0; }
.part-actions-cell .light-text-button::after { content: '✓'; font-size: .82rem; font-weight: 800; }
.part-table-row[data-part-state="doa"] { box-shadow: inset 3px 0 #c83f49, inset -3px 0 #c83f49; background: #fff7f7; }
.part-table-row[data-part-state="unavailable"] { box-shadow: inset 3px 0 #dd8c22, inset -3px 0 #dd8c22; background: #fffaf1; }
.part-table-row.clickable-part-row[data-part-state="doa"]:hover { background: #ffe0e3; box-shadow: inset 4px 0 #c83f49, inset -4px 0 #c83f49; }
.part-table-row.clickable-part-row[data-part-state="unavailable"]:hover { background: #ffedc9; box-shadow: inset 4px 0 #dd8c22, inset -4px 0 #dd8c22; }
.part-table-row[data-part-state="doa"]:hover { background: #ffe0e3; box-shadow: inset 4px 0 #c83f49, inset -4px 0 #c83f49; }
.part-table-row[data-part-state="unavailable"]:hover { background: #ffedc9; box-shadow: inset 4px 0 #dd8c22, inset -4px 0 #dd8c22; }
.return-requirement-form { padding-top: .42rem; border-top: 1px solid #e2e9ee; }
.subtle-line { display: block; color: #527083; font-size: .69rem; text-decoration: none; }
.reminder-link { display: block; text-decoration: none; }
.shipment-create-grid { grid-template-columns: repeat(5, minmax(110px, 1fr)) auto; align-items: end; padding: 0 1.2rem 1.2rem; }
.compact-actions { margin: 0; padding: 0; align-self: end; }
.compact-actions .primary-button { min-height: 43px; white-space: nowrap; }
.form-grid label.check-label { min-height: 46px; padding: .7rem .8rem; flex-direction: row; align-items: center; gap: .55rem; background: #f7fafb; border: 1px solid #dfe7ec; border-radius: 8px; }
.check-label input { width: auto; }
.selection-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: 0 1.2rem 1.2rem; }
.selection-list label { padding: .8rem; display: flex; align-items: flex-start; gap: .7rem; border: 1px solid #dfe7ec; border-radius: 9px; cursor: pointer; }
.selection-list label:hover { background: #f3faf7; border-color: #aad6c5; }
.selection-list input { width: auto; margin-top: .2rem; }
.selection-list span { display: grid; gap: .2rem; }
.selection-list small { color: #728495; }
.shipment-item-form { justify-content: center; flex-wrap: wrap; }
.shipment-item-form label { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.shipment-item-form .part-weight-field { width: 110px; }
.shipment-item-form .part-weight-field input { min-height: 36px; padding: .45rem .55rem; }
.shipment-parts-table td { vertical-align: middle; }
.package-table input, .package-table select { min-width: 92px; width: 100%; }
.shipment-parts-table select { min-width: 126px; }
.package-group td { background: #f1f7f4; color: #176b54; font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; }
.package-group span { color: #6a8090; font-size: .78rem; letter-spacing: 0; text-transform: none; margin-left: .4rem; }
.workflow-list { margin: 0; padding: 0 1.2rem 1.2rem; display: grid; gap: .55rem; list-style: none; counter-reset: workflow; }
.workflow-list li { min-height: 60px; padding: .75rem .9rem; display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: center; gap: 1rem; background: #f8fafb; border: 1px solid #dfe7ec; border-radius: 9px; }
.workflow-list li > div { display: grid; gap: .2rem; }
.workflow-list li > div strong::before { counter-increment: workflow; content: counter(workflow) ". "; color: #7c8e9d; }
.workflow-list li > div span { color: #6b7e8e; font-size: .78rem; }
.workflow-list li.workflow-complete { background: #f0faf6; border-color: #b9e2d2; }
.workflow-list li.workflow-complete > div strong::after { content: " ✓"; color: #16835f; }
.inline-install-form { margin-top: .35rem; }
.closure-summary { margin: 0; padding: 0 1.2rem 1.2rem; display: grid; grid-template-columns: minmax(130px, .4fr) minmax(130px, .4fr) minmax(260px, 1.2fr); gap: .8rem 1.2rem; }
.closure-summary div { padding: .7rem .8rem; background: #f7fafb; border: 1px solid #e2e9ee; border-radius: 9px; }
.closure-summary dt { margin-bottom: .22rem; color: #738594; font-size: .66rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.closure-summary dd { margin: 0; font-weight: 650; }
.history-list { border-top: 1px solid #e5ebef; }
.history-row { padding: .7rem 1.2rem; display: grid; grid-template-columns: minmax(150px, .5fr) minmax(300px, 1.7fr) minmax(210px, .7fr); gap: 1rem; align-items: baseline; border-bottom: 1px solid #edf1f4; }
.history-row:last-child { border-bottom: 0; }
.history-row strong { color: #27516a; font-size: .72rem; }
.history-row span { color: #506476; font-size: .8rem; }
.history-row small { color: #83919e; text-align: right; }
.timeline { margin: 0; padding: 0 1.4rem 1.4rem; list-style: none; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: .9rem; padding: .7rem 0; }
.timeline li > span { width: 10px; height: 10px; margin-top: .35rem; background: #29aa81; border: 2px solid #d7f4ea; border-radius: 50%; box-shadow: 0 0 0 3px #e8f8f2; }
.timeline p { margin: .25rem 0; color: #506476; }
.timeline small { color: #83919e; }

.settings-card { padding: 1.5rem; }
.setting-copy p { color: #66798a; }
.switch-row { display: flex; align-items: center; gap: .75rem; padding: 1rem; background: #f7fafb; border: 1px solid #dee7ed; border-radius: 10px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 45px; height: 25px; padding: 3px; background: #9eacb7; border-radius: 999px; transition: .15s; }
.switch i { display: block; width: 19px; height: 19px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: #16835f; }
.switch-row input:checked + .switch i { transform: translateX(20px); }
.permission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.permission-grid > div { padding: .9rem; display: flex; flex-direction: column; gap: .35rem; border: 1px solid #e0e8ee; border-radius: 9px; }
.permission-grid span { font-size: .76rem; }
.permission-full { color: #137353; }
.permission-read { color: #996812; }
.access-chip { display: inline-block; padding: .32rem .52rem; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.access-chip.full { color: #126448; background: #e8f7f1; }
.access-chip.read-only { color: #815b12; background: #fff6de; }
.access-chip.disabled { color: #8a3440; background: #fff0f1; }

.login-page { display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 20% 20%, #224c67, #102a43 52%, #0a1d2f); }
.login-shell { width: min(94vw, 980px); display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; background: #fff; border-radius: 20px; box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
.login-brand { padding: 3.5rem; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; background: linear-gradient(145deg, rgba(20, 124, 92, .96), rgba(15, 65, 84, .97)); }
.login-brand .eyebrow { color: #c4f6e5; }
.login-brand h1 { font-size: 3.2rem; }
.login-brand p:last-child { max-width: 400px; margin-bottom: 0; color: #d6ebe5; line-height: 1.6; }
.login-card { padding: 3.5rem 3rem; }
.login-card h2 { font-size: 2rem; }
.stack-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.demo-note { margin: 1.4rem 0 0; padding: .75rem; color: #647687; background: #f2f6f8; border-radius: 8px; text-align: center; font-size: .8rem; }
.message-card { width: min(92vw, 520px); padding: 2.5rem; background: #fff; border-radius: 18px; box-shadow: 0 20px 55px rgba(0, 0, 0, .23); text-align: center; }
.message-card p:not(.eyebrow) { margin-bottom: 1.5rem; color: #637586; line-height: 1.6; }
.message-icon { width: 48px; height: 48px; margin: 0 auto 1rem; display: grid; place-items: center; color: #fff; background: #d09227; border-radius: 14px; font-size: 1.5rem; }

th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ↕"; color: #8da0ad; font-size: .7rem; }
.modal { width: min(92vw, 620px); padding: 1.4rem; border: 0; border-radius: 15px; box-shadow: 0 25px 80px rgba(15,42,61,.28); }
.modal-wide { width: min(94vw, 980px); }
.modal::backdrop { background: rgba(9,28,42,.58); backdrop-filter: blur(2px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-heading h2 { margin: 0; }
.icon-button { padding: .1rem .5rem; border: 0; background: transparent; color: #526777; font-size: 1.8rem; cursor: pointer; }
.warranty-expired { border-color: #d76469; background: #fff0f1; }
.warranty-expiring { border-color: #e6a52d; background: #fff7e4; }
.locked-summary { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; padding: 1rem 1.3rem; color: #5f7282; }
.locked-summary strong { color: #16384f; }
.field-invalid { border-color: #c83f49 !important; box-shadow: 0 0 0 3px rgba(200,63,73,.12); }
.inline-message { color: #657989; font-size: .8rem; }
.fz-autocomplete-hint { min-height: .9rem; color: #25705a; font-weight: 650; }
.inline-form { display: flex; align-items: center; gap: .35rem; }
.inline-form select { min-width: 125px; padding: .45rem; }
.inline-add-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-add-form input { width: 155px; }
.inline-add-form input[type=number]:last-of-type { width: 72px; }
.split-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; padding: 1rem 1.2rem; }
.danger-button { min-height: 40px; padding: .65rem 1rem; color: #fff; background: #b93c48; border: 0; border-radius: 8px; font-weight: 750; cursor: pointer; }
.danger-link { padding: .25rem; color: #ac3440; background: transparent; border: 0; cursor: pointer; text-decoration: underline; }
.return-shipment-page #packages > form { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.return-shipment-page #packages > form > label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .92rem; color: #29445b; cursor: pointer; }
.return-shipment-page #packages input[type="radio"] { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: #218565; }
.return-shipment-page .danger-button { background: #fff; color: #b53643; border: 1px solid #d8757e; font-weight: 800; }
.return-shipment-page .danger-button:hover { background: #fff1f2; }
.return-shipment-page #packages .form-actions { padding: 1rem 0 0; }
.return-shipment-page .section-panel { padding: 1.2rem; }
.return-shipment-page .section-panel > .card-heading { padding: 0; }
.return-shipment-page .shipment-secondary-actions { margin-top: 1rem; display: flex; align-items: end; gap: .8rem; flex-wrap: wrap; }
.return-shipment-page .shipment-secondary-actions .inline-form { gap: .7rem; }
.return-shipment-page .shipment-secondary-actions label { display: grid; gap: .35rem; color: #334b61; font-size: .82rem; font-weight: 700; }
.return-shipment-page .shipment-preparation .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.return-shipment-page .shipment-save-button { white-space: nowrap; }
.return-shipment-page .complete-shipment-button { margin-left: auto; white-space: nowrap; }
.return-shipment-page .package-table, .return-shipment-page .shipment-parts-table { table-layout: fixed; }
.return-shipment-page .package-table th, .return-shipment-page .package-table td,
.return-shipment-page .shipment-parts-table th, .return-shipment-page .shipment-parts-table td { white-space: normal; vertical-align: middle; }
.return-shipment-page .package-table input, .return-shipment-page .shipment-parts-table input,
.return-shipment-page .shipment-parts-table select { width: 100%; min-width: 0; }
.return-shipment-page .shipment-parts-table { min-width: 0; }
.return-shipment-page .shipment-parts-table th, .return-shipment-page .shipment-parts-table td { min-width: 0; width: 11.111%; padding: .45rem .35rem; overflow-wrap: anywhere; }
.return-shipment-page #shipment-parts .table-wrap { overflow-x: hidden; }
.return-shipment-page .shipment-parts-table input, .return-shipment-page .shipment-parts-table select { min-height: 36px; padding: .35rem .45rem; font-size: .82rem; }
.return-shipment-page .shipment-parts-table tbody tr { height: 70px; }
.return-shipment-page .shipment-parts-table tbody td { height: 70px; }
.return-shipment-page #shipment-parts .form-actions { padding: .7rem 0 0; }
.return-shipment-page .package-table th:nth-child(1) { width: 11%; }
.return-shipment-page .package-table th:nth-child(2), .return-shipment-page .package-table th:nth-child(3),
.return-shipment-page .package-table th:nth-child(4), .return-shipment-page .package-table th:nth-child(5) { width: 16%; }
.return-shipment-page .package-table th:nth-child(6) { width: 18%; }
.return-shipment-page .package-table th:nth-child(7) { width: 7%; }
.return-shipment-page .gross-weight-cell { color: #29445b; font-weight: 800; }
.return-queue-toolbar { margin: .8rem 0 1.1rem; display: flex; align-items: end; gap: .7rem; }
.return-queue-toolbar label { width: 305px; display: grid; gap: .35rem; color: #334b61; font-size: .82rem; font-weight: 700; }
.return-queue-page .section-panel { padding: 1.2rem; }
.return-queue-table .table-wrap { margin: -1.2rem; width: calc(100% + 2.4rem); }
.create-shipment-panel h2 { margin: 0; }
.create-shipment-row { margin-top: .9rem; display: flex; align-items: end; gap: .8rem; }
.create-shipment-row label { width: 150px; display: grid; gap: .35rem; color: #334b61; font-size: .82rem; font-weight: 700; }
#deleteShipment form { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .8rem; }
#deleteShipment h2, #deleteShipment p { width: 100%; margin: 0; }
#deleteShipment p { margin-bottom: .4rem; }

@media (max-width: 1050px) {
    .return-shipment-page #shipment-parts .table-wrap { overflow-x: auto; }
    .return-shipment-page .shipment-secondary-actions { align-items: stretch; }
    .return-shipment-page .shipment-preparation .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .return-shipment-page .shipment-save-button { grid-column: 1 / -1; justify-self: start; }
}
.validation-list { margin: 0 1.2rem; padding: .8rem 1rem .8rem 2rem; color: #805817; background: #fff8e5; border: 1px solid #efdca5; border-radius: 8px; }
.success-text { color: #147453; font-weight: 750; }
td small { display: block; margin-top: .25rem; color: #728495; }

.manager-queue-switcher { margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .8rem; }
.manager-queue-button { position: relative; min-height: 48px; padding: .78rem 2.15rem .78rem 1rem; display: inline-flex; align-items: center; color: #24465d; background: #fff; border: 1px solid #ccd9e2; border-radius: 11px; font-weight: 750; box-shadow: 0 5px 15px rgba(20,47,67,.06); }
.manager-queue-button.has-pending { color: #fff; background: #137f5e; border-color: #137f5e; box-shadow: 0 7px 18px rgba(19,127,94,.2); }
.manager-queue-button.has-pending:hover { background: #0d6d50; }
.manager-queue-button.is-empty { padding-right: 1rem; color: #8a99a5; background: #edf2f5; border-color: #dce4e9; box-shadow: none; cursor: default; pointer-events: none; }
.notification-badge { position: absolute; top: -9px; right: -8px; min-width: 25px; height: 25px; padding: 0 6px; display: grid; place-items: center; color: #fff; background: #e3343f; border: 2px solid #fff; border-radius: 999px; box-shadow: 0 2px 6px rgba(120,20,28,.28); font-size: .72rem; font-weight: 850; line-height: 1; }
.queue-filter { min-width: 240px; }
.queue-filter label { display: grid; gap: .4rem; color: #506578; font-size: .74rem; font-weight: 750; }
.request-table td { vertical-align: middle; }
.request-table { table-layout: fixed; font-size: .82rem; }
.request-table th, .request-table td { min-width: 0; padding: .78rem .65rem; white-space: normal; overflow-wrap: anywhere; }
.request-table th { font-size: .64rem; }
.request-table th:nth-child(1) { width: 14%; }
.request-table th:nth-child(2) { width: 8%; }
.request-table th:nth-child(3), .request-table th:nth-child(4) { width: 12%; }
.request-table th:nth-child(5) { width: 9%; }
.request-table th:nth-child(6), .request-table th:nth-child(7) { width: 10%; }
.request-table th:nth-child(8) { width: 13%; }
.request-table th:nth-child(9) { width: 12%; }
.decision-summary { margin: 0 0 1rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.decision-summary div, .approval-overview div { padding: .65rem .75rem; background: #f6f9fa; border: 1px solid #e1e8ed; border-radius: 8px; }
.decision-summary dt, .approval-overview span { display: block; margin-bottom: .2rem; color: #758694; font-size: .64rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.decision-summary dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.approval-overview { padding: 0 1.2rem 1rem; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .65rem; }
.approval-overview strong { display: block; overflow-wrap: anywhere; font-size: .84rem; }
.request-note { margin: 0 1.2rem 1rem; padding: .75rem .85rem; color: #486273; background: #f1f7f5; border-left: 3px solid #269475; border-radius: 6px; font-size: .82rem; }
.filter-checklist { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.filter-checklist fieldset { min-width: 0; margin: 0; padding: .75rem .85rem; display: grid; gap: .45rem; border: 1px solid #d9e4e9; border-radius: 9px; }
.filter-checklist legend { padding: 0 .25rem; color: #4a6173; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.filter-checklist label { min-width: 0; display: flex; align-items: flex-start; gap: .5rem; color: #233e55; font-size: .82rem; line-height: 1.25; }
.filter-checklist input { width: auto; min-height: 0; margin: .08rem 0 0; }
.scanner-trigger { flex: 0 0 auto; }
.scanner-modal { width: min(94vw, 560px); padding: 0; color: #17354d; border: 0; border-radius: 14px; box-shadow: 0 25px 70px rgba(8,31,48,.32); }
.scanner-modal::backdrop { background: rgba(9,27,39,.68); }
.scanner-heading { padding: 1.1rem 1.2rem .2rem; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.scanner-heading h2 { margin: .1rem 0; }
.scanner-help, .scanner-status { margin: .7rem 1.2rem; }
.scanner-status { min-height: 1.2rem; color: #557084; font-size: .82rem; }
.scanner-reader { min-height: 240px; margin: 0 1.2rem; overflow: hidden; background: #101d27; border-radius: 10px; }
.scanner-reader video, .scanner-video { display: block; width: 100%; min-height: 240px; object-fit: cover; }
.batch-outcome-actions { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #dce6eb; }
.batch-outcome-actions .muted { margin-right: auto; }
.workflow-start { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.workflow-start .muted { margin: 0; }

@media (max-width: 1000px) {
    .topbar { gap: 1.5rem; }
    .stats-grid, .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
    .three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inline-part-form, .inline-reference-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shipment-create-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .approval-overview { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .history-row { grid-template-columns: minmax(0,.8fr) minmax(0,1.5fr); }
    .history-row strong, .history-row span, .history-row small { min-width: 0; overflow-wrap: anywhere; }
    .history-row small { grid-column: 1 / -1; text-align: left; }

    .parts-table-wrap { overflow: visible; }
    .parts-table, .parts-table tbody { display: block; width: 100%; }
    .parts-table thead { display: none; }
    .parts-table .part-table-row { margin: .75rem; padding: .45rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .25rem; background: #fff; border: 1px solid #dce6eb; border-radius: 11px; }
    .parts-table .part-table-row td { min-width: 0; padding: .55rem; display: block; border: 0; overflow-wrap: anywhere; }
    .parts-table .part-table-row td::before { margin-bottom: .22rem; display: block; color: #7a8997; font-size: .58rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
    .parts-table .part-table-row td:nth-child(1)::before { content: "Select"; }
    .parts-table .part-table-row td:nth-child(2)::before { content: "Part number"; }
    .parts-table .part-table-row td:nth-child(3)::before { content: "Cost"; }
    .parts-table .part-table-row td:nth-child(4)::before { content: "Part type"; }
    .parts-table .part-table-row td:nth-child(5)::before { content: "PO"; }
    .parts-table .part-table-row td:nth-child(6)::before { content: "Order date"; }
    .parts-table .part-table-row td:nth-child(7)::before { content: "Delivery no."; }
    .parts-table .part-table-row td:nth-child(8)::before { content: "Delivered"; }
    .parts-table .part-table-row td:nth-child(9)::before { content: "Status"; }
    .parts-table .part-table-row td:nth-child(10)::before { content: "Actions / Samsung return"; }
    .parts-table .part-table-row td:nth-child(11)::before { content: "Delete"; }
    .parts-table .part-actions-cell { grid-column: 1 / -1; }
    .parts-table tbody > tr:not(.part-table-row), .parts-table tbody > tr:not(.part-table-row) td { display: block; width: 100%; }
}

@media (max-width: 720px) {
    .topbar { padding: .7rem 1rem; flex-wrap: wrap; gap: .7rem 1rem; }
    .topbar nav { order: 3; width: 100%; min-height: 38px; gap: 1rem; }
    .user-menu { margin-left: auto; }
    .user-menu > div { display: none; }
    .page-heading, .detail-hero { align-items: flex-start; flex-direction: column; }
    .hero-status { align-items: flex-start; text-align: left; }
    .stats-grid, .form-grid, .three-columns { grid-template-columns: 1fr; }
    .part-summary, .receipt-form, .inline-part-form, .inline-reference-form { grid-template-columns: 1fr; }
    .receipt-notes { grid-column: auto; }
    .wide-field { grid-column: auto; }
    .heading-actions { align-items: flex-end; flex-direction: column; }
    .search-bar { align-items: stretch; flex-direction: column; }
    .form-panel { padding: 0 1rem; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 220px; padding: 2rem; }
    .login-brand h1 { font-size: 2.4rem; }
    .login-card { padding: 2rem; }
    .selection-list { grid-template-columns: 1fr; }
    .workflow-list li { grid-template-columns: 1fr; }
    .manager-queue-switcher { display: grid; grid-template-columns: 1fr; }
    .manager-queue-button { width: 100%; }
    .queue-filter { width: 100%; min-width: 0; }
    .approval-overview, .decision-summary { grid-template-columns: 1fr; }
    .filter-checklist { grid-template-columns: 1fr; }
    .scanner-trigger { width: 100%; }
    .batch-outcome-actions { align-items: stretch; flex-direction: column; }
    .batch-outcome-actions .primary-button { width: 100%; }
    .workflow-start { align-items: stretch; flex-direction: column; }
    .parts-table .part-table-row { grid-template-columns: 1fr; }
    .history-row { grid-template-columns: 1fr; gap: .35rem; }
    .history-row small { grid-column: auto; }

    .request-table, .request-table tbody { display: block; width: 100%; }
    .request-table thead { display: none; }
    .request-table tr { margin: .7rem; padding: .25rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid #dfe8ed; border-radius: 10px; }
    .request-table td { min-width: 0; padding: .55rem; display: block; white-space: normal; overflow-wrap: anywhere; border: 0; }
    .request-table td::before { content: attr(data-label); margin-bottom: .16rem; display: block; color: #7a8997; font-size: .58rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
    .request-table td:last-child { grid-column: 1 / -1; }
    .request-table td:last-child .primary-button { width: 100%; }

    .jobs-table colgroup, .jobs-table thead { display: none; }
    .jobs-table, .jobs-table tbody { display: block; width: 100%; }
    .jobs-table .job-table-row { margin: .65rem; padding: .25rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #dfe8ed; border-radius: 10px; overflow: hidden; }
    .jobs-table .job-table-row td { min-width: 0; padding: .55rem .7rem; display: block; white-space: normal; overflow-wrap: anywhere; border: 0; }
    .jobs-table .job-table-row td::before { content: attr(data-label); margin-bottom: .16rem; display: block; color: #7a8997; font-size: .58rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
    .jobs-table .job-table-row .status-cell { grid-column: 1 / -1; }
    .jobs-table .empty-row, .jobs-table .empty-row td { display: block; width: 100%; }
}

@media (max-width: 460px) {
    .stats-grid, .permission-grid { grid-template-columns: 1fr; }
    .page-shell { width: min(94vw, 1500px); padding-top: 1.5rem; }
    .details-list { grid-template-columns: 1fr; }
    .request-table tr { grid-template-columns: 1fr; }
}

.cookie-notice {
    position: fixed;
    z-index: 1000;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(94vw, 560px);
    padding: 1rem 1.1rem;
    color: #fff;
    background: #102334;
    border: 1px solid #355269;
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(16, 35, 52, .28);
}
.cookie-notice strong { display: block; margin-bottom: .25rem; }
.cookie-notice p { margin: 0; color: #dbe8ef; font-size: .9rem; line-height: 1.35; }
.cookie-notice .primary-button { flex: 0 0 auto; white-space: nowrap; }
.legal-footer { padding: 1rem 1.5rem 1.5rem; color: #8999a8; font-size: .72rem; line-height: 1.35; text-align: center; }
@media (max-width: 560px) {
    .cookie-notice { right: 3vw; bottom: 3vw; align-items: stretch; flex-direction: column; }
    .cookie-notice .primary-button { width: 100%; }
}
