/* assets/css/order.css
   Styling for the /order assembly stream. Scoped under .fm-order.
   Tokens from foremost-digital-standards.html:
   navy #121d3c, blue1 #0061fe, blue2 #0039c7, blue4 #87c2ff, blue5 #e8effd, neon #ccff00.
   Radii: button 60px, box 30px, small 16px. */

.fm-order{max-width:1000px;margin:0 auto;padding:8px 16px 120px;color:#121d3c}
.fm-order__head{margin-bottom:16px}
.fm-order__title{font-size:28px;font-weight:700;color:#121d3c;margin:0 0 4px}
.fm-order__sub{font-size:14px;color:#121d3c;margin:0;line-height:1.5;max-width:640px}

/* ---- controls: source chips + date window ---- */
.fm-order__controls{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:18px;padding-bottom:18px;border-bottom:1px solid #e8effd}
.fm-chips{display:flex;gap:10px;flex-wrap:wrap}
.fm-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:2px solid #87c2ff;border-radius:60px;font-size:13px;font-weight:400;cursor:pointer;transition:background .15s,border-color .15s;user-select:none}
.fm-chip:hover{background:#e8effd}
.fm-chip.is-on{background:#0061fe;border-color:#0061fe;color:#fff}
.fm-chip input{position:absolute;opacity:0;width:0;height:0}
.fm-chip__badge{font-size:13px;line-height:1}
.fm-order__dates{display:flex;align-items:center;gap:8px;font-size:12px;color:rgba(18,29,60,.6)}
.fm-order__dates input[type="date"]{font-family:inherit;font-size:13px;color:#121d3c;border:2px solid #87c2ff;border-radius:16px;height:38px;padding:0 10px;outline:none}
.fm-order__dates input[type="date"]:focus{border-color:#0061fe;box-shadow:0 0 0 3px rgba(0,97,254,.15)}

/* ---- toolbar: search (left) + fill/bulk actions (right) ---- */
.fm-order__toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:16px}
.fm-order__actions{display:flex;gap:10px;flex-wrap:wrap}
.fm-search{position:relative;flex:1;min-width:220px;max-width:360px}
.fm-search__input{width:100%;height:44px;padding:0 44px 0 16px;border:2px solid #87c2ff;border-radius:30px;font-family:inherit;font-size:14px;color:#121d3c;background:#fff;outline:none;transition:border-color .15s,box-shadow .15s}
.fm-search__input:focus{border-color:#0061fe;box-shadow:0 0 0 3px rgba(0,97,254,.15)}
.fm-search__input::placeholder{color:rgba(18,29,60,.45)}
.fm-search__icon{position:absolute;right:16px;top:50%;transform:translateY(-50%);color:#87c2ff;font-size:16px;pointer-events:none}

/* ---- badges (also used inside chips) ---- */
.fm-badge{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;font-size:12px;line-height:1;box-shadow:0 1px 3px rgba(18,29,60,.2)}
.fm-badge--sitefav{background:#ccff00;color:#121d3c}
.fm-badge--compfav{background:#121d3c;color:#fff}
.fm-badge--hist{background:#0061fe;color:#fff}
.fm-badge--allhist{background:#0d85ff;color:#fff}

/* ---- stream rows ---- */
.fm-order__stream{display:flex;flex-direction:column;gap:10px}
.fm-oline{display:flex;align-items:center;gap:16px;background:#fff;border:1px solid #e8effd;border-radius:30px;padding:14px 18px;transition:box-shadow .15s}
.fm-oline:hover{box-shadow:0 4px 24px rgba(0,97,254,.08)}
.fm-oline__img{position:relative;width:64px;height:64px;flex-shrink:0}
.fm-oline__img img{width:100%;height:100%;object-fit:contain;border-radius:16px;background:#f7f9ff}
.fm-oline__badges{position:absolute;top:-6px;left:-6px;display:flex;flex-direction:column;gap:4px}
.fm-oline__info{flex:1;min-width:0}
.fm-oline__title{margin:0 0 2px;font-size:14px;font-weight:700;line-height:1.35}
.fm-oline__title a{color:#121d3c;text-decoration:none}
.fm-oline__title a:hover{color:#0061fe}
.fm-oline__sku{font-size:12px;color:#121d3c}
.fm-oline__hist{font-size:12px;color:#121d3c;margin-top:4px}
.fm-oline__hist strong{color:#0061fe;font-weight:700}
.fm-oline__price{font-size:15px;font-weight:700;color:#121d3c;flex-shrink:0;min-width:72px;text-align:right}
.fm-oline__qty{display:flex;align-items:center;gap:10px;flex-shrink:0}

/* ---- qty stepper (matches basket look) ---- */
.fm-qty{display:inline-flex;align-items:center;border:2px solid #87c2ff;border-radius:60px;overflow:hidden;height:40px}
.fm-qty__btn{width:36px;height:100%;border:0;background:#e8effd;color:#0061fe;font-size:18px;line-height:1;cursor:pointer;transition:background .15s}
.fm-qty__btn:hover{background:#87c2ff}
.fm-qty__input{width:48px;height:100%;border:0;text-align:center;font-family:inherit;font-size:14px;color:#121d3c;outline:none;-moz-appearance:textfield}
.fm-qty__input::-webkit-outer-spin-button,.fm-qty__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* ---- buttons ---- */
.fm-btn{-webkit-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;min-width:120px;height:44px;padding:0 24px;border-radius:60px;border:2px solid transparent;font-family:inherit;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1;cursor:pointer;text-decoration:none;transition:background .15s,border-color .15s,transform .15s}
.fm-btn:hover{transform:scale(1.03)}
@media(prefers-reduced-motion:reduce){.fm-btn:hover{transform:none}}
.fm-btn--sm{min-width:auto;height:38px;padding:0 18px;font-size:13px}
.fm-btn--primary{background:#0061fe;color:#fff;border-color:#0061fe}
.fm-btn--primary:hover{background:#0039c7;border-color:#0039c7}
.fm-btn--primary:active{background:#121d3c;border-color:#121d3c}
.fm-btn--secondary{background:#fff;color:#0061fe;border-color:#0061fe}
.fm-btn--secondary:hover{background:#e8effd}

/* ---- empty state ---- */
.fm-order__empty{text-align:center;padding:64px 24px;background:#e8effd;border-radius:30px}
.fm-order__empty-icon{font-size:44px;margin-bottom:12px}
.fm-order__empty h2{font-size:20px;font-weight:700;margin:0 0 8px}
.fm-order__empty p{font-size:14px;color:rgba(18,29,60,.6);margin:0 0 20px;line-height:1.6}

/* ---- sticky review bar ---- */
.fm-order__bar{position:sticky;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:#fff;border-top:1px solid #e8effd;padding:14px 16px;margin-top:20px}
.fm-order__bar-note{font-size:13px;color:rgba(18,29,60,.6)}

/* ---- toasts ---- */
.fm-toast-container{position:fixed;top:20px;right:20px;z-index:400;display:flex;flex-direction:column;gap:8px}
.fm-toast{background:#fff;border-radius:30px;padding:14px 20px;box-shadow:0 24px 80px rgba(18,29,60,.25);font-size:13px;color:#121d3c;border-left:4px solid #ccff00;animation:fmToastIn .3s ease-out}
.fm-toast--info{border-left-color:#0061fe}
@keyframes fmToastIn{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:translateX(0)}}

/* ---- mobile ---- */
@media(max-width:640px){
	.fm-oline{flex-wrap:wrap;gap:10px}
	.fm-oline__price{order:3;text-align:left;min-width:0}
	.fm-oline__qty{order:4;margin-left:auto}
	.fm-order__controls{flex-direction:column;align-items:stretch}
}

/* ============================================================
   TABS (shared by /order and /order/repeat)
   ============================================================ */
.fm-tabs{display:flex;gap:0;border-bottom:2px solid #e8effd;margin-bottom:20px}
.fm-tab{padding:12px 22px;font-size:14px;color:rgba(18,29,60,.6);text-decoration:none;border-bottom:3px solid transparent;margin-bottom:-2px;transition:color .15s,border-color .15s}
.fm-tab:hover{color:#121d3c}
.fm-tab.is-active{color:#0061fe;font-weight:700;border-bottom-color:#0061fe}

/* ============================================================
   REPEAT-AN-ORDER LIST
   ============================================================ */
.fm-rlist{display:flex;flex-direction:column;border:1px solid #e8effd;border-radius:30px;overflow:hidden}
.fm-rhead{display:grid;grid-template-columns:36px 110px 1fr 130px 90px 116px;gap:12px;align-items:center;padding:12px 18px;background:#e8effd;font-size:12px;font-weight:700;color:#121d3c}
.fm-ro__expand-sp{display:block}

.fm-ro{border-top:1px solid #e8effd}
.fm-ro:first-child{border-top:none}
.fm-ro__main{display:grid;grid-template-columns:36px 110px 1fr 130px 90px 116px;gap:12px;align-items:center;padding:12px 18px;transition:background .15s}
.fm-ro__main:hover{background:#f7f9ff}
.fm-ro__expand{width:28px;height:28px;border:0;background:#e8effd;color:#0061fe;border-radius:50%;cursor:pointer;font-size:12px;line-height:1;transition:background .15s}
.fm-ro__expand:hover{background:#87c2ff}
.fm-ro__cell{font-size:14px;color:#121d3c;min-width:0}
.fm-ro__ref{font-weight:700}
.fm-ro__mine{display:inline-block;margin-left:8px;padding:2px 10px;border-radius:16px;background:#ccff00;color:#121d3c;font-size:11px;font-weight:700}
.fm-ro__site,.fm-ro__lines{color:rgba(18,29,60,.7)}
.fm-ro__action{text-align:right}

/* detail (lazy-loaded lines) */
.fm-ro__detail{padding:0 18px 16px 62px;background:#f7f9ff}
.fm-ro__loading{padding:14px 0;font-size:13px;color:rgba(18,29,60,.6)}
.fm-ro__lines{width:100%;border-collapse:collapse;margin-top:8px}
.fm-ro__lines th{text-align:left;font-size:11px;font-weight:700;color:rgba(18,29,60,.6);padding:6px 10px;border-bottom:1px solid #e8effd}
.fm-ro__lines td{font-size:13px;color:#121d3c;padding:8px 10px;border-bottom:1px solid #eef3fe}
.fm-ro__lines tr:last-child td{border-bottom:none}
.fm-ro__qty{text-align:right;white-space:nowrap}

/* ---- mobile: list rows become cards ---- */
@media(max-width:640px){
	.fm-rlist{border-radius:16px}
	.fm-rhead{display:none}
	.fm-ro__main{grid-template-columns:1fr;gap:8px;padding:16px 18px;position:relative}
	.fm-ro__expand{position:absolute;top:14px;right:16px}
	.fm-ro__cell{display:flex;justify-content:space-between;gap:12px}
	.fm-ro__cell::before{content:attr(data-label);font-weight:700;color:rgba(18,29,60,.55);font-size:12px}
	.fm-ro__ref{padding-right:40px}
	.fm-ro__action{margin-top:4px}
	.fm-ro__action::before{content:none}
	.fm-ro__action .fm-btn{width:100%}
	.fm-ro__detail{padding-left:18px}
}

/* ============================================================
   INPUT LIST
   ============================================================ */
.fm-input{margin-bottom:20px}
.fm-input__box{width:100%;border:2px solid #87c2ff;border-radius:16px;padding:14px 16px;font-family:inherit;font-size:14px;line-height:1.6;color:#121d3c;background:#fff;outline:none;resize:vertical;transition:border-color .15s,box-shadow .15s}
.fm-input__box:focus{border-color:#0061fe;box-shadow:0 0 0 3px rgba(0,97,254,.15)}
.fm-input__box::placeholder{color:rgba(18,29,60,.4)}
.fm-input__actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:12px}
.fm-input__actions--foot{justify-content:flex-end;margin-top:16px}
.fm-input__hint{font-size:12px;color:rgba(18,29,60,.6)}

.fm-mtable{border:1px solid #e8effd;border-radius:30px;overflow:hidden}
.fm-mhead{display:grid;grid-template-columns:1fr 1.4fr 190px 90px;gap:12px;align-items:center;padding:12px 18px;background:#e8effd;font-size:12px;font-weight:700;color:#121d3c}
.fm-mrow{display:grid;grid-template-columns:1fr 1.4fr 190px 90px;gap:12px;align-items:center;padding:12px 18px;border-top:1px solid #e8effd}
.fm-m__cell{font-size:14px;color:#121d3c;min-width:0}
.fm-m__input{color:rgba(18,29,60,.75)}
.fm-m__code{font-weight:700}
.fm-m__none{color:rgba(18,29,60,.4)}
.fm-m__pill{display:inline-block;margin-left:6px;padding:2px 8px;border-radius:16px;background:#ccff00;color:#121d3c;font-size:11px;font-weight:700}
.fm-m__badge{display:inline-block;padding:3px 12px;border-radius:16px;font-size:11px;font-weight:700}
.fm-m__badge.is-ok{background:#ccff00;color:#121d3c}
.fm-m__badge.is-warn{background:#e8effd;color:#0061fe}
.fm-m__badge.is-error{background:rgba(231,76,60,.12);color:#c0392b}
.fm-m__qty{text-align:right}
.fm-m__qtycell{text-align:right}
.fm-m__qty-input{width:70px;height:38px;border:2px solid #87c2ff;border-radius:16px;text-align:center;font-family:inherit;font-size:14px;color:#121d3c;outline:none}
.fm-m__qty-input:focus{border-color:#0061fe;box-shadow:0 0 0 3px rgba(0,97,254,.15)}

@media(max-width:640px){
	.fm-mhead{display:none}
	.fm-mrow{grid-template-columns:1fr;gap:8px}
	.fm-m__cell{display:flex;justify-content:space-between;gap:12px}
	.fm-m__cell::before{content:attr(data-label);font-weight:700;color:rgba(18,29,60,.55);font-size:12px}
	.fm-m__qtycell{text-align:left}
}
.fm-m__conf{display:inline-block;margin-left:6px;font-size:11px;font-weight:700;color:rgba(18,29,60,.5)}

/* ---- input-list per-line trace ---- */
.fm-mitem{border-top:1px solid #e8effd}
.fm-mitem:first-child{border-top:none}
.fm-mitem .fm-mrow{border-top:none}
.fm-m__why{background:none;border:none;color:#0061fe;font-size:11px;cursor:pointer;padding:0 4px;text-decoration:underline}
.fm-mtrace{background:#f7f9ff;padding:12px 18px;font-size:12px;color:#121d3c}
.fm-tr__row{margin-bottom:4px;line-height:1.5}
.fm-tr__decision{margin-top:6px;color:#0039c7}
.fm-tr__tbl{width:100%;border-collapse:collapse;margin:4px 0 8px}
.fm-tr__tbl th{text-align:left;font-size:11px;color:rgba(18,29,60,.6);padding:4px 8px;border-bottom:1px solid #e8effd}
.fm-tr__tbl td{font-size:12px;padding:4px 8px;border-bottom:1px solid #eef3fe;vertical-align:top}
.fm-tr__ok{color:#0a7a28;font-weight:700}
.fm-tr__no{color:#c0392b;text-decoration:line-through;opacity:.75}
.fm-order__scopenote{font-size:12px;color:rgba(18,29,60,.6);margin:0}
.fm-ro__web{display:inline-block;margin-left:8px;font-size:11px;color:rgba(18,29,60,.55);font-weight:400}