/* Voyage Travel World — sales-agent payment links ([voyage_sales_links]).
   Scoped to .voy-sales so it works on any page template. */

.voy-sales {
	--voy-ink: #1f2430;
	--voy-muted: #5d6475;
	--voy-line: #d9dce3;
	--voy-accent: #0b5cad;
	--voy-danger: #b32d2e;
	max-width: 640px;
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--voy-ink);
	box-sizing: border-box;
}

.voy-sales *,
.voy-sales *::before,
.voy-sales *::after {
	box-sizing: inherit;
}

.voy-sales-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin-bottom: 1rem;
}

.voy-sales-head h2 {
	margin: 0;
	font-size: 1.5rem;
}

.voy-sales-badge {
	background: #f59e0b;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
}

.voy-sales-location {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.6rem;
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
	background: #0f2a44;
	color: #fff;
	border-radius: 12px;
}

.voy-sales-location-label {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.75;
}

.voy-sales-location-code {
	font-size: 1.5rem;
	letter-spacing: 0.04em;
}

.voy-sales-location-name {
	font-size: 1.1rem;
}

.voy-sales-card {
	background: #fff;
	border: 1px solid var(--voy-line);
	border-radius: 12px;
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}

.voy-sales-card h3 {
	margin: 0 0 1rem;
	font-size: 1.15rem;
}

.voy-sales fieldset {
	border: 0;
	margin: 0 0 1.25rem;
	padding: 0;
	min-width: 0;
}

.voy-sales legend {
	font-weight: 700;
	margin-bottom: 0.5rem;
	padding: 0;
}

.voy-sales label {
	display: block;
	font-size: 0.875rem;
	color: var(--voy-muted);
	margin: 0.5rem 0 0.25rem;
}

.voy-sales small {
	font-weight: 400;
	color: var(--voy-muted);
}

.voy-sales input[type="text"],
.voy-sales input[type="email"],
.voy-sales input[type="number"],
.voy-sales select,
.voy-sales textarea {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--voy-ink);
	background: #fff;
	border: 1px solid var(--voy-line);
	border-radius: 8px;
	padding: 0.6rem 0.7rem;
	margin: 0;
}

.voy-sales textarea {
	resize: vertical;
	line-height: 1.45;
}

.voy-sales input[hidden] {
	display: none;
}

.voy-sales-row {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 0 0.75rem;
}

.voy-sales-row-3 {
	grid-template-columns: repeat(3, 1fr);
}

.voy-cert {
	display: grid;
	grid-template-columns: 4.5rem auto 1fr 2.5rem;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.voy-cert-times {
	color: var(--voy-muted);
}

/* Multi-year membership: "Once" / "Every year" next to each certificate. */
.voy-certs-multi-year .voy-cert {
	grid-template-columns: 4.5rem auto 1fr auto 2.5rem;
}

.voy-sales-term {
	grid-template-columns: 1fr 2fr;
}

.voy-cert-remove {
	height: 2.5rem;
	border: 1px solid var(--voy-line);
	border-radius: 8px;
	background: #fff;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	color: var(--voy-muted);
}

/* Generated from the certificates, read-only. */
.voy-sales-includes {
	white-space: pre-line;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--voy-line);
	border-radius: 8px;
	background: #f6f7f9;
	font-size: 0.95rem;
	line-height: 1.5;
}

.voy-sales-includes.is-over {
	border-color: var(--voy-danger);
}

.voy-sales-settlement {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.voy-sales-settlement th,
.voy-sales-settlement td {
	padding: 0.3rem 0;
	border: 0;
	background: none;
	text-align: left;
	font-weight: 400;
	vertical-align: top;
}

.voy-sales-settlement td {
	text-align: right;
	white-space: nowrap;
	padding-left: 1rem;
	font-variant-numeric: tabular-nums;
}

.voy-sales-settlement .is-closing th,
.voy-sales-settlement .is-closing td {
	color: var(--voy-muted);
	font-size: 0.85rem;
	padding-left: 0.75rem;
}

.voy-sales-settlement .is-closing td {
	padding-left: 1rem;
}

.voy-sales-settlement .is-subtotal th,
.voy-sales-settlement .is-subtotal td {
	border-top: 1px solid var(--voy-line);
}

.voy-sales-settlement .is-total th,
.voy-sales-settlement .is-total td {
	border-top: 2px solid var(--voy-ink);
	font-weight: 600;
}

.voy-sales-settlement .is-error th,
.voy-sales-settlement .is-error td {
	color: var(--voy-danger);
}

.voy-sales-primary,
.voy-sales-secondary {
	display: inline-block;
	font: inherit;
	font-weight: 600;
	border-radius: 8px;
	padding: 0.65rem 1rem;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}

.voy-sales-primary {
	background: var(--voy-accent);
	border: 1px solid var(--voy-accent);
	color: #fff;
}

.voy-sales-primary:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.voy-sales form > .voy-sales-primary {
	width: 100%;
	font-size: 1.05rem;
	padding: 0.85rem 1rem;
}

.voy-sales-secondary {
	background: #fff;
	border: 1px solid var(--voy-line);
	color: var(--voy-ink);
}

.voy-sales-link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 0.875rem;
	color: var(--voy-accent);
	cursor: pointer;
	text-decoration: underline;
}

.voy-sales-link.is-danger {
	color: var(--voy-danger);
}

.voy-sales-hint {
	font-size: 0.85rem;
	color: var(--voy-muted);
	margin: 0.4rem 0 0;
}

.voy-sales-hint.is-error,
.voy-sales-hint .is-over {
	color: var(--voy-danger);
}

.voy-sales-split {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.voy-sales-check {
	display: flex !important;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem !important;
	color: var(--voy-ink) !important;
	font-size: 0.95rem !important;
}

/* Buttons and rows set their own display; hidden must still win. */
.voy-sales [hidden],
.voy-sales-check[hidden] {
	display: none !important;
}

.voy-sales input.is-locked {
	background: #e9ecef;
	color: #6b7280;
	cursor: not-allowed;
}

.voy-sales-no-renewal {
	margin: 0.75rem 0 0 !important;
}

/* Remove the Membership (certificates only), where the location allows it. */
.voy-sales fieldset > .voy-sales-check {
	margin-bottom: 0.5rem !important;
}

/* Workflow badge on a previous link (in review / cleared). */
.voy-sales-workflow {
	display: inline-block;
	padding: 0 0.5rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.voy-sales-workflow.is-review {
	color: #8a5a00;
}

.voy-sales-workflow.is-cleared {
	color: #1a7f37;
}

.voy-sales-cards-toggle {
	margin: 0.75rem 0 0 !important;
}

.voy-sales-cards {
	margin-top: 0.75rem;
	padding: 0.75rem;
	border: 1px solid var(--voy-line);
	border-radius: 8px;
}

.voy-sales-cards select {
	max-width: 6rem;
}

.voy-sales-cards-list {
	margin-top: 0.5rem;
}

/* Every Installment's date and amount, under the select. */
.voy-installments-plan p {
	margin: 0;
}

.voy-installments-plan ol {
	margin: 0.25rem 0;
	padding-left: 1.25rem;
}

/* Installments under "Partial payments / cash" (1 payment only). */
.voy-sales-cards #voy-installments-wrap {
	grid-template-columns: minmax(0, 20rem);
	margin-top: 0.5rem;
}

.voy-sales-cards #voy-installments-wrap select {
	max-width: none;
}

/* Payment n: amount, card / cash, who received the cash. */
.voy-sales-payment {
	display: grid;
	grid-template-columns: 7rem 6rem 1fr;
	gap: 0 0.5rem;
	align-items: end;
	margin-bottom: 0.5rem;
}

.voy-sales-payment label {
	grid-column: 1 / -1;
}

.voy-sales-cards .voy-sales-payment select {
	max-width: none;
}

.voy-sales-hint.is-warning {
	color: #92400e;
	background: #fff8e5;
	border-radius: 8px;
	padding: 0.5rem 0.7rem;
}

.voy-sales-error {
	color: var(--voy-danger);
	background: #fdecec;
	border-radius: 8px;
	padding: 0.6rem 0.8rem;
}

.voy-sales-notice {
	max-width: 640px;
	margin: 2rem auto;
	padding: 1rem;
	border: 1px solid #f0c36d;
	background: #fff8e5;
	border-radius: 8px;
}

.voy-sales-qr {
	text-align: center;
	margin-bottom: 1rem;
}

.voy-sales-qr canvas {
	width: 264px;
	max-width: 100%;
	height: auto;
	image-rendering: pixelated;
	border: 1px solid var(--voy-line);
	border-radius: 8px;
}

.voy-sales-url {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.voy-sales-url input {
	flex: 1;
	min-width: 0;
	font-size: 0.875rem !important;
}

.voy-sales-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.voy-sales-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.voy-sales-item {
	border-top: 1px solid var(--voy-line);
	padding: 0.75rem 0;
}

.voy-sales-item.is-inactive .voy-sales-item-title {
	color: var(--voy-muted);
	text-decoration: line-through;
}

.voy-sales-item-title {
	font-weight: 600;
}

.voy-sales-item-actions {
	display: flex;
	gap: 1rem;
	margin-top: 0.35rem;
}

@media (max-width: 520px) {
	.voy-sales-row,
	.voy-sales-row-3 {
		grid-template-columns: 1fr;
	}

	.voy-sales-payment {
		grid-template-columns: 1fr 6rem;
	}

	.voy-sales-payment input[name="split_cash_by[]"] {
		grid-column: 1 / -1;
	}

	/* Certificate name on its own line, quantity and remove below it. */
	.voy-cert {
		grid-template-columns: 4.5rem 1fr 2.5rem;
		padding-bottom: 0.5rem;
		border-bottom: 1px solid var(--voy-line);
	}

	.voy-cert select {
		grid-column: 1 / -1;
		order: -1;
	}

	.voy-cert-times {
		display: none;
	}

	.voy-cert-remove {
		grid-column: 3;
	}

	.voy-certs-multi-year .voy-cert {
		grid-template-columns: 4.5rem 1fr 2.5rem;
	}

	.voy-cert select.voy-cert-per-year {
		grid-column: 2;
		order: 0;
	}
}

.voy-sales-footer {
	text-align: center;
	margin: 0.5rem 0 0;
}

/* Supervisor override: a quiet link in the footer opens the code box */
.voy-sales-footer-sep {
	color: #9ca3af;
	margin: 0 0.4rem;
}

.voy-sales-override {
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--voy-line);
	border-radius: 12px;
}

.voy-sales-override label {
	display: block;
	font-size: 0.85rem;
	margin-bottom: 0.35rem;
}

.voy-sales-override-row {
	display: flex;
	gap: 0.5rem;
}

.voy-sales-override-row input {
	flex: 1;
	min-width: 0;
	text-transform: uppercase;
}

.voy-sales-override .voy-sales-hint {
	margin: 0.5rem 0 0;
}

.voy-sales-override .is-ok {
	color: #8a5a00;
	font-weight: 600;
}

.voy-sales-settlement tr.is-override th,
.voy-sales-settlement tr.is-override td {
	color: #8a5a00;
	font-style: italic;
}
