/* ==========================================================================
   BPE Trade Portal — self-contained styles (scoped under body.bpe)
   ========================================================================== */
.bpe *, .bpe *::before, .bpe *::after { box-sizing: border-box; }

body.bpe {
	--navy: #1a1c30;
	--navy-2: #262a48;
	--cyan: #22c6f0;        /* brand bright cyan — fills, badges, active state */
	--cyan-dark: #12a6d0;   /* hover for cyan fills */
	--blue: #0e9dcb;        /* readable cyan for text / links on light bg */
	--blue-dark: #0b82ab;
	--ink: #1a2233;
	--muted: #667085;
	--line: #e5e8ef;
	--bg: #f4f6fb;
	--white: #ffffff;
	--green: #16a34a;
	--radius: 12px;
	--shadow: 0 10px 30px rgba(16, 32, 64, .08);

	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
}

.bpe a { text-decoration: none; }
/* Normal links inherit text colour; buttons and sidebar nav keep their own. */
.bpe a:not(.bpe-btn):not(.bpe-nav__item):not(.bpe-nav__logout) { color: inherit; }

/* ---------- Login split screen ---------- */
.bpe-split { display: flex; min-height: 100vh; }
.bpe-split__brand {
	flex: 1 1 46%;
	background: linear-gradient(160deg, var(--navy) 0%, #0f1124 100%);
	color: #eaf0ff;
	padding: 48px 56px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	overflow: hidden;
}
.bpe-split__brand::after {
	content: ""; position: absolute; inset: 0;
	background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
	background-size: 26px 26px; opacity: .5; pointer-events: none;
}
.bpe-split__form {
	flex: 1 1 54%;
	background: var(--bg);
	display: flex; align-items: center; justify-content: center;
	padding: 40px;
}
.bpe-split__form--full { flex: 1 1 100%; }

.bpe-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: .3px; position: relative; z-index: 1; }
.bpe-brand__logo { flex: 0 0 auto; width: 42px; height: 42px; display: block; }
.bpe-split__mid { position: relative; z-index: 1; max-width: 460px; }
.bpe-eyebrow {
	display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
	text-transform: uppercase; color: #8fa6d8;
}
.bpe-eyebrow--blue { color: var(--cyan); }
.bpe-hero { font-size: 44px; line-height: 1.08; margin: 14px 0 18px; font-weight: 800; letter-spacing: -.5px; }
.bpe-hero span { color: #57d3f5; }
.bpe-hero__sub { color: #c2cde6; font-size: 16px; max-width: 420px; }
.bpe-features { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; display: grid; gap: 16px; }
.bpe-features li { display: flex; flex-direction: column; padding-left: 16px; border-left: 2px solid rgba(87,211,245,.5); }
.bpe-features strong { font-size: 15px; }
.bpe-features span { font-size: 13px; color: #a9b7d6; }

/* ---------- Card + form ---------- */
.bpe-card {
	width: 100%; max-width: 420px; background: var(--white);
	border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow);
	border: 1px solid var(--line);
}
.bpe-card h2 { margin: 8px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.bpe-muted { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.bpe-form { display: flex; flex-direction: column; }
.bpe-form label { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.bpe-form input[type=text], .bpe-form input[type=password], .bpe-form input[type=email] {
	width: 100%; padding: 12px 14px; font-size: 15px;
	border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; color: var(--ink);
	transition: border-color .15s, box-shadow .15s;
}
.bpe-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); background: #fff; }
.bpe-form__row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 22px; font-size: 13px; }
.bpe-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }

.bpe-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
	border: 1px solid transparent; cursor: pointer; position: relative;
	transition: background .15s, transform .08s, box-shadow .15s;
}
.bpe-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,32,64,.18); }
.bpe-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(16,32,64,.15); }
.bpe-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,169,224,.35); }
.bpe-btn--primary { background: var(--navy); color: #fff; }
.bpe-btn--primary:hover { background: var(--navy-2); }
.bpe-btn--block { width: 100%; }
.bpe-btn--blue { background: var(--cyan); color: var(--navy); }
.bpe-btn--blue:hover { background: var(--cyan-dark); color: #fff; }
.bpe-btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.bpe-btn--ghost:hover { border-color: #c7cede; }
.bpe-btn--green { background: var(--navy); color: #fff; }
.bpe-btn--green:hover { background: var(--navy-2); }
/* "Working…" state after submit — visual only, doesn't disable the button. */
.bpe-btn.is-loading { pointer-events: none; }
.bpe-btn.is-loading::before {
	content: ""; width: 15px; height: 15px; border-radius: 50%;
	border: 2px solid currentColor; border-right-color: transparent;
	animation: bpe-spin .6s linear infinite;
}
@keyframes bpe-spin { to { transform: rotate(360deg); } }

/* Quantity stepper (− input +) */
.bpe-step { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(16,32,64,.05); transition: border-color .15s, box-shadow .15s; }
.bpe-step:hover { border-color: #c7cede; }
.bpe-step:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,169,224,.18); }
.bpe-step__btn { width: 34px; flex: 0 0 auto; border: none; background: #fff; color: var(--navy); font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; user-select: none; display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.bpe-step__btn:hover { background: var(--cyan); color: #fff; }
.bpe-step__btn:active { background: var(--cyan-dark); }
.bpe-step .bpe-qty { border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; width: 46px; text-align: center; padding: 0 2px; font-size: 14px; font-weight: 600; font-family: inherit; background: #fff; color: var(--ink); -moz-appearance: textfield; }
.bpe-step .bpe-qty::-webkit-outer-spin-button, .bpe-step .bpe-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bpe-step .bpe-qty:focus { outline: none; }
.bpe-step .bpe-qty::placeholder { color: #c2c9d6; font-weight: 400; }
/* Optional per-line "employee name / ref" box, revealed once a qty is entered */
.bpe-qtycell { display: flex; align-items: center; gap: 14px; width: 100%; flex-wrap: wrap; }
.bpe-qty-ref { flex: 1 1 auto; min-width: 0; max-width: 300px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.bpe-qty-ref::placeholder { color: #98a2b3; }
.bpe-qty-ref:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,169,224,.18); }
/* Keep the box's space reserved even when empty so the table columns never reflow. */
.bpe-qty-ref.is-off { visibility: hidden; }

/* ---------- My Details layout ---------- */
.bpe-details-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.bpe-details-top > .bpe-panel { min-width: 0; margin-bottom: 0; }
@media (max-width: 900px) { .bpe-details-top { grid-template-columns: 1fr; } }

/* Delivery address fields laid out in two columns to fill the panel width */
.bpe-addrgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.bpe-addrgrid .bpe-field { max-width: none; }
.bpe-addrgrid .bpe-field--full { grid-column: 1 / -1; }
@media (max-width: 600px) { .bpe-addrgrid { grid-template-columns: 1fr; } }

/* ---------- Structured delivery address card ---------- */
.bpe-addrcard { background: #ececec; border-radius: 8px; padding: 26px 28px; margin-top: 12px; }
.bpe-addrcard .bpe-field { margin-bottom: 18px; max-width: 560px; }
.bpe-addrcard .bpe-field:last-child { margin-bottom: 0; }
.bpe-addrcard .bpe-field label { font-size: 13px; font-weight: 700; }
.bpe-addrcard .bpe-field input,
.bpe-addrcard .bpe-field select { width: 100%; max-width: 100%; background: #fff; padding: 11px 12px; border: 1px solid #cfd3db; border-radius: 6px; }
.bpe-addrcard .bpe-field input::placeholder { color: #98a2b3; }
.bpe-reqnote { font-size: 13px; color: #566; margin: 0 0 18px; }
.req { color: #e11d48; font-weight: 700; }
.bpe-optional { color: var(--muted); font-weight: 400; font-size: 12px; }

.bpe-link { color: var(--blue); font-weight: 600; }
.bpe-link:hover { text-decoration: underline; }
.bpe-link--danger { color: #b42318; }
.bpe-help { font-size: 13px; color: var(--muted); margin-top: 22px; text-align: center; }

.bpe-alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 6px; }
.bpe-alert--error { background: #fdecec; color: #b42318; border: 1px solid #f5c6c2; }
.bpe-alert--success { background: #e9f8ef; color: #08663a; border: 1px solid #b7e6c9; }
.bpe-alert--warn { background: #fef6e7; color: #92500a; border: 1px solid #f6dfae; }

/* ---------- Logged-in shell ---------- */
.bpe-shell { display: flex; min-height: 100vh; }
.bpe-side {
	width: 260px; flex-shrink: 0; background: linear-gradient(180deg, var(--navy) 0%, #0f1124 100%);
	color: #cdd7ef; display: flex; flex-direction: column; padding: 26px 18px;
}
.bpe-side__brand { padding: 0 0 22px; text-align: center; }
.bpe-side__logo { display: block; width: auto; max-width: 150px; height: auto; border-radius: 6px; margin: 0 auto; }
.bpe-side__brandtext { display: block; font-weight: 700; font-size: 16px; color: #fff; line-height: 1.2; padding: 0 12px; }
.bpe-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.bpe-nav__item {
	padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: #fff;
	transition: background .15s, color .15s;
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.bpe-nav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.bpe-nav__item.is-active { background: var(--cyan); color: var(--navy); }
.bpe-nav__badge {
	background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
	min-width: 20px; padding: 3px 6px; border-radius: 999px; text-align: center;
}
.bpe-nav__item.is-active .bpe-nav__badge { background: var(--navy); color: #fff; }
.bpe-nav__logout { padding: 11px 14px; font-size: 14px; font-weight: 600; color: #cdd7ef; border-top: 1px solid rgba(255,255,255,.08); margin-top: 12px; }
.bpe-nav__logout:hover { color: #fff; }

.bpe-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bpe-topbar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--line);
}
.bpe-topbar h1 { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.bpe-topbar__user { text-align: right; }
.bpe-topbar__name { display: block; font-weight: 700; font-size: 14px; }
.bpe-topbar__branch { display: block; font-size: 12px; color: var(--muted); }
.bpe-content { padding: 32px; }

.bpe-greeting { font-size: 15px; color: var(--muted); margin: 0 0 22px; }

/* ---------- Dashboard header + orders overview ---------- */
.bpe-dashhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.bpe-dashhead__title { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.bpe-dashhead__sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.bpe-sec { font-size: 18px; font-weight: 800; margin: 0 0 16px; }

.bpe-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.bpe-ov { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.bpe-ov__top { background: linear-gradient(135deg, #2b2e52 0%, #14162c 100%); color: #fff; padding: 26px 26px; min-height: 148px; display: flex; flex-direction: column; justify-content: center; }
.bpe-ov__top--b { background: linear-gradient(135deg, #0e82a8 0%, #0a3f56 100%); }
.bpe-ov__label { font-size: 14px; opacity: .85; }
.bpe-ov__row { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.bpe-ov__num { font-size: 56px; font-weight: 800; line-height: 1; }
.bpe-ov__cap { font-size: 20px; font-weight: 700; line-height: 1.15; }
.bpe-ov__foot { padding: 18px 24px; text-align: center; }
.bpe-ov__foot strong { display: block; color: var(--ink); margin-bottom: 8px; font-size: 15px; }
.bpe-ov__foot a { color: var(--navy); font-weight: 700; font-size: 14px; }
.bpe-ov__foot a:hover { color: var(--blue); }

@media (max-width: 760px) {
	.bpe-overview { grid-template-columns: 1fr; }
	.bpe-dashhead { flex-direction: column; }
}

/* ---------- Dashboard tiles ---------- */
.bpe-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
/* Quick access: stretch tiles to fill the full width so they line up with the
   overview cards above, instead of leaving an empty column on the right. */
.bpe-tiles--quick { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.bpe-tile {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	padding: 24px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
	display: flex; flex-direction: column;
}
.bpe-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(16,32,64,.12); }
.bpe-tile__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: #eef1f7; color: var(--navy); margin-bottom: 16px; }
.bpe-tile__icon svg { width: 24px; height: 24px; }
.bpe-tile:hover .bpe-tile__icon { background: #e3e9f6; color: var(--blue); }
.bpe-tile h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.bpe-tile p { margin: 0 0 16px; color: var(--muted); font-size: 14px; flex: 1; }
.bpe-tile__go { color: var(--blue); font-weight: 700; font-size: 14px; }

.bpe-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.bpe-panel h2 { margin: 0 0 6px; font-size: 20px; }

/* ---------- Order form / catalogue ---------- */
.bpe-order { display: flex; flex-direction: column; gap: 20px; }
.bpe-catsearch { margin: 4px 0 2px; }
.bpe-catsearch input { width: 100%; max-width: 360px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }
.bpe-catsearch input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-catsearch__none { color: var(--muted); font-size: 14px; margin: 10px 2px; }
/* Floating order summary that stays in view while browsing a long catalogue */
.bpe-orderbar { position: sticky; bottom: 14px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--navy); color: #fff; padding: 10px 12px 10px 20px; border-radius: 12px; box-shadow: 0 10px 28px rgba(16,32,64,.28); margin: 6px 0 18px; }
.bpe-orderbar__sum { font-size: 15px; color: #cdd7ef; }
.bpe-orderbar__sum strong { color: #fff; font-size: 17px; }
@media (max-width: 600px) { .bpe-orderbar { bottom: 8px; padding: 10px 12px; gap: 10px; } .bpe-orderbar__sum { font-size: 13px; min-width: 0; } .bpe-orderbar .bpe-btn { padding: 10px 14px; font-size: 14px; white-space: nowrap; flex: 0 0 auto; } }

/* Order status progress tracker */
.bpe-track { display: flex; margin: 18px 0 6px; }
.bpe-track__step { flex: 1; text-align: center; position: relative; padding-top: 32px; }
.bpe-track__step::before, .bpe-track__step::after { content: ""; position: absolute; top: 11px; height: 3px; background: var(--line); }
.bpe-track__step::before { left: 0; right: 50%; }
.bpe-track__step::after { left: 50%; right: 0; }
.bpe-track__step:first-child::before, .bpe-track__step:last-child::after { display: none; }
.bpe-track__dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; z-index: 1; }
.bpe-track__label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.bpe-track__date { display: block; font-size: 11px; color: #98a2b3; margin-top: 2px; }
.bpe-track__step--done .bpe-track__dot { background: var(--green); border-color: var(--green); }
.bpe-track__step--done::before, .bpe-track__step--done::after { background: var(--green); }
.bpe-track__step--done .bpe-track__label { color: var(--ink); }
.bpe-track__step--current .bpe-track__dot { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px rgba(34,198,240,.2); }
.bpe-track__step--current::before { background: var(--green); }
.bpe-track__step--current .bpe-track__label { color: var(--ink); font-weight: 700; }
@media (max-width: 520px) { .bpe-track__label { font-size: 11px; } .bpe-track__date { display: none; } }
.bpe-catalogue { display: flex; flex-direction: column; margin-top: 6px; }
/* Click-to-enlarge product image */
.bpe-prod__img img.bpe-zoom { cursor: zoom-in; transition: transform .12s; }
.bpe-prod__img img.bpe-zoom:hover { transform: scale(1.05); }
.bpe-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(10,15,30,.85); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.bpe-lightbox[hidden] { display: none; }
.bpe-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.bpe-lightbox__close { position: fixed; top: 16px; right: 26px; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; font-weight: 300; }
.bpe-prod {
	display: grid; grid-template-columns: 60px 1fr 110px 96px; align-items: center; gap: 16px;
	padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.bpe-prod:last-child { border-bottom: none; }
.bpe-prod__img img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.bpe-prod__noimg { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: #f0f2f7; border-radius: 8px; font-size: 10px; color: #98a2b3; text-align: center; }
.bpe-prod__info h4 { margin: 0 0 2px; font-size: 15px; }
.bpe-prod__sku { font-size: 12px; color: var(--muted); }
.bpe-prod__desc { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.bpe-prod__price { font-weight: 700; text-align: right; }
.bpe-prod__qty input { width: 84px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; text-align: center; }
.bpe-prod__qty input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }

/* Sized product: collapsible header (image + info) then a size matrix */
.bpe-prod--sized { display: block; }
.bpe-prod__head { display: flex; gap: 16px; align-items: center; position: relative; cursor: pointer; padding-right: 120px; user-select: none; border-radius: 10px; }
.bpe-prod__head:hover { background: #fafbfe; }
.bpe-prod__head:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.bpe-prod__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.bpe-prod__count { font-weight: 600; }
.bpe-prod__chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s; margin-bottom: 3px; }
.bpe-prod--sized.is-open .bpe-prod__chev { transform: rotate(-135deg); margin-bottom: -3px; }
.bpe-prod__matrix { margin-top: 14px; overflow-x: auto; display: none; }
.bpe-prod--sized.is-open .bpe-prod__matrix { display: block; }
.bpe-guide-link { display: inline-block; margin-top: 6px; color: var(--blue); font-weight: 600; font-size: 13px; }
.bpe-guide-link:hover { text-decoration: underline; }
.bpe-prod__guide { margin: 14px 0 0; }
.bpe-prod__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

.bpe-sizes { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; table-layout: fixed; }
.bpe-sizes th:nth-child(1), .bpe-sizes td:nth-child(1) { width: 18%; }
.bpe-sizes th:nth-child(2), .bpe-sizes td:nth-child(2) { width: 22%; }
.bpe-sizes th:nth-child(3), .bpe-sizes td:nth-child(3) { width: 22%; }
.bpe-sizes th:nth-child(4), .bpe-sizes td:nth-child(4) { width: 38%; }
.bpe-sizes th { text-align: left; padding: 8px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--line); }
.bpe-sizes td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.bpe-sizes tr:last-child td { border-bottom: none; }
.bpe-sizes__lbl { font-weight: 700; }
.bpe-sizes input[type=number] { width: 84px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; text-align: center; }
.bpe-sizes input[type=number]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; font-size: 11px; color: var(--muted); cursor: help; }

.bpe-size-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef1f7; color: var(--navy); font-size: 12px; font-weight: 700; margin-left: 4px; }
.bpe-colour-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e7f0fb; color: var(--blue-dark); font-size: 12px; font-weight: 700; margin-left: 4px; }

.bpe-order__total { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line); font-size: 16px; }
.bpe-order__total strong { font-size: 22px; color: var(--navy); }

.bpe-field { margin-bottom: 16px; }
.bpe-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bpe-field input, .bpe-field textarea { width: 100%; max-width: 520px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; }
.bpe-field input:focus, .bpe-field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
/* Consistent select styling anywhere in the portal content area. */
.bpe-content select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); max-width: 100%; }
.bpe-content select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-address-box { max-width: 520px; padding: 14px 16px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; line-height: 1.5; color: var(--ink); }
/* One-off "deliver to a different address" */
.bpe-newaddr { margin-top: 12px; }
.bpe-newaddr__toggle { padding: 8px 14px; font-size: 13px; }
.bpe-newaddr__panel { margin-top: 12px; max-width: 520px; }
.bpe-newaddr__panel label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bpe-newaddr__panel textarea, .bpe-newaddr__panel input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; box-sizing: border-box; }
.bpe-newaddr__panel textarea:focus, .bpe-newaddr__panel input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }

/* ---------- Generic data table ---------- */
.bpe-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bpe-table th, .bpe-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.bpe-table thead th { background: #f7f9fc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.bpe-table tfoot td { border-bottom: none; }
.bpe-table .ta-r, .bpe-table th.ta-r { text-align: right; }

/* ---------- Badges / timeline / order detail ---------- */
.bpe-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.bpe-orderhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bpe-orderhead__status { text-align: right; }
.bpe-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bpe-grid2 .bpe-panel h3 { font-size: 15px; margin: 18px 0 6px; }
.bpe-grid2 .bpe-panel h3:first-child { margin-top: 0; }
.bpe-timeline { list-style: none; margin: 0; padding: 0; }
.bpe-timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); }
.bpe-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.bpe-timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); }
.bpe-timeline__date { display: block; font-size: 12px; color: var(--muted); }

@media (max-width: 700px) { .bpe-grid2 { grid-template-columns: 1fr; } }
.bpe-approve { background: #f7f9fc; border: 1px solid #e5e8ef; border-radius: 10px; padding: 16px; }

/* ---------- Contact supplier ---------- */
.bpe-contact { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bpe-contact__form { margin-bottom: 0; }
.bpe-contact__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.bpe-contact__icon {
	flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(34, 198, 240, .14); color: var(--blue);
}
.bpe-contact__icon svg { width: 22px; height: 22px; }
.bpe-formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.bpe-formrow .bpe-field input, .bpe-formrow .bpe-field select { max-width: none; }
.bpe-contact .bpe-field select {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
	font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.bpe-contact .bpe-field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-contact .bpe-field textarea { max-width: none; }
.bpe-contact .bpe-field input[disabled] { max-width: none; background: var(--bg); color: var(--muted); }

.bpe-contact__aside { margin-bottom: 0; background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); }
.bpe-contact__aside h3 { margin: 0 0 4px; font-size: 15px; }
.bpe-contact__brand { margin: 0 0 18px; font-weight: 700; color: var(--navy); }
.bpe-contact__row, .bpe-contact__note { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bpe-contact__row:first-of-type { border-top: none; }
.bpe-contact__ricon {
	flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(34, 198, 240, .14); color: var(--blue);
}
.bpe-contact__ricon svg { width: 17px; height: 17px; }
.bpe-contact__ricon--wa { background: rgba(37, 211, 102, .14); color: #1faa52; }
.bpe-contact__ricon--wa svg { width: 19px; height: 19px; }
.bpe-contact__rlabel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.bpe-contact__note { color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
	.bpe-contact { grid-template-columns: 1fr; }
	.bpe-formrow { grid-template-columns: 1fr; }
}

/* ---------- Filter row ---------- */
.bpe-filter { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.bpe-filter .bpe-field input { width: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.bpe-split { flex-direction: column; }
	.bpe-split__brand { padding: 32px; }
	.bpe-hero { font-size: 34px; }
	.bpe-shell { flex-direction: column; }
	.bpe-side { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
	.bpe-side__brand { padding: 0 16px 0 4px; white-space: nowrap; }
	.bpe-nav { flex-direction: row; }
	.bpe-nav__logout { border-top: none; margin: 0; }
	.bpe-content { padding: 20px; }
}

/* Ordering screen — stack simple product rows so the name isn't crushed on phones */
@media (max-width: 600px) {
	.bpe-prod:not(.bpe-prod--sized) {
		grid-template-columns: 56px 1fr auto;
		grid-template-areas: "img info info" "img price qty";
		row-gap: 10px; column-gap: 12px;
	}
	.bpe-prod:not(.bpe-prod--sized) .bpe-prod__img { grid-area: img; align-self: start; }
	.bpe-prod:not(.bpe-prod--sized) .bpe-prod__info { grid-area: info; }
	.bpe-prod:not(.bpe-prod--sized) .bpe-prod__price { grid-area: price; text-align: left; align-self: center; }
	.bpe-prod:not(.bpe-prod--sized) .bpe-prod__qty { grid-area: qty; }
	.bpe-prod__head { padding-right: 92px; }
	/* Simple size matrix (Size/Stock/Price/Qty): fits the phone width, no horizontal
	   scroll, so the +/- buttons stay reachable; the stepper compacts. */
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes { min-width: 0; font-size: 13px; }
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes th, .bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes td { padding: 8px 6px; }
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes th:nth-child(1), .bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes td:nth-child(1) { width: 14%; }
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes th:nth-child(2), .bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes td:nth-child(2) { width: 20%; }
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes th:nth-child(3), .bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes td:nth-child(3) { width: 20%; }
	.bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes th:nth-child(4), .bpe-prod--sized:not(.bpe-prod--pers) .bpe-sizes td:nth-child(4) { width: 46%; }
	.bpe-qtycell { gap: 8px; }
	.bpe-step__btn { width: 30px; font-size: 17px; }
	.bpe-step .bpe-qty { width: 38px; }
	/* Personalisation/colour repeater: stack each line into a card so colour, size,
	   qty, name and remove are all reachable without side-scrolling. */
	.bpe-prod--pers .bpe-sizes, .bpe-prod--pers .bpe-sizes tbody { display: block; width: 100%; min-width: 0; }
	.bpe-prod--pers .bpe-sizes thead { display: none; }
	.bpe-prod--pers .bpe-pers__row { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin-bottom: 10px; }
	.bpe-prod--pers .bpe-pers__row td { display: block; width: auto; padding: 6px 0; border: none; }
	.bpe-prod--pers .bpe-pers__row td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-bottom: 4px; }
	.bpe-prod--pers .bpe-pers__row td:last-child { text-align: right; padding: 0; }
	.bpe-prod--pers .bpe-pers-colour, .bpe-prod--pers .bpe-pers-size, .bpe-prod--pers .bpe-pers-name, .bpe-prod--pers .bpe-pers-qty { width: 100%; max-width: none; box-sizing: border-box; }
	.bpe-prod--pers .bpe-pers-price { font-weight: 700; }
	.bpe-prod--pers .bpe-pers-del { font-size: 22px; padding: 2px 10px; }
}

/* ---------- Mobile hardening (applies to every page) ---------- */
@media (max-width: 760px) {
	.bpe-topbar { padding: 14px 18px; }
	.bpe-topbar h1 { font-size: 18px; }
	.bpe-dashhead__title { font-size: 22px; }
}
@media (max-width: 700px) {
	/* Wide tables (order history, spend, admin lists, order summary, invoice/statement)
	   scroll horizontally inside their own card instead of widening the whole page. */
	.bpe-table, .inv-lines { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
	.bpe-content { padding: 16px; }
	.bpe-panel { padding: 18px 16px; }
	.bpe-filter { gap: 12px; }
	.bpe-filter .bpe-field, .bpe-filter .bpe-field input, .bpe-filter .bpe-field select { width: 100%; max-width: none; }
}
@media (max-width: 600px) {
	.bpe-dashhead { flex-direction: column; align-items: flex-start; gap: 8px; }
	/* Login / hero + join page fit small screens */
	.bpe-split__brand { padding: 28px 22px; }
	.bpe-split__form { padding: 24px 16px; }
	.bpe-card { padding: 28px 22px; }
	.bpe-card h2 { font-size: 22px; }
	.bpe-hero { font-size: 32px; }
	.bpe-hero__sub { font-size: 15px; }
}

/* ---------- Personalisation (named garments) ---------- */
.bpe-pers-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: rgba(180,83,9,.12); color: #b45309; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.bpe-pers__rows:empty::after { content: "No lines added yet — click “Add a line” to start."; display: block; color: #98a2b3; font-size: 13px; padding: 10px 2px; }
/* Name field matches the size <select> and other portal form controls. */
.bpe-pers-name { width: 100%; max-width: 320px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }
.bpe-pers-name::placeholder { color: #98a2b3; }
.bpe-pers-name:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-pers-qty { width: 72px; box-sizing: border-box; padding: 10px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; text-align: center; background: #fff; color: var(--ink); }
.bpe-pers-qty:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,198,240,.25); }
.bpe-pers-colour { min-width: 130px; }
.bpe-colour-tag { display: inline-block; font-size: 12px; font-weight: 600; background: rgba(34,198,240,.12); color: #0e7490; padding: 1px 8px; border-radius: 6px; margin-left: 4px; }
.bpe-pers-del { background: none; border: none; color: #b91c1c; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 6px; }
.bpe-pers-del:hover { background: rgba(185,28,28,.1); }
.bpe-pers-add { margin-top: 10px; }
.bpe-name-tag { color: #b45309; font-weight: 600; }
.inv-name { color: #b45309; font-weight: 600; }

/* ---------- Branding preview (logos on a product) ---------- */
.bpe-branding { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.bpe-branding__label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bpe-branding__item { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12px; font-weight: 600; color: var(--ink); }
.bpe-branding__item img { height: 24px; width: 24px; object-fit: contain; border-radius: 50%; background: #16233f; padding: 2px; }

.bpe-track-info { background: #eef6ff; border: 1px solid #cfe4fb; border-radius: 9px; padding: 10px 14px; font-size: 14px; margin: 12px 0 0; }

/* Starter packs */
.bpe-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.bpe-pack { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; background: #fff; }
.bpe-pack__body { flex: 1; }
.bpe-pack h4 { margin: 0 0 4px; font-size: 15px; }
.bpe-pack__desc { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.bpe-pack__items { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.bpe-pack__items li { padding: 8px 0; border-bottom: 1px solid #f0f2f7; display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; }
.bpe-pack__items li:last-child { border-bottom: none; padding-bottom: 0; }
.bpe-pack__qty { flex: 0 0 auto; min-width: 26px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: #eef1f7; color: var(--navy); font-weight: 700; font-size: 12px; }
.bpe-pack__name { flex: 1 1 auto; min-width: 0; color: var(--ink); line-height: 1.3; }
.bpe-pack__size { flex: 0 0 auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; }
.bpe-pack__size:hover { border-color: var(--blue); }
.bpe-pack__size:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,169,224,.15); }
.bpe-pack__namefield { display: block; margin-top: 12px; font-size: 12px; }
.bpe-pack__namefield > span { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink); }
.bpe-pack__namefield input { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.bpe-pack__namefield input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,169,224,.15); }
.bpe-pack__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.bpe-pack__price { font-weight: 700; font-size: 16px; }

/* Spend "over time" bar chart */
.bpe-bars { display: flex; align-items: flex-end; gap: 12px; padding: 10px 4px 0; overflow-x: auto; min-height: 190px; }
.bpe-bar { flex: 1; min-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; }
.bpe-bar__val { font-size: 11px; font-weight: 700; color: var(--ink); margin-bottom: 4px; white-space: nowrap; }
.bpe-bar__fill { width: 70%; max-width: 46px; background: linear-gradient(180deg, var(--cyan) 0%, var(--blue) 100%); border-radius: 6px 6px 0 0; }
.bpe-bar__lbl { font-size: 11px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* Repeat-order reminder box */
.bpe-repeat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 12px 0 0; font-size: 14px; }
.bpe-repeat__form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bpe-repeat__form label { display: flex; align-items: center; gap: 8px; }
