:root{--bg:#f3f6fb;--card:#fff;--ink:#122033;--muted:#677487;--line:#dde5ef;--accent:#2357d9;--accent2:#173e9e;--good:#158058;--bad:#b42318;--nav:#101827}
*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}a{color:inherit}.topbar{background:var(--nav);color:#fff;padding:14px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px;position:sticky;top:0;z-index:10}.brand{font-weight:850}.nav{display:flex;gap:16px;flex-wrap:wrap}.nav a{text-decoration:none;color:#d7dfec;font-size:14px}.nav a:hover{color:#fff}.container{max-width:1220px;margin:28px auto;padding:0 18px}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}.page-head h1{margin:0}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:12px;color:var(--muted);font-weight:800}h1{font-size:29px;letter-spacing:-.025em}h2{font-size:20px;margin:30px 0 12px}.muted{color:var(--muted)}.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:15px;padding:18px;box-shadow:0 2px 10px rgba(20,30,45,.04)}.stat-card{text-decoration:none;display:block}.stat-label{font-size:13px;color:var(--muted)}.stat{font-size:30px;font-weight:850;margin-top:7px}.two-col{display:grid;grid-template-columns:1.6fr 1fr;gap:18px}table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden}th,td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;font-size:14px;vertical-align:top}th{background:#f8fafc;color:#354052}tr:last-child td{border-bottom:0}.btn{display:inline-block;background:var(--accent);color:#fff;padding:9px 13px;border:0;border-radius:9px;text-decoration:none;cursor:pointer;font-weight:700;font-size:14px}.btn:hover{background:var(--accent2)}.btn.secondary{background:#e8eef9;color:#17305e}.btn.good{background:var(--good)}.btn.danger{background:var(--bad)}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.actions form{margin:0}form.card,.form-narrow{max-width:820px}.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field{margin-bottom:14px}.field label{display:block;font-weight:700;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;padding:10px 11px;border:1px solid #cbd6e4;border-radius:9px;background:#fff;font:inherit}.field textarea{min-height:90px}.badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#edf2ff;font-size:12px;font-weight:800}.flash{padding:11px 14px;border-radius:9px;margin-bottom:14px;background:#eaf7ef;border:1px solid #b8e1c7}.login-wrap{max-width:430px;margin:70px auto}.empty{padding:30px;text-align:center;color:var(--muted)}.activity{padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}.low{font-weight:800;color:var(--bad)}.ok{font-weight:800;color:var(--good)}.location-form{display:flex;gap:6px}.location-form input{max-width:110px;padding:7px;border:1px solid #cbd6e4;border-radius:8px}@media(min-width:1280px){.container{max-width:1560px;padding-right:clamp(18px,2vw,30px);padding-left:clamp(18px,2vw,30px)}}@media(max-width:1000px){.grid{grid-template-columns:repeat(3,1fr)}.two-col{grid-template-columns:1fr}}@media(max-width:700px){.grid{grid-template-columns:1fr 1fr}.row{grid-template-columns:1fr}.topbar{align-items:flex-start;flex-direction:column}.page-head{align-items:flex-start;flex-direction:column}}


.line-items{display:grid;gap:10px;margin:8px 0 18px}
.line-item{display:grid;grid-template-columns:1fr 130px 42px;gap:10px;align-items:end;padding:12px;background:#f8fafc;border:1px solid var(--line);border-radius:12px}
.line-item .field{margin:0}.remove-line{width:42px;height:42px;border:0;border-radius:9px;background:#feeceb;color:#982018;font-size:20px;cursor:pointer}
.line-item .new-product-fields{grid-column:1 / -1}
.section-title{margin:22px 0 8px;font-size:16px}.helper{font-size:12px;color:var(--muted);margin-top:5px}
@media(max-width:700px){.line-item{grid-template-columns:1fr}.remove-line{width:100%}}
.commercial-summary{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:16px}.notice{padding:14px 16px;border-radius:10px;margin:14px 0}.notice-warning{background:#fff7df;border:1px solid #e8c65b}.notice-friendly{background:#eef6ff;border:1px solid #b8d4ee}.balance-amount{font-size:28px;font-weight:850}.money-credit{color:var(--good);font-weight:800}.money-debit{color:var(--bad);font-weight:800}.responsive-table{overflow-x:auto}.order-cards{display:grid;gap:12px}.order-card{background:#fff;border:1px solid var(--line);border-left:5px solid transparent;border-radius:13px;padding:15px}.order-card-head{display:flex;justify-content:space-between;gap:12px}.order-card-grid{display:grid;grid-template-columns:1fr 1.5fr 1fr 2fr;gap:14px;margin-top:12px}.order-card-grid .stat-label{display:block}.status-badge{display:inline-block;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:800}.status-picked{background:#fff0a8}.status-packed{background:#ffd4a3}.status-dispatched{background:#d5f1df;color:#135f3e}.status-cancelled{background:#e5e7eb;color:#62666d}.status-ready-to-pick{background:#f1f1f1}.status-row-picked{border-left-color:#d5ad00}.status-row-packed{border-left-color:#e17b13}.status-row-dispatched{border-left-color:#158058}.status-row-cancelled{border-left-color:#9ca3af}@media(max-width:700px){.order-card-grid{grid-template-columns:1fr 1fr}.commercial-summary{grid-template-columns:1fr}}
.toggle-control{display:flex!important;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:11px;cursor:pointer}.toggle-control input{position:absolute;opacity:0;width:1px!important;height:1px}.toggle-track{width:52px;height:28px;border-radius:999px;background:#aeb5bf;position:relative;flex:0 0 auto}.toggle-track:after{content:"";position:absolute;width:22px;height:22px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.15s}.toggle-control input:checked+.toggle-track{background:var(--good)}.toggle-control input:checked+.toggle-track:after{transform:translateX(24px)}.toggle-control input:focus-visible+.toggle-track{outline:3px solid #9db8ff}.toggle-control small{display:block;color:var(--muted);font-weight:400}.alert-line{display:grid;grid-template-columns:1.3fr 1fr auto;gap:12px;align-items:center;padding:8px 0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.commercial-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.commercial-metrics .card{display:flex;flex-direction:column;gap:5px}.commercial-metrics strong{font-size:22px}.shipping-metric{border-color:#93b9df}.attention-orders,.client-order-cards{display:grid;gap:12px}.attention-orders{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-items{margin:12px 0}.compact-costs,.client-order-meta{display:flex;gap:12px;flex-wrap:wrap;padding-top:10px;border-top:1px solid var(--line)}@media(max-width:700px){.alert-line{grid-template-columns:1fr}.section-head{align-items:flex-start;flex-direction:column}.commercial-metrics,.attention-orders{grid-template-columns:1fr 1fr}.compact-costs,.client-order-meta{flex-direction:column;gap:5px}}@media(max-width:480px){.commercial-metrics,.attention-orders{grid-template-columns:1fr}}
.monthly-totals{margin:14px 0}.overall-total{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;border-width:2px}.overall-total strong{font-size:24px}.report-orders{display:grid;gap:12px}.report-meta{display:flex;gap:16px;flex-wrap:wrap;color:var(--muted)}
.client-orders-wrap{overflow-x:auto}.client-orders-table .order-reference{display:block}.client-orders-table .source-reference{font-size:12px;margin-top:3px}.client-orders-table .items-summary{min-width:180px}.client-orders-table .quantity{text-align:center;font-weight:800;white-space:nowrap}.client-orders-table .money,.client-orders-table .courier,.client-orders-table .tracking{white-space:nowrap}@media(max-width:760px){.client-orders-wrap{overflow:visible}.client-orders-table,.client-orders-table tbody{display:block;background:transparent;border:0}.client-orders-table thead{display:none}.client-orders-table .client-order-record{display:block;background:#fff;border:1px solid var(--line);border-radius:13px;margin-bottom:12px;padding:10px 14px}.client-orders-table .client-order-record td{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-bottom:1px solid var(--line);padding:9px 0}.client-orders-table .client-order-record td:last-child{border-bottom:0}.client-orders-table .client-order-record td:before{content:attr(data-label);font-size:12px;font-weight:800;color:var(--muted)}.client-orders-table .quantity{text-align:left}.client-orders-table .items-summary{min-width:0}}
.collection-dashboard-section{margin-top:22px}.collection-dashboard-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:0;overflow:hidden}.collection-dashboard-card a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-right:1px solid var(--line);text-decoration:none}.collection-dashboard-card a:last-child{border-right:0}.collection-dashboard-card span{color:var(--muted);font-weight:700}.collection-dashboard-card strong{font-size:24px}.collection-summary-grid{align-items:start}.collection-summary-item{min-width:0}.collection-summary-item .stat-label{display:block;margin-bottom:5px;font-weight:800}.collection-summary-item>div{overflow-wrap:anywhere;line-height:1.45}@media(max-width:700px){.collection-dashboard-card{grid-template-columns:1fr}.collection-dashboard-card a{border-right:0;border-bottom:1px solid var(--line)}.collection-dashboard-card a:last-child{border-bottom:0}.collection-summary-grid{grid-template-columns:1fr}}

.fba-workflow{margin:0 0 20px;padding:20px;border:2px solid #111;border-top:6px solid var(--ph-red);border-radius:15px;background:#fff;box-shadow:0 5px 18px rgba(0,0,0,.08)}
.fba-workflow.complete{border-color:#158058;border-top-color:#158058;background:#f1faf5}
.fba-workflow-heading{display:flex;justify-content:space-between;gap:24px;align-items:center}
.fba-workflow-heading h2{margin:5px 0 6px;font-size:24px}
.fba-workflow-heading p{margin:0;color:var(--muted)}
.fba-workflow-units{min-width:125px;text-align:center;padding:12px;border-radius:12px;background:#f4f4f4}
.fba-workflow-units strong{display:block;font-size:30px;line-height:1}
.fba-workflow-units span{display:block;margin-top:5px;color:var(--muted);font-size:12px;font-weight:700}
.fba-workflow-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:18px}
.fba-workflow-step{display:flex;align-items:center;gap:7px;min-height:52px;padding:9px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:12px}
.fba-workflow-step span{display:grid;place-items:center;width:25px;height:25px;flex:0 0 auto;border-radius:50%;background:#e8e8e8;font-weight:850}
.fba-workflow-step.active{border:2px solid var(--ph-red);background:#fff3f3;color:#111}
.fba-workflow-step.active span{background:var(--ph-red);color:#fff}
.fba-workflow-step.done{background:#eef8f2;color:#155e42;border-color:#b9dfca}
.fba-workflow-step.done span{background:#158058;color:#fff}
.fba-workflow-totals{display:flex;flex-wrap:wrap;gap:10px 22px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line);font-size:13px}
.receiving-line-complete,.receiving-complete{padding:13px 15px;border:1px solid #b9dfca;border-radius:10px;background:#eef8f2;color:#155e42}
.receiving-complete{margin-top:16px}
.receiving-complete div{margin-top:4px;color:#356b57}
@media(max-width:760px){.fba-workflow-heading{align-items:flex-start;flex-direction:column}.fba-workflow-units{width:100%;text-align:left}.fba-workflow-steps{grid-template-columns:1fr}.fba-workflow-step{min-height:44px}.fba-workflow-totals{display:grid;grid-template-columns:1fr 1fr}}

/* Step 1 FBA receiving workspace */
.fba-receiving-workspace.active{border:2px solid #111;border-top:6px solid var(--ph-red);box-shadow:0 7px 22px rgba(0,0,0,.09)}
.fba-receiving-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.fba-receiving-heading h2{margin:4px 0 5px;font-size:25px}
.fba-receiving-heading p{margin:0}
.fba-receiving-summary{display:grid;grid-template-columns:repeat(4,minmax(90px,1fr));min-width:min(100%,520px);border:1px solid #d8d8d8;border-radius:12px;background:#f5f5f5;overflow:hidden}
.fba-receiving-summary span{padding:12px 14px;border-right:1px solid #d8d8d8;color:var(--muted);font-size:12px;font-weight:700;text-align:center;white-space:nowrap}
.fba-receiving-summary span:last-child{border-right:0}
.fba-receiving-summary strong{display:block;margin-bottom:2px;color:#111;font-size:21px;line-height:1.1}
.fba-receiving-form{margin-top:18px}
.fba-receiving-products{display:grid;gap:16px}
.fba-receiving-product{overflow:hidden;border:1px solid #cfd3d8;border-left:5px solid #90959c;border-radius:13px;background:#fff}
.fba-receiving-product.partial{border-left-color:#d49a16}
.fba-receiving-product.complete{border-color:#b9dfca;border-left-color:#158058;background:#f5fbf7}
.fba-receiving-product-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:17px 18px 15px}
.fba-receiving-product-head h3{margin:3px 0 4px;font-size:21px;overflow-wrap:anywhere}
.fba-receiving-status{flex:0 0 auto;padding:5px 9px;border-radius:999px;background:#ededed;color:#4b5057;font-size:12px;font-weight:800}
.fba-receiving-product.partial .fba-receiving-status{background:#fff2ce;color:#765400}
.fba-receiving-product.complete .fba-receiving-status{background:#d9f2e3;color:#155e42}
.fba-receiving-quantities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid #e1e3e6;border-bottom:1px solid #e1e3e6;background:#f7f7f7}
.fba-receiving-quantities div{padding:11px 18px;border-right:1px solid #e1e3e6}
.fba-receiving-quantities div:last-child{border-right:0}
.fba-receiving-quantities span{display:block;color:var(--muted);font-size:12px;font-weight:700}
.fba-receiving-quantities strong{display:block;margin-top:2px;color:#111;font-size:20px}
.fba-receiving-actions{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(260px,1.2fr);gap:14px;padding:16px 18px;background:#fff}
.fba-receiving-actions .field{margin:0;padding:12px;border:1px solid #bfc4ca;border-radius:10px;background:#fafafa}
.fba-receiving-actions .field:focus-within{border-color:var(--ph-red);box-shadow:0 0 0 2px rgba(227,21,23,.12)}
.fba-receiving-actions input,.fba-receiving-actions select{min-height:46px;border-color:#9299a2;background:#fff;font-size:16px}
.fba-receiving-complete-note{padding:13px 18px;border-top:1px solid #b9dfca;color:#356b57;font-weight:700}
.fba-receiving-submit{display:flex;align-items:center;gap:14px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.fba-receiving-submit button{background:var(--ph-red)}
.fba-receiving-submit span{color:var(--muted);font-size:13px}
.fba-supporting-section.secondary,.fba-following-stage.secondary{box-shadow:none;background:#fafafa;border-color:#e3e3e3}
.fba-supporting-section.secondary>h2,.fba-following-stage.secondary>h2{color:#4f555d}
@media(max-width:760px){.fba-receiving-heading{flex-direction:column}.fba-receiving-summary{width:100%;min-width:0;grid-template-columns:1fr 1fr}.fba-receiving-summary span:nth-child(2){border-right:0}.fba-receiving-summary span:nth-child(-n+2){border-bottom:1px solid #d8d8d8}.fba-receiving-product-head{flex-direction:column;gap:10px}.fba-receiving-actions{grid-template-columns:1fr}.fba-receiving-submit{align-items:stretch;flex-direction:column}.fba-receiving-submit button{width:100%;min-height:46px}.fba-receiving-quantities div{padding:10px}.fba-receiving-quantities strong{font-size:18px}}
@media(max-width:390px){.fba-receiving-summary{grid-template-columns:1fr}.fba-receiving-summary span{border-right:0;border-bottom:1px solid #d8d8d8}.fba-receiving-summary span:last-child{border-bottom:0}.fba-receiving-quantities{grid-template-columns:1fr}.fba-receiving-quantities div{display:flex;align-items:center;justify-content:space-between;border-right:0;border-bottom:1px solid #e1e3e6}.fba-receiving-quantities div:last-child{border-bottom:0}.fba-receiving-quantities strong{margin:0}}

/* FBA warehouse stages 2–5 */
.fba-stage-workspace{transition:border-color .15s ease,box-shadow .15s ease}
.fba-stage-workspace.active{border:2px solid #111;border-top:6px solid var(--ph-red);box-shadow:0 7px 22px rgba(0,0,0,.09)}
.fba-stage-workspace.secondary{border-color:#e3e3e3;background:#fafafa;box-shadow:none}
.fba-stage-workspace.complete{border-color:#b9dfca;border-left:5px solid #158058;background:#f7fbf8;box-shadow:none}
.fba-stage-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.fba-stage-heading h2{margin:4px 0 5px;font-size:25px}.fba-stage-heading p{margin:0;color:var(--muted)}
.fba-stage-total{min-width:145px;padding:12px;border-radius:11px;background:#f1f1f1;text-align:center}.fba-stage-total strong{display:block;font-size:28px;line-height:1}.fba-stage-total span{display:block;margin-top:5px;color:var(--muted);font-size:12px;font-weight:700}
.fba-operation-cards{display:grid;gap:14px;margin-top:16px}.fba-operation-cards.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
.fba-operation-card{overflow:hidden;border:1px solid #cfd3d8;border-left:5px solid #90959c;border-radius:13px;background:#fff}.fba-operation-card.partial{border-left-color:#d49a16}.fba-operation-card.complete{border-color:#b9dfca;border-left-color:#158058;background:#f5fbf7}
.fba-operation-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:16px 18px}.fba-operation-card-head h3{margin:3px 0 4px;font-size:20px;overflow-wrap:anywhere}
.fba-operation-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid #e1e3e6;border-bottom:1px solid #e1e3e6;background:#f7f7f7}.fba-operation-metrics div{padding:11px 18px;border-right:1px solid #e1e3e6}.fba-operation-metrics div:last-child{border-right:0}.fba-operation-metrics span{display:block;color:var(--muted);font-size:12px;font-weight:700}.fba-operation-metrics strong{display:block;margin-top:2px;font-size:20px}
.fba-location-list{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:13px 18px}.fba-location-list span{padding:5px 8px;border-radius:7px;background:#f0f0f0;font-size:13px}
.fba-prep-requirements{display:flex;gap:10px 18px;flex-wrap:wrap;padding:14px 18px;border-top:1px solid #e1e3e6}.fba-prep-requirements>span{font-size:14px}.fba-prep-requirements p{flex:1 0 100%;margin:0;padding-top:10px;border-top:1px solid #e5e5e5;white-space:pre-wrap}
.fba-stage-action{margin-top:16px;padding:16px;border:1px solid #bfc4ca;border-radius:11px;background:#fff}.fba-stage-workspace.active .fba-stage-action{border-left:5px solid var(--ph-red)}.fba-stage-action .field{margin-bottom:12px}.fba-stage-action button{min-height:44px;background:var(--ph-red)}
.fba-stage-action .btn.secondary{background:#fff;color:#111;border:1px solid #7e8792}.fba-dispatch-primary{background:var(--ph-red);min-height:44px}
.fba-shipment-card{margin-top:15px;padding:16px;border:1px solid #cfd3d8;border-radius:12px;background:#fff}.fba-shipment-card:last-child{border-bottom:1px solid #cfd3d8}
@media(max-width:760px){.fba-stage-heading,.fba-operation-card-head{flex-direction:column}.fba-stage-total{width:100%;text-align:left}.fba-operation-cards.compact{grid-template-columns:1fr}.fba-operation-metrics{grid-template-columns:1fr}.fba-operation-metrics div{display:flex;align-items:center;justify-content:space-between;border-right:0;border-bottom:1px solid #e1e3e6}.fba-operation-metrics div:last-child{border-bottom:0}.fba-operation-metrics strong{margin:0}.fba-stage-action button{width:100%;min-height:46px}.fba-location-list{align-items:flex-start;flex-direction:column}.fba-location-list span{width:100%}}


/* Prep Horizon branding */

:root {
    --ph-black: #000000;
    --ph-red: #e31517;
    --ph-white: #ffffff;
    --ph-light: #f5f6f8;
}

.topbar {
    background: var(--ph-black);
    border-bottom: 3px solid var(--ph-red);
}

.topbar .nav a {
    color: var(--ph-white);
}

.topbar .nav a:hover {
    color: var(--ph-red);
}

.brand {
    display: flex;
    align-items: center;
    height: 64px;
    overflow: hidden;
}

.brand img {
    height: 115px !important;
    width: auto !important;
    display: block;
}


/* Prep Horizon core interface palette */

:root {
    --bg: #f5f5f5;
    --card: #ffffff;
    --ink: #111111;
    --muted: #666666;
    --line: #dedede;
    --accent: #000000;
    --accent2: #e31517;
    --bad: #e31517;
    --nav: #000000;
}


/* Prep Horizon login page */

.login-wrap {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 32px;
    border-top: 4px solid var(--ph-red);
}

.login-logo {
    display: block;
    width: 100%;
    max-width: 380px;
    height: auto;
    margin: 0 auto 8px;
}

.login-card h1 {
    margin: 0;
    text-align: center;
}

.login-card .muted {
    text-align: center;
    margin-bottom: 24px;
}

.login-card .btn {
    width: 100%;
    background: var(--ph-black);
    color: var(--ph-white);
}

.login-card .btn:hover {
    background: var(--ph-red);
}

.login-card input:focus {
    border-color: var(--ph-red);
    outline: none;
}


/* Prep Horizon secondary controls */

.btn.secondary {
    background: #f1f1f1;
    color: var(--ph-black);
    border: 1px solid #d6d6d6;
}

.btn.secondary:hover {
    background: var(--ph-black);
    color: var(--ph-white);
    border-color: var(--ph-black);
}

.badge {
    background: #f1f1f1;
    color: var(--ph-black);
    border: 1px solid #dddddd;
}

/* Amazon FBA form layout */

.fba-product-line,
.fba-delivery {
    position: relative;
    display: grid;
    gap: 12px;
    align-items: end;
    padding: 16px 56px 16px 16px;
}

.fba-product-line {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.fba-product-line > .fba-product-identity-field {
    grid-column: span 9;
}

.fba-product-line > .fba-quantity-field {
    grid-column: span 3;
}

.fba-product-line > .fba-asin-field,
.fba-product-line > .fba-fnsku-field,
.fba-product-line > .fba-gated-field {
    grid-column: span 4;
}

.fba-product-line > .fba-bundling-required-field,
.fba-product-line > .fba-bundle-units-field,
.fba-product-line > .fba-bundle-instructions-field {
    grid-column: span 4;
}

.fba-product-line > .fba-new-product-fields,
.fba-product-line > .fba-prep-instructions-field {
    grid-column: 1 / -1;
}

/* Keep the client creation fields in readable desktop rows without changing
   the shared Admin correction layout. */
.fba-create-product-line > .fba-product-identity-field,
.fba-create-product-line > .fba-seller-sku-field {
    grid-column: span 6;
}

.fba-create-product-line > .fba-quantity-field,
.fba-create-product-line > .fba-asin-field,
.fba-create-product-line > .fba-fnsku-field {
    grid-column: span 4;
}

.fba-create-product-line > .fba-gated-field,
.fba-create-product-line > .fba-bundling-required-field {
    grid-column: span 6;
}

.fba-create-product-line > .fba-bundle-units-field {
    grid-column: span 4;
}

.fba-create-product-line > .fba-bundle-instructions-field {
    grid-column: span 8;
}

.fba-create-product-line > .fba-prefill-message {
    grid-column: 1 / -1;
}

.fba-prep-instructions-field textarea {
    min-height: 96px;
    resize: vertical;
}

.fba-delivery {
    grid-template-columns: 2fr 2fr 1fr 1fr;
}

.fba-product-line .field,
.fba-delivery .field {
    min-width: 0;
}

.fba-product-line input,
.fba-product-line select,
.fba-product-line textarea,
.fba-delivery input {
    width: 100%;
}

.remove-fba-product,
.remove-fba-delivery {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .fba-product-line,
    .fba-delivery {
        grid-template-columns: 1fr;
        padding-right: 56px;
    }

    .fba-product-line > .field,
    .fba-product-line > .fba-new-product-fields {
        grid-column: 1;
    }
}

/* Mobile-first client portal polish */

:focus-visible {
    outline: 3px solid #8eafff;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.client-nav,
.client-nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-nav-links {
    flex-wrap: wrap;
}

.client-logout {
    white-space: nowrap;
}

.client-dashboard-head h1 {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.client-dashboard-head p {
    margin-top: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.customer-address,
.commercial-items,
.tracking,
.courier,
.shipping-ledger-entry td {
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .client-topbar {
        gap: 6px;
        padding: 8px 12px;
    }

    .client-topbar .brand {
        height: 44px;
    }

    .client-topbar .brand img {
        height: 80px !important;
    }

    .client-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        width: 100%;
    }

    .client-nav-links {
        gap: 4px;
        flex-wrap: nowrap;
        min-width: 0;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .client-nav-links::-webkit-scrollbar {
        display: none;
    }

    .client-nav a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 10px;
        border-radius: 8px;
        white-space: nowrap;
    }

    .client-nav-links a {
        background: #171717;
    }

    .client-logout {
        border: 1px solid #555;
    }

    .client-portal .container {
        margin: 18px auto;
        padding: 0 12px;
    }

    .client-portal h1 {
        font-size: 25px;
    }

    .client-portal h2 {
        margin-top: 24px;
    }

    .client-portal .card {
        padding: 14px;
        border-radius: 12px;
    }

    .client-portal .btn,
    .client-portal button,
    .client-portal .field input,
    .client-portal .field select {
        min-height: 44px;
    }

    .client-order-form {
        width: 100%;
        padding: 14px;
    }

    .client-order-form .field input,
    .client-order-form .field select,
    .client-order-form .field textarea {
        font-size: 16px;
    }

    .client-order-form textarea[name="customer_details_raw"] {
        min-height: 132px;
    }

    .client-order-form #add-line,
    .client-order-form button[value="parse_customer_details"] {
        width: 100%;
    }

    .client-order-form .line-item {
        padding: 12px;
    }

    .client-order-form .remove-line {
        min-height: 44px;
    }

    .client-portal .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-portal .form-actions .btn {
        width: 100%;
        text-align: center;
    }

    .client-portal .flash,
    .client-portal .notice {
        overflow-wrap: anywhere;
    }

    .client-data-table,
    .client-data-table tbody,
    .client-portal .shipping-ledger-table,
    .client-portal .shipping-ledger-table tbody {
        display: block;
        border: 0;
        background: transparent;
    }

    .client-data-table thead,
    .client-portal .shipping-ledger-table thead {
        display: none;
    }

    .client-data-table tr,
    .client-portal .shipping-ledger-entry {
        display: block;
        margin-bottom: 10px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }

    .client-data-table td,
    .client-portal .shipping-ledger-entry td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid var(--line);
    }

    .client-data-table td:last-child,
    .client-portal .shipping-ledger-entry td:last-child {
        border-bottom: 0;
    }

    .client-data-table td::before,
    .client-portal .shipping-ledger-entry td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

    .client-orders-table .client-order-record {
        display: flex;
        flex-direction: column;
        border-left: 5px solid var(--line);
        padding: 8px 12px;
    }

    .client-orders-table .client-order-record td {
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 8px 0;
    }

    .client-orders-table .client-order-record td[data-label="Reference"] {
        order: -2;
        font-size: 16px;
    }

    .client-orders-table .client-order-record td[data-label="Status"] {
        order: -1;
    }

    .client-order-detail .order-summary-grid {
        gap: 4px;
    }

    .client-order-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .client-order-actions form,
    .client-order-actions .btn,
    .client-order-actions button {
        width: 100%;
        margin: 0;
        text-align: center;
    }

    .client-portal .shipping-ledger-wrap {
        overflow: visible;
    }

    .client-portal .shipping-ledger-entry td[data-label="Amount"] {
        font-size: 16px;
    }

    .client-portal .shipping-balance-head {
        padding: 14px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid var(--line);
    }

    .client-portal .shipping-balance-head .balance-amount {
        font-size: 30px;
    }
}

@media (max-width: 360px) {
    .client-order-actions {
        grid-template-columns: 1fr;
    }

    .client-data-table td,
    .client-portal .shipping-ledger-entry td,
    .client-orders-table .client-order-record td {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 8px;
    }
}

/* Client Create/Edit Order use a wider centred workspace on desktop. */
.client-order-create-page,
.client-order-edit-page {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
}

.client-order-create-page .client-order-form,
.client-order-edit-page .client-order-form {
    max-width: none;
}

/* Field-level validation on the client FBA creation form. */
.fba-create-form .field.has-error input,
.fba-create-form .field.has-error select,
.fba-create-form .field.has-error textarea {
    border-color: var(--bad);
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

.fba-create-form .form-field-error {
    color: var(--bad);
    font-size: 13px;
    font-weight: 750;
    margin: 6px 0 0;
}

.fba-create-form .form-error-summary {
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--bad);
    border-radius: 9px;
    color: #7f1d1d;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.fba-create-form .form-error-summary p {
    margin: 5px 0 0;
}

/* Keep the admin cancellation explanation separate from compact order actions. */
.actions {
    align-items: flex-start;
}

.actions .admin-order-cancellation-form {
    flex: 1 0 100%;
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.admin-order-cancellation-form label,
.admin-order-cancellation-form textarea {
    width: 100%;
}

.admin-order-cancellation-form textarea {
    min-height: 132px;
    padding: 11px 12px;
    border: 1px solid #cbd6e4;
    border-radius: 9px;
    background: #fff;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

@media (max-width: 700px) {
    .actions .admin-order-cancellation-form {
        max-width: none;
    }

    .admin-order-cancellation-form .btn {
        width: 100%;
        min-height: 44px;
    }
}

.carton-status-amber { background: #fff1c2; color: #694600; }
.carton-status-red { background: #fee6e6; color: #8d2020; }
.carton-status-expired { background: #8d2020; color: #fff; }
#sealed-carton-receipt fieldset { min-width: 0; margin: 0 0 12px; }
#sealed-carton-receipt legend { font-weight: 700; }
