/*
 * Orders list table and order screen (wp-admin).
 *
 * Scoped to the order columns and the order meta box so nothing here can reach
 * another list table. The colours are defined locally rather than pulled from
 * the front-end design tokens: wp-admin never loads that stylesheet, and these
 * shades are tuned against the admin's own grey rather than the site palette.
 */

.franchesco-order-status {
	--franchesco-status-bg: #f0f0f1;
	--franchesco-status-fg: #50575e;
	--franchesco-status-border: #c3c4c7;

	display: inline-block;
	max-width: 100%;
	padding: 3px 10px;
	border: 1px solid var(--franchesco-status-border);
	border-radius: 12px;
	background: var(--franchesco-status-bg);
	color: var(--franchesco-status-fg);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: middle;
}

/* New: waiting to be dealt with — the colour the admin already uses for "info". */
.franchesco-order-status--blue {
	--franchesco-status-bg: #e5f0fa;
	--franchesco-status-fg: #0a4b78;
	--franchesco-status-border: #a7c8e6;
}

/* Paid: money in. */
.franchesco-order-status--green {
	--franchesco-status-bg: #e3f2e4;
	--franchesco-status-fg: #135e26;
	--franchesco-status-border: #a6d3ab;
}

/* Ready for pick-up: needs someone at the counter. */
.franchesco-order-status--amber {
	--franchesco-status-bg: #fcf3d8;
	--franchesco-status-fg: #7a5600;
	--franchesco-status-border: #e5c65a;
}

/* Picked up: done, and deliberately the quietest of the four. */
.franchesco-order-status--grey {
	--franchesco-status-bg: #f0f0f1;
	--franchesco-status-fg: #50575e;
	--franchesco-status-border: #c3c4c7;
}

/*
 * Colour is never the only carrier of meaning — the label inside the badge
 * always spells the status out — but in forced-colours mode the fills are
 * dropped entirely, so restore a visible outline.
 */
@media (forced-colors: active) {
	.franchesco-order-status {
		border-color: CanvasText;
		color: CanvasText;
	}
}

/*
 * The per-row status control: dropdown + Update button, under the badge.
 *
 * The matching <form> elements live in the admin footer (a form cannot be
 * nested inside the list table's own form), so they must never take up space.
 */
.franchesco-order-status-form {
	display: none;
}

.franchesco-order-status-control {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
}

.franchesco-order-status-control__select {
	max-width: 100%;
	min-width: 9.5em;
	font-size: 13px;
}

.franchesco-order-status-control__submit {
	white-space: nowrap;
}

/* Keep the control visible on hover-only rows and on touch screens alike. */
.franchesco-order-status-control__select:focus-visible,
.franchesco-order-status-control__submit:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

/* Column widths: keep the order number and the status on one line each. */
.wp-list-table .column-franchesco_number {
	width: 14%;
}

.wp-list-table .column-franchesco_total {
	width: 10%;
}

/* Wider than the badge alone needs: it also holds the update control. */
.wp-list-table .column-franchesco_status {
	width: 16%;
}

.wp-list-table .column-franchesco_total {
	text-align: right;
}

.franchesco-order-total {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* The order screen meta box. */
.franchesco-order-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 14px;
}

.franchesco-order-field label {
	font-weight: 600;
}

.franchesco-order-field input,
.franchesco-order-field select,
.franchesco-order-field textarea {
	width: 100%;
	max-width: 420px;
}

@media screen and (max-width: 782px) {
	.wp-list-table .column-franchesco_total {
		text-align: left;
	}
}

/**
 * Orders list table in wp-admin.
 *
 * Only the payment-status pill and the order-number column are styled — the
 * rest of the screen stays native WordPress admin.
 */

.column-picceriya_number {
	width: 9.5em;
}

.column-picceriya_status {
	width: 10em;
}

.picceriya-order-number {
	text-decoration: none;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.picceriya-order-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.8;
	white-space: nowrap;
	border: 1px solid transparent;
}

.picceriya-order-status--paid {
	background: #e6f4ea;
	border-color: #b7e0c4;
	color: #14653a;
}

.picceriya-order-status--pending {
	background: #fdf3da;
	border-color: #f2dda4;
	color: #7a5600;
}

.picceriya-order-status--failed {
	background: #fbe6e4;
	border-color: #f0bdb8;
	color: #8b1c14;
}

.column-picceriya_status small {
	display: inline-block;
	margin-top: 4px;
	color: #6d5f56;
}
