/* ═══════════════════════════════════════════════════════════════
   Module: Quotes  (quotes list · view-quote)
   ═══════════════════════════════════════════════════════════════ */

/* Empty state */
.quotes-empty {
	padding: 56px 32px;
	text-align: center;
	color: var(--text-muted);
	font-size: var(--text-base);
}
.quotes-empty p { margin-bottom: var(--sp-5); }

/* Quote name inside table */
.quote-name-cell {
	display: block;
	font-size: var(--text-sm);
	color: var(--text-secondary);
	margin-top: 2px;
}

/* ── Status badges ────────────────────────────────────────────────
   Used on both Quote list and single Quote view pages.
   Must stay in sync with the color map in quotes.php column renderer.
   ────────────────────────────────────────────────────────────────── */

/* Quote type badges */
.quote-type-badge    { font-size: var(--text-2xs); padding: 2px var(--sp-2); }
.quote-type-restock  { background: rgba(14,165,233,.12);  color: var(--color-blue-dark); }
.quote-type-quote    { background: rgba(156,163,175,.14); color: var(--text-muted); }

/* Quote-specific */
.status-in-review    { background: rgba(14,165,233,.12);  color: var(--color-blue-dark); }
.status-draft        { background: rgba(156,163,175,.14); color: var(--text-muted); }
.status-pending      { background: rgba(245,158,11,.14);  color: var(--color-orange-dark); }
.status-approved     { background: rgba(34,197,94,.12);   color: var(--color-green-dark); }
.status-rejected     { background: rgba(239,68,68,.12);   color: var(--color-red-dark); }
.status-converted    { background: rgba(139,92,246,.12);  color: var(--color-purple-dark); }
.status-completed    { background: rgba(22,163,74,.12);   color: var(--color-green-dark); }

/* Production stages — shared with WC Order status badges */
.status-sampling     { background: rgba(168,85,247,.12);  color: var(--color-purple-dark); }
.status-in-design    { background: rgba(59,130,246,.12);  color: var(--color-blue-dark); }
.status-in-transport { background: rgba(99,102,241,.12);  color: var(--color-indigo); }
.status-preparing    { background: rgba(249,115,22,.12);  color: var(--color-orange-dark); }
.status-dispatched   { background: rgba(20,184,166,.12);  color: #0f766e; }
.status-received     { background: rgba(6,182,212,.12);   color: var(--color-cyan); }

/* View-quote: header actions */
.app-view-quote-page .app-page__header .app-page__actions {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
}

/* Notes card */
.quote-notes-card {
	padding: var(--sp-4) 22px;
}
.quote-notes-label {
	font-size: var(--text-2xs);
	font-weight: var(--weight-bold);
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 6px;
}
.quote-notes-text {
	font-size: var(--text-base);
	color: var(--text-secondary);
	line-height: 1.65;
}

/* Items table */
.quote-items-table {}
.quote-item-product {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
}
.quote-item-product img {
	width: 46px;
	height: 46px;
	border-radius: var(--radius-sm);
	object-fit: cover;
	border: 1px solid var(--border-color);
	flex-shrink: 0;
}
.quote-item-note {
	font-size: var(--text-xs);
	color: var(--text-muted);
	font-style: italic;
	margin-top: 3px;
}

.quote-total-row td {
	border-top: 2px solid var(--border-color);
	padding-top: 14px;
	font-size: 15px;
}

/* ════════════════════════════════════════════════════════════════
   VIEW-QUOTE: product cards + size splitter
   Shares .vo-* classes with orders.css (both are loaded on app pages).
   Quote-specific additions only below.
   ════════════════════════════════════════════════════════════════ */

/* Stepper (interactive, used in quotes but not orders) — warehouse popup style */
.vo-splitter-stepper {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var(--border-color);
	border-radius: 5px;
	overflow: hidden;
	height: 30px;
	flex-shrink: 0;
}
.vo-splitter-stepper__btn {
	width: 30px;
	height: 100%;
	background: var(--color-primary);
	color: var(--text-inverted);
	border: none;
	font-size: var(--text-base);
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0 !important;
	transition: background var(--transition-fast);
}
.vo-splitter-stepper__btn:hover:not(:disabled) { background: var(--color-primary-hover); }
.vo-splitter-stepper__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}
.vo-splitter-stepper__input {
	width: 56px !important;
	height: 100%;
	margin: 0 !important;
	padding: 0 var(--sp-1) !important;
	border: none;
	border-left: 1px solid var(--border-color);
	border-right: 1px solid var(--border-color);
	text-align: center;
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	color: var(--text-primary);
	background: var(--bg-input);
	-moz-appearance: textfield;
}
.vo-splitter-stepper__input::-webkit-outer-spin-button,
.vo-splitter-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Allocation progress bar */
.vq-alloc-bar {
	margin-bottom: var(--sp-4);
	padding: var(--sp-3) var(--sp-4);
	background: var(--bg-subtle);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
}
.vq-alloc-bar__header {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: var(--sp-2);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	color: var(--text-secondary);
}
.vq-alloc-bar__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: var(--radius-full);
	background: var(--border-color);
	color: var(--text-muted);
	flex-shrink: 0;
	transition: background var(--transition-base), color var(--transition-base);
}
.vq-alloc-bar__icon.is-done {
	background: var(--color-green-dark);
	color: var(--text-inverted);
}
.vq-alloc-bar__track {
	height: 7px;
	background: var(--border-color);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 6px;
}
.vq-alloc-bar__fill {
	height: 100%;
	background: var(--color-green-dark);
	border-radius: 4px;
	transition: width var(--transition-base);
}
.vq-alloc-bar__meta {
	display: flex;
	justify-content: space-between;
	font-size: var(--text-2xs);
	color: var(--text-muted);
}
.vq-alloc-bar__left {
	color: var(--text-muted);
}
.vq-prefill-row {
	margin-top: 6px;
	text-align: right;
}
.vq-prefill-sizes-btn {
	background: none;
	border: none;
	padding: 0;
	font-size: var(--text-2xs);
	color: var(--text-muted);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-style: dashed;
	text-underline-offset: 2px;
	opacity: 0.8;
	transition: opacity var(--transition-fast), color var(--transition-fast);
}
.vq-prefill-sizes-btn:hover {
	color: var(--color-primary);
	opacity: 1;
}
.vq-prefill-sizes-btn:disabled {
	opacity: 0.45;
	cursor: default;
}

/* Cell with qty highlighted */
.vq-splitter-cell.has-qty {
	border-color: var(--color-primary);
	background: rgba(28,29,37,.04);
}
.vq-splitter-cell.has-qty .vo-splitter-cell__label {
	color: var(--text-primary);
	font-weight: var(--weight-semibold);
}

/* Footer row: total + save button */
.vq-splitter-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--sp-3);
	padding-top: var(--sp-3);
	border-top: 1px solid var(--border-color);
	margin-top: var(--sp-2);
}

.vq-save-row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.vq-save-msg {
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
}

/* ── Gender sections inside size splitter ───────────────────────────────── */
.vq-gender-section {
	grid-column: 1 / -1; /* full width inside the grid */
	display: contents;   /* sections don't break the CSS grid flow by default */
}

/* Each section becomes a real block: header + cell row */
.vq-gender-section {
	display: block;
	width: 100%;
	min-width: 0;
}

.vq-gender-header {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	padding: var(--sp-2) 0 6px;
	border-bottom: 1px solid var(--border-color);
	margin-bottom: var(--sp-2);
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--text-secondary);
}
.vq-gender-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	color: var(--text-muted);
}
.vq-gender-label { flex: 1; }
.vq-gender-total {
	font-size: var(--text-sm);
	font-weight: var(--weight-bold);
	color: var(--text-primary);
	background: var(--bg-hover);
	border-radius: var(--radius-pill);
	padding: 1px 10px;
}

/* ── Color sections inside size splitter ──────────────────────────────────── */
.vq-color-header {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	padding: 6px 0 5px;
	border-bottom: 1px solid var(--border-color);
	margin-bottom: var(--sp-2);
	margin-top: var(--sp-1);
	font-size: var(--text-2xs);
	font-weight: var(--weight-semibold);
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--text-secondary);
}
.vq-color-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	color: var(--text-muted);
}
.vq-color-label { flex: 1; }
.vq-color-total {
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	color: var(--text-primary);
	background: var(--bg-hover);
	border-radius: var(--radius-pill);
	padding: 1px 10px;
}

/* Wrap cells inside each gender section into a grid row — warehouse popup style.
   auto-fit lets a lone cell stretch to fill the row instead of being stuck at 1/4
   width; the max(25%, 120px) min-track caps the layout at 4 cols on wide popups
   and downshifts to 3/2/1 cols as the container narrows so the 116px stepper
   never overflows its cell. */
.vq-gender-cells {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(max(25%, 120px), 1fr));
	gap: var(--sp-3);
	margin-bottom: var(--sp-3);
}
/* Cells inside gender sections */
.vq-gender-cells .vo-splitter-cell {
	flex: 0 0 auto;
	min-width: 0;
}

/* ── Quote Options (Packing · Warehousing · Shipping) ───────────── */
.quote-options-section {
	display: flex;
	flex-direction: column;
	gap: var(--sp-3);
	margin-top: var(--sp-2);
}
.quote-options-title {
	font-size: var(--text-2xs);
	font-weight: var(--weight-bold);
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--text-muted);
	padding: 0 2px;
}
.qo-question {
	padding: 18px 22px;
}
.qo-question__label {
	font-size: 15px;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
}
.qo-question__label strong {
	font-weight: var(--weight-bold);
}
.qo-question__label span:not(.qo-saved-tag) {
	font-weight: var(--weight-normal);
	color: var(--text-secondary);
}
.qo-saved-tag {
	font-size: var(--text-2xs);
	font-weight: var(--weight-semibold);
	color: var(--color-green-dark);
	margin-left: 6px;
	opacity: 0;
	transition: opacity var(--transition-base);
}
.qo-saved-tag.is-visible { opacity: 1; }

.qo-btn-group {
	display: flex;
	gap: var(--sp-2);
	margin-top: var(--sp-3);
	flex-wrap: wrap;
}
.qo-btn {
	flex: 1;
	min-width: 110px;
	padding: 11px var(--sp-4);
	border-radius: var(--radius-md);
	border: 1.5px solid var(--border-color);
	background: var(--bg-card);
	color: var(--text-primary);
	font-size: var(--text-base);
	font-weight: var(--weight-medium);
	cursor: pointer;
	transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
	text-align: center;
	line-height: 1.4;
}
.qo-btn:hover:not(:disabled):not(.is-active) {
	border-color: var(--color-primary);
}
.qo-btn.is-active {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: var(--text-inverted);
}
.qo-btn.qo-btn--later.is-active {
	background: transparent;
	border-color: var(--border-color);
	color: var(--text-muted);
}
.qo-btn:disabled {
	cursor: default;
	pointer-events: none;
}
