/**
 * Vista: Grilla de envíos del admin (página principal del plugin).
 * Depende de: andreani-core-base + componentes badge/button/status/modal
 */

.andreani-shipments-wrap {
	max-width: 1440px;
	padding-right: var(--andr-sp-4);
}

.andreani-header-logo {
	height: 26px;
	vertical-align: middle;
}

.andreani-search-row {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--andr-sp-2);
	margin-bottom: var(--andr-sp-3);
}

.andreani-search-row .andreani-quick-filters {
	margin: 0;
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	gap: var(--andr-sp-2);
	align-items: center;
}

.andreani-search-row .search-box,
.andreani-search-row > .button,
.andreani-search-row > a.button {
	flex-shrink: 0;
}

.andreani-search-row .search-box {
	margin: 0;
}

.andreani-search-row .search-box input[type="search"] {
	height: 34px;
	min-height: 34px;
	border-radius: var(--andr-radius-sm);
	border: 1px solid var(--andr-color-brand);
	padding: 0 12px;
	font-size: var(--andr-text-base);
}

.andreani-search-row .search-box input[type="search"]:focus {
	border-color: var(--andr-color-brand);
	box-shadow: 0 0 0 2px var(--andr-color-brand-subtle);
	outline: none;
}

.andreani-search-row .search-box input[type="submit"] {
	height: 34px;
	min-height: 34px;
	width: 34px;
	min-width: 34px;
	padding: 0;
	border: 1px solid var(--andr-color-brand);
	border-radius: var(--andr-radius-sm);
	background: var(--andr-color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d71920' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center center;
	background-size: 16px 16px;
	color: transparent;
	font-size: 0;
	cursor: pointer;
	transition: var(--andr-transition-fast);
	margin-right: var(--andr-sp-2);
}

.andreani-search-row .search-box input[type="submit"]:hover {
	background-color: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand-hover);
}

.andreani-shipments-wrap .tablenav .actions .button {
	height: 34px;
	min-height: 34px;
	padding: 0 16px;
	border: 1px solid var(--andr-color-brand);
	border-radius: var(--andr-radius-sm);
	background: var(--andr-color-surface);
	color: var(--andr-color-brand);
	font-size: var(--andr-text-base);
	font-weight: var(--andr-fw-medium);
	cursor: pointer;
	transition: var(--andr-transition-fast);
	line-height: 32px;
}

.andreani-shipments-wrap .tablenav .actions .button:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand-hover);
}

.andreani-shipments-wrap .tablenav .actions select {
	height: 34px;
	min-height: 34px;
	min-width: 140px;
	padding: 0 28px 0 10px;
	border: 1px solid var(--andr-color-border-strong);
	border-radius: var(--andr-radius-sm);
	background-color: var(--andr-color-surface);
	background-position: right 8px center;
	font-size: var(--andr-text-base);
	color: var(--andr-color-text-subtle);
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23616a75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 12px;
}

.andreani-shipments-wrap .tablenav .actions select:focus {
	border-color: var(--andr-color-brand);
	box-shadow: 0 0 0 2px var(--andr-color-brand-subtle);
	outline: none;
}

.andreani-shipments-wrap .tablenav .bulkactions select {
	min-width: 160px;
}

.andreani-toolbar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-height: 34px;
	min-width: 34px;
	padding: 0;
	border-radius: var(--andr-radius-sm);
	border: 1px solid var(--andr-color-border-strong);
	background: var(--andr-color-surface);
	color: var(--andr-color-text-muted);
	transition: var(--andr-transition-fast);
}

.andreani-toolbar-btn:hover {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
	background: var(--andr-color-brand-subtle);
}

.andreani-toolbar-btn svg,
.andreani-toolbar-btn .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	color: inherit;
}

.andreani-toolbar-btn--primary {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-historial-btn.button,
.andreani-export-btn.button,
.andreani-logs-btn.button,
.andreani-refresh-btn.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-height: 34px;
	min-width: 34px;
	padding: 0 !important;
	border-radius: var(--andr-radius-sm);
	border: 1px solid var(--andr-color-border-strong);
	background: var(--andr-color-surface);
	color: var(--andr-color-text-muted);
	transition: var(--andr-transition-fast);
}

.andreani-historial-btn.button:hover,
.andreani-export-btn.button:hover,
.andreani-logs-btn.button:hover,
.andreani-refresh-btn.button:hover {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
	background: var(--andr-color-brand-subtle);
}

.andreani-historial-btn svg,
.andreani-export-btn svg,
.andreani-logs-btn svg,
.andreani-refresh-btn .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	color: inherit;
}

.andreani-historial-btn.button {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-notice {
	border-radius: var(--andr-radius-sm);
	margin: var(--andr-sp-4) 0;
	overflow: hidden;
}

.andreani-notice--warning {
	background: var(--andr-color-warning-subtle);
	border: 1px solid var(--andr-yellow-400);
	border-left: 3px solid var(--andr-color-warning);
}

.andreani-notice--info {
	background: var(--andr-color-info-subtle);
	border: 1px solid var(--andr-blue-300);
	border-left: 3px solid var(--andr-color-info);
}

.andreani-notice--error {
	background: var(--andr-color-error-subtle);
	border: 1px solid var(--andr-red-300);
	border-left: 3px solid var(--andr-color-error);
}

.andreani-notice__header {
	display: flex;
	align-items: center;
	gap: var(--andr-sp-2);
	width: 100%;
	padding: var(--andr-sp-2) var(--andr-sp-3);
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
}

.andreani-notice__icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.andreani-notice--warning .andreani-notice__icon {
	color: var(--andr-color-warning);
}

.andreani-notice--info .andreani-notice__icon {
	color: var(--andr-color-info);
}

.andreani-notice--error .andreani-notice__icon {
	color: var(--andr-color-error);
}

.andreani-notice__title {
	flex: 1;
	font-size: var(--andr-text-sm);
	font-weight: var(--andr-fw-semibold);
}

.andreani-notice--warning .andreani-notice__title {
	color: var(--andr-color-warning-strong);
}

.andreani-notice--info .andreani-notice__title {
	color: var(--andr-color-info-strong);
}

.andreani-notice--error .andreani-notice__title {
	color: var(--andr-color-error-strong);
}

.andreani-notice__toggle {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	padding: 2px;
	color: var(--andr-color-text-disabled);
	border-radius: var(--andr-radius-xs);
	transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.andreani-notice__toggle:hover {
	background: rgba(0, 0, 0, 0.08);
	color: var(--andr-color-text-subtle);
}

.andreani-notice--collapsed .andreani-notice__toggle {
	transform: rotate(-90deg);
}

.andreani-notice__body {
	padding: 0 var(--andr-sp-4) var(--andr-sp-3) calc(var(--andr-sp-4) + 20px + var(--andr-sp-3));
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

.andreani-notice--collapsed .andreani-notice__body {
	max-height: 0 !important;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.andreani-notice__body p {
	margin: 0;
	font-size: var(--andr-text-sm);
	line-height: 1.5;
}

.andreani-notice--warning .andreani-notice__body p {
	color: var(--andr-yellow-900);
}

.andreani-notice--warning .andreani-notice__body a {
	color: var(--andr-color-warning);
	font-weight: var(--andr-fw-semibold);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.andreani-notice--warning .andreani-notice__body a:hover {
	color: var(--andr-color-warning-strong);
}

.andreani-pyme-notice {
	display: flex;
	align-items: flex-start;
	gap: var(--andr-sp-3);
	background: var(--andr-color-warning-subtle);
	border: 1px solid var(--andr-yellow-400);
	border-left: 3px solid var(--andr-color-warning);
	border-radius: var(--andr-radius-sm);
	padding: var(--andr-sp-3) var(--andr-sp-4);
	margin: var(--andr-sp-4) 0;
}

.andreani-pyme-notice__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	color: var(--andr-color-warning);
	margin-top: 2px;
}

.andreani-pyme-notice__content {
	flex: 1;
}

.andreani-pyme-notice__content strong {
	color: var(--andr-color-warning-strong);
	font-size: var(--andr-text-md);
	font-weight: var(--andr-fw-semibold);
}

.andreani-pyme-notice__content p {
	margin: var(--andr-sp-1) 0 0;
	color: var(--andr-yellow-900);
	font-size: var(--andr-text-sm);
	line-height: 1.5;
}

.andreani-pyme-notice__content a {
	color: var(--andr-color-warning);
	font-weight: var(--andr-fw-semibold);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.andreani-pyme-notice__content a:hover {
	color: var(--andr-color-warning-strong);
}

.andreani-shipments-wrap .wp-list-table {
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-sm);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	background: var(--andr-color-surface);
	box-shadow: var(--andr-shadow-xs);
}

.andreani-shipments-wrap .wp-list-table tfoot {
	display: none;
}

.andreani-shipments-wrap .wp-list-table thead th {
	background: var(--andr-color-surface-subtle);
	border-bottom: 1px solid var(--andr-color-border);
	padding: var(--andr-sp-3) var(--andr-sp-3);
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.andreani-shipments-wrap .wp-list-table thead th:first-child {
	border-top-left-radius: var(--andr-radius-sm);
}

.andreani-shipments-wrap .wp-list-table thead th:last-child {
	border-top-right-radius: var(--andr-radius-sm);
}

.andreani-shipments-wrap .wp-list-table th.sortable a,
.andreani-shipments-wrap .wp-list-table th.sorted a {
	display: inline-flex;
	align-items: center;
	gap: var(--andr-sp-1);
	color: inherit;
	text-decoration: none;
}

.andreani-shipments-wrap .wp-list-table th.sorted {
	color: var(--andr-color-brand);
}

.andreani-shipments-wrap .wp-list-table th.sortable a span,
.andreani-shipments-wrap .wp-list-table th.sorted a span {
	float: none !important;
}

.andreani-shipments-wrap .wp-list-table tbody tr {
	transition: background 0.1s ease;
}

.andreani-shipments-wrap .wp-list-table tbody tr:hover {
	background: var(--andr-color-surface-subtle);
}

.andreani-shipments-wrap .wp-list-table tbody tr:last-child td {
	border-bottom: none;
}

.andreani-shipments-wrap .wp-list-table tbody tr:last-child td:first-child {
	border-bottom-left-radius: var(--andr-radius-sm);
}

.andreani-shipments-wrap .wp-list-table tbody tr:last-child td:last-child {
	border-bottom-right-radius: var(--andr-radius-sm);
}

.andreani-shipments-wrap .wp-list-table td {
	padding: var(--andr-sp-3) var(--andr-sp-3);
	border-bottom: 1px solid var(--andr-color-border-subtle);
	font-size: var(--andr-text-sm);
	color: var(--andr-color-text-subtle);
	vertical-align: middle;
}

.andreani-shipments-wrap .column-cb { width: 36px; }
.andreani-shipments-wrap .column-order_number { width: 70px; }
.andreani-shipments-wrap .column-customer { width: 130px; }
.andreani-shipments-wrap .column-destination { width: 110px; }
.andreani-shipments-wrap .column-products { width: 150px; }
.andreani-shipments-wrap .column-client_type { width: 70px; text-align: center; }
.andreani-shipments-wrap .column-delivery_mode { width: 80px; }
.andreani-shipments-wrap .column-payment { width: 80px; text-align: center; }
.andreani-shipments-wrap .column-payment .andreani-payment--na {
	color: var(--andr-color-text-disabled);
}
.andreani-shipments-wrap .column-status { width: 130px; }
.andreani-shipments-wrap .column-andreani_id { width: 145px; }
.andreani-shipments-wrap .column-tracking { width: 120px; }
.andreani-shipments-wrap .column-date { width: 85px; }
.andreani-shipments-wrap .column-actions { width: 140px; text-align: center; }

.andreani-shipments-wrap .wp-list-table td.column-order_number a {
	color: var(--andr-color-brand);
	font-weight: var(--andr-fw-semibold);
	text-decoration: none;
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
}

.andreani-shipments-wrap .wp-list-table td.column-order_number a:hover {
	text-decoration: none;
}

.andreani-shipments-wrap .wp-list-table td.column-order_number a:hover .andreani-order-number__num {
	text-decoration: underline;
}

/* Número de pedido: el "#" en cursiva muted como prefijo discreto, el número
 * grande y prominente. Da jerarquía visual entre el separador y el dato real. */
.andreani-order-number__hash {
	font-style: italic;
	font-weight: var(--andr-fw-regular);
	color: var(--andr-color-text-disabled);
	font-size: var(--andr-text-sm);
}

.andreani-order-number__num {
	font-size: var(--andr-text-md);
	font-weight: var(--andr-fw-semibold);
	letter-spacing: 0.01em;
}

.andreani-shipments-wrap .wp-list-table td.column-customer {
	font-size: var(--andr-text-base);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-strong);
}

.andreani-shipments-wrap .wp-list-table td.column-customer small {
	display: block;
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-normal);
	color: var(--andr-color-text-muted);
	margin-top: 2px;
}

.andreani-tracking-code {
	display: inline-block;
	max-width: 110px;
	padding: 3px 6px;
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-subtle);
	background: var(--andr-color-surface-muted);
	border-radius: var(--andr-radius-xs);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	transition: var(--andr-transition-fast);
}

.andreani-tracking-code:hover,
.andreani-copy-click:hover {
	background: var(--andr-color-brand-subtle);
	color: var(--andr-color-brand);
}

.andreani-tracking-code.copied,
.andreani-copy-click.copied {
	background: var(--andr-color-success-subtle);
	color: var(--andr-color-success);
}

.andreani-cell--empty,
.andreani-tracking--empty,
.andreani-destination--empty,
.andreani-actions--empty {
	color: var(--andr-color-text-disabled);
	font-size: var(--andr-text-xs);
}

.andreani-destination {
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-subtle);
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.andreani-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--andr-sp-1);
	position: relative;
}

/* Override del botón icon-only base: 34x34 con SVG 18px para alinear con .andreani-toolbar-btn */
.andreani-actions .andr-btn--icon {
	width: 34px;
	height: 34px;
	min-width: 34px;
	min-height: 34px;
	padding: 0;
	border-radius: var(--andr-radius-sm);
	border-color: var(--andr-color-border-strong);
	background: var(--andr-color-surface);
	color: var(--andr-color-text-muted);
}

.andreani-actions .andr-btn--icon:hover {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
	background: var(--andr-color-brand-subtle);
}

.andreani-actions .andr-btn--icon:disabled {
	opacity: 0.6;
	cursor: wait;
}

.andreani-actions .andr-btn--icon svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
}

.andreani-actions .andr-btn--icon .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	line-height: 18px;
	color: inherit;
}

.andreani-spin {
	animation: andr-shipments-spin 0.8s linear infinite;
}

.andreani-inline-confirm {
	display: inline-flex;
	align-items: center;
	gap: var(--andr-sp-2);
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	background: var(--andr-color-surface);
	padding: var(--andr-sp-1) var(--andr-sp-2) var(--andr-sp-1) var(--andr-sp-3);
	border-radius: var(--andr-radius-pill);
	box-shadow: var(--andr-shadow-md);
	z-index: var(--andr-z-dropdown);
	animation: andr-shipments-fade-in 0.15s ease;
}

.andreani-inline-confirm__text {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-subtle);
	white-space: nowrap;
}

.andreani-confirm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border-radius: var(--andr-radius-sm);
	cursor: pointer;
	transition: var(--andr-transition-fast);
	border: 1.5px solid;
	background: var(--andr-color-surface);
}

.andreani-confirm-btn svg {
	width: 12px;
	height: 12px;
	stroke: currentColor;
	stroke-width: 2.5;
}

.andreani-confirm-btn--yes {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-confirm-btn--yes:hover {
	background: var(--andr-color-brand);
	color: var(--andr-color-text-inverse);
}

.andreani-confirm-btn--no {
	border-color: var(--andr-color-text-disabled);
	color: var(--andr-color-text-disabled);
}

.andreani-confirm-btn--no:hover {
	background: var(--andr-color-text-disabled);
	color: var(--andr-color-text-inverse);
}

.andreani-inline-confirm button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border-radius: var(--andr-radius-sm);
	cursor: pointer;
	transition: var(--andr-transition-fast);
	border: 1.5px solid;
	background: var(--andr-color-surface);
}

.andreani-inline-confirm button svg {
	width: 12px;
	height: 12px;
	stroke: currentColor;
	stroke-width: 2.5;
}

.andreani-confirm-yes {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-confirm-yes:hover {
	background: var(--andr-color-brand);
	color: var(--andr-color-text-inverse);
}

.andreani-confirm-yes:hover svg {
	stroke: var(--andr-color-text-inverse);
}

.andreani-confirm-no {
	border-color: var(--andr-color-text-disabled);
	color: var(--andr-color-text-disabled);
}

.andreani-confirm-no:hover {
	background: var(--andr-color-text-disabled);
	color: var(--andr-color-text-inverse);
}

.andreani-confirm-no:hover svg {
	stroke: var(--andr-color-text-inverse);
}

.andreani-shipments-wrap .tablenav {
	margin: var(--andr-sp-3) 0;
}

.andreani-shipments-wrap .tablenav-pages {
	color: var(--andr-color-text-muted);
}

.andreani-shipments-wrap .tablenav-pages .displaying-num {
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-xs);
}

.andreani-shipments-wrap .tablenav-pages a,
.andreani-shipments-wrap .tablenav-pages span.tablenav-pages-navspan {
	border-radius: var(--andr-radius-xs);
}

.andreani-shipments-wrap .tablenav-pages a:hover {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-table-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 20px;
	background: var(--andr-color-surface-subtle);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-md);
	margin-top: var(--andr-sp-4);
}

.andreani-table-loader__spinner {
	width: 72px;
	height: 72px;
	position: relative;
	overflow: hidden;
	border-radius: 50%;
}

.andreani-table-loader__spinner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
	background-size: 220% 100%;
	background-repeat: no-repeat;
	animation: andr-loader-shimmer 1.8s ease-in-out infinite;
	mix-blend-mode: overlay;
	pointer-events: none;
	z-index: 2;
}

.andreani-table-loader__logo {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.andreani-table-loader__logo--bg {
	opacity: 0.18;
}

.andreani-table-loader__logo--fill {
	clip-path: none;
	animation: andr-loader-pulse 1.6s ease-in-out infinite;
	transform-origin: center;
	filter: drop-shadow(0 0 0 transparent);
}

.andreani-table-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	background: var(--andr-color-error-subtle);
	border: 1px solid var(--andr-color-error);
	border-radius: var(--andr-radius-md);
	margin-top: var(--andr-sp-4);
}

.andreani-table-error__icon {
	width: 40px;
	height: 40px;
	color: var(--andr-color-error);
	margin-bottom: var(--andr-sp-4);
}

.andreani-table-error__message {
	font-size: var(--andr-text-md);
	color: var(--andr-color-error-strong);
	margin-bottom: var(--andr-sp-4);
}

.andreani-table-error__retry {
	background: var(--andr-color-brand);
	color: var(--andr-color-text-inverse);
	border: none;
	padding: 8px 20px;
	border-radius: var(--andr-radius-sm);
	font-size: var(--andr-text-md);
	font-weight: var(--andr-fw-medium);
	cursor: pointer;
	transition: var(--andr-transition-fast);
}

.andreani-table-error__retry:hover {
	background: var(--andr-color-brand-hover);
}

@keyframes andr-shipments-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@keyframes andr-shipments-fade-in {
	from { opacity: 0; transform: translateY(-50%) scale(0.95); }
	to { opacity: 1; transform: translateY(-50%) scale(1); }
}

@keyframes andr-loader-pulse {
	0%, 100% {
		opacity: 0.55;
		transform: scale(1);
		filter: drop-shadow(0 0 0 transparent);
	}
	50% {
		opacity: 1;
		transform: scale(1.06);
		filter: drop-shadow(0 0 12px rgba(215, 25, 32, 0.35));
	}
}

@keyframes andr-loader-shimmer {
	0%   { background-position: 220% 0; }
	100% { background-position: -120% 0; }
}

@keyframes andr-table-content-appear {
	from {
		opacity: 0;
		filter: blur(6px);
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		filter: blur(0);
		transform: translateY(0);
	}
}

#andreani-table-container .wp-list-table {
	animation: andr-table-content-appear 0.45s ease-out;
}

.andreani-table-loader--complete {
	animation: andr-loader-disappear 0.35s ease-out forwards;
}

@keyframes andr-loader-disappear {
	to {
		opacity: 0;
		transform: scale(0.92);
	}
}

.andreani-refresh-btn--loading .dashicons {
	animation: andr-shipments-spin 0.8s linear infinite;
}

/**
 * STATS BAR — Cards de resumen clickeables (Pendientes / Por pagar [Pyme] o Listos
 * [Corpo] / Enviados / Fallidos). Mutuamente excluyentes. Sincronizan el
 * `<select name="andreani_status">` y disparan `loadTable()` del AndreaniTableLoader.
 */
.andreani-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--andr-sp-3);
	margin: var(--andr-sp-4) 0 var(--andr-sp-3);
	font-family: var(--andr-font-body);
}

.andreani-stat-card {
	display: flex;
	align-items: center;
	gap: var(--andr-sp-3);
	padding: var(--andr-sp-4);
	background: var(--andr-color-surface);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-sm);
	cursor: pointer;
	text-align: left;
	transition: transform var(--andr-transition-fast),
				box-shadow var(--andr-transition-fast),
				border-color var(--andr-transition-fast),
				background var(--andr-transition-fast);
	box-shadow: var(--andr-shadow-xs);
	min-height: 76px;
}

.andreani-stat-card:hover {
	transform: translateY(-1px);
	box-shadow: var(--andr-shadow-md);
	border-color: var(--andr-color-border-strong);
}

.andreani-stat-card:focus-visible {
	outline: 2px solid var(--andr-color-border-focus);
	outline-offset: 2px;
}

.andreani-stat-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--andr-radius-sm);
	flex-shrink: 0;
	transition: background var(--andr-transition-fast),
				color var(--andr-transition-fast);
}

.andreani-stat-card__icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.andreani-stat-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.andreani-stat-card__label {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: var(--andr-leading-tight);
}

.andreani-stat-card__count {
	font-family: var(--andr-font-display);
	font-size: var(--andr-text-2xl);
	font-weight: var(--andr-fw-bold);
	color: var(--andr-color-text-strong);
	line-height: var(--andr-leading-tight);
}

/* Variant: Pendientes (gris neutro) */
.andreani-stat-card--pending .andreani-stat-card__icon {
	background: var(--andr-color-surface-muted);
	color: var(--andr-color-text-muted);
}

.andreani-stat-card--pending:hover {
	border-color: var(--andr-color-border-strong);
}

.andreani-stat-card--pending.andreani-stat-card--active {
	background: var(--andr-color-surface-subtle);
	border-color: var(--andr-color-border-strong);
}

.andreani-stat-card--pending.andreani-stat-card--active .andreani-stat-card__icon {
	background: var(--andr-color-border-strong);
	color: var(--andr-color-surface);
}

/* Variant: Awaiting (Por pagar / Listos) — amarillo warning */
.andreani-stat-card--awaiting .andreani-stat-card__icon {
	background: var(--andr-color-warning-subtle);
	color: var(--andr-color-warning-strong);
}

.andreani-stat-card--awaiting:hover {
	border-color: var(--andr-color-warning);
}

.andreani-stat-card--awaiting.andreani-stat-card--active {
	background: var(--andr-color-warning-subtle);
	border-color: var(--andr-color-warning);
}

.andreani-stat-card--awaiting.andreani-stat-card--active .andreani-stat-card__icon {
	background: var(--andr-color-warning);
	color: var(--andr-color-surface);
}

/* Variant: Enviados — verde success */
.andreani-stat-card--shipped .andreani-stat-card__icon {
	background: var(--andr-color-success-subtle);
	color: var(--andr-color-success-strong);
}

.andreani-stat-card--shipped:hover {
	border-color: var(--andr-color-success);
}

.andreani-stat-card--shipped.andreani-stat-card--active {
	background: var(--andr-color-success-subtle);
	border-color: var(--andr-color-success);
}

.andreani-stat-card--shipped.andreani-stat-card--active .andreani-stat-card__icon {
	background: var(--andr-color-success);
	color: var(--andr-color-surface);
}

/* Variant: Fallidos — rojo error */
.andreani-stat-card--failed .andreani-stat-card__icon {
	background: var(--andr-color-error-subtle);
	color: var(--andr-color-error-strong);
}

.andreani-stat-card--failed:hover {
	border-color: var(--andr-color-error);
}

.andreani-stat-card--failed.andreani-stat-card--active {
	background: var(--andr-color-error-subtle);
	border-color: var(--andr-color-error);
}

.andreani-stat-card--failed.andreani-stat-card--active .andreani-stat-card__icon {
	background: var(--andr-color-error);
	color: var(--andr-color-surface);
}

/* Alert state: cuando hay envios fallidos, llamamos la atencion. */
.andreani-stat-card--alert {
	border-color: var(--andr-color-error);
	box-shadow: 0 0 0 0 var(--andr-color-error-subtle);
	animation: andr-stat-pulse 2.4s ease-in-out infinite;
}

.andreani-stat-card--alert .andreani-stat-card__count {
	color: var(--andr-color-error-strong);
}

@keyframes andr-stat-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(215, 25, 32, 0.18);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(215, 25, 32, 0);
	}
}

/* Reduced motion: respetar la preferencia del usuario. */
@media (prefers-reduced-motion: reduce) {
	.andreani-stat-card,
	.andreani-stat-card--alert {
		animation: none;
		transition: none;
	}
}

/* QUICK FILTER CHIPS — combinables con un chip "Limpiar". */
.andreani-quick-filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--andr-sp-2);
	align-items: center;
	margin: var(--andr-sp-3) 0;
	font-family: var(--andr-font-body);
}

/* Cada grupo de chips (date / status / tracking) — chips juntos con gap chico,
 * separación visual con divider vertical entre grupos. Dentro del grupo es
 * mutual exclusive (el JS destilda los demás al activar uno). */
.andreani-quick-filters__group {
	display: inline-flex;
	flex-wrap: wrap;
	gap: var(--andr-sp-1);
	align-items: center;
}

.andreani-quick-filters__divider {
	display: inline-block;
	width: 1px;
	height: 18px;
	background: var(--andr-color-border-strong);
	margin: 0 var(--andr-sp-1);
	flex-shrink: 0;
}

.andreani-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--andr-sp-1);
	padding: 4px var(--andr-sp-3);
	background: var(--andr-color-surface);
	border: 1px solid var(--andr-color-border-strong);
	border-radius: var(--andr-radius-pill);
	font-size: var(--andr-text-sm);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-subtle);
	cursor: pointer;
	transition: background var(--andr-transition-fast),
				border-color var(--andr-transition-fast),
				color var(--andr-transition-fast),
				transform var(--andr-transition-fast);
	line-height: var(--andr-leading-snug);
	min-height: 28px;
}

.andreani-chip:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-chip:focus-visible {
	outline: 2px solid var(--andr-color-border-focus);
	outline-offset: 2px;
}

.andreani-chip--active {
	background: var(--andr-color-brand);
	border-color: var(--andr-color-brand);
	color: var(--andr-color-text-inverse);
}

.andreani-chip--active:hover {
	background: var(--andr-color-brand-hover);
	border-color: var(--andr-color-brand-hover);
	color: var(--andr-color-text-inverse);
}

.andreani-chip--reset {
	display: none;
	align-items: center;
	gap: 6px;
	background: var(--andr-color-surface);
	border-color: var(--andr-color-border-strong);
	color: var(--andr-color-text-subtle);
	font-weight: var(--andr-fw-medium);
}

.andreani-quick-filters--has-active .andreani-chip--reset {
	display: inline-flex;
	animation: andr-chip-fade-in 0.2s ease-out;
}

@keyframes andr-chip-fade-in {
	from { opacity: 0; transform: scale(0.9); }
	to   { opacity: 1; transform: scale(1); }
}

.andreani-chip--reset svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.andreani-chip--reset:hover {
	background: var(--andr-color-error-subtle);
	border-color: var(--andr-color-error);
	color: var(--andr-color-error-strong);
}

@media screen and (max-width: 1280px) {
	.andreani-shipments-wrap .column-products {
		display: none;
	}
}

@media screen and (max-width: 1100px) {
	.andreani-shipments-wrap .column-destination {
		display: none;
	}
}

@media screen and (max-width: 960px) {
	.andreani-shipments-wrap .column-delivery_mode,
	.andreani-shipments-wrap .column-andreani_id {
		display: none;
	}

	.andreani-tracking-code {
		max-width: 80px;
	}
}

/* Responsive: stats bar a 2 columnas. */
@media screen and (max-width: 700px) {
	.andreani-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.andreani-stat-card {
		padding: var(--andr-sp-3);
		min-height: 64px;
	}

	.andreani-stat-card__icon {
		width: 36px;
		height: 36px;
	}

	.andreani-stat-card__icon svg {
		width: 20px;
		height: 20px;
	}

	.andreani-stat-card__count {
		font-size: var(--andr-text-xl);
	}

	.andreani-chip--reset {
		margin-left: 0;
	}
}

@media screen and (max-width: 782px) {
	/* Mobile: tabla colapsa a tarjetas expandibles */

	.andreani-shipments-wrap {
		padding-right: 0;
	}

	.andreani-search-row {
		flex-wrap: wrap;
		gap: 8px;
	}

	.andreani-search-row .search-box {
		width: 100%;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.andreani-search-row .search-box input[type="search"],
	.andreani-search-row .search-box input[type="submit"] {
		width: 100%;
	}

	.andreani-shipments-wrap .tablenav .actions {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.andreani-shipments-wrap .tablenav .actions select {
		min-width: 130px;
		flex: 1;
	}

	.andreani-shipments-wrap .tablenav .bulkactions {
		width: 100%;
		display: flex;
		gap: 8px;
	}

	.andreani-shipments-wrap .tablenav .bulkactions select {
		flex: 1;
	}

	/* WP core inyecta display:block y border en celdas mobile — !important para sobreescribir */
	.andreani-shipments-wrap .wp-list-table {
		border: none !important;
		box-shadow: none !important;
		background: transparent !important;
	}

	.andreani-shipments-wrap .wp-list-table thead {
		display: none !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody tr {
		display: block !important;
		position: relative;
		margin-bottom: 12px;
		border: 1px solid var(--andr-color-border) !important;
		border-radius: var(--andr-radius-sm) !important;
		background: var(--andr-color-surface) !important;
		overflow: hidden;
	}

	.andreani-shipments-wrap .wp-list-table tbody td {
		display: none !important;
		padding: 12px 16px !important;
		border: none !important;
		border-bottom: 1px solid var(--andr-color-border-subtle) !important;
		text-align: left !important;
		background: var(--andr-color-surface) !important;
		flex-direction: column !important;
		align-items: flex-start !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td,
	.andreani-shipments-wrap .wp-list-table tbody td * {
		text-decoration: none !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td > * {
		display: block !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td.check-column {
		display: block !important;
		position: absolute !important;
		top: 14px !important;
		left: 12px !important;
		padding: 0 !important;
		border: none !important;
		background: transparent !important;
		width: 20px !important;
		z-index: 5;
	}

	.andreani-shipments-wrap .wp-list-table tbody td.column-order_number {
		display: block !important;
		padding: 16px 60px 16px 44px !important;
		background: var(--andr-color-surface-subtle) !important;
		border-bottom: 1px solid var(--andr-color-border) !important;
		font-weight: 600 !important;
		font-size: 15px !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td.column-order_number a {
		color: var(--andr-color-brand) !important;
		text-decoration: none !important;
	}

	/* Toggle row chevron — !important necesario para vencer al CSS de WP core */
	.andreani-shipments-wrap .wp-list-table .toggle-row {
		position: absolute !important;
		top: 14px !important;
		right: 12px !important;
		left: auto !important;
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
		padding: 0 !important;
		margin: 0 !important;
		border: 1px solid var(--andr-color-brand) !important;
		border-radius: var(--andr-radius-xs) !important;
		background: var(--andr-color-surface) !important;
		outline: none !important;
		box-shadow: none !important;
		cursor: pointer !important;
		z-index: 10;
		font-size: 0 !important;
		line-height: 0 !important;
		text-indent: -9999px !important;
	}

	.andreani-shipments-wrap .wp-list-table .toggle-row::after {
		content: "" !important;
		position: absolute !important;
		top: 50% !important;
		left: 50% !important;
		width: 8px !important;
		height: 8px !important;
		border: solid var(--andr-color-brand) !important;
		border-width: 0 2px 2px 0 !important;
		transform: translate(-50%, -65%) rotate(45deg) !important;
		transition: transform 0.2s ease !important;
	}

	.andreani-shipments-wrap .wp-list-table .toggle-row:hover {
		background: var(--andr-color-brand-subtle) !important;
	}

	.andreani-shipments-wrap .wp-list-table tr.is-expanded .toggle-row::after {
		transform: translate(-50%, -35%) rotate(-135deg) !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td {
		display: block !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.check-column {
		display: block !important;
		position: absolute !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.column-order_number {
		display: block !important;
	}

	/* Mantener ocultas estas columnas incluso al expandir el row */
	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.column-client_type,
	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.column-andreani_id,
	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.column-delivery_mode {
		display: none !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td::before {
		display: none !important;
		content: "" !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td.column-status {
		display: block !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody td.column-status .andr-status,
	.andreani-shipments-wrap .wp-list-table tbody td.column-status .andreani-status {
		display: inline-flex !important;
		width: auto !important;
	}

	.andreani-shipments-wrap .wp-list-table tbody tr.is-expanded td.column-actions {
		display: flex !important;
		flex-direction: row !important;
		gap: 8px !important;
		padding: 12px 16px !important;
		background: var(--andr-color-surface-subtle) !important;
		border-top: 1px solid var(--andr-color-border) !important;
		border-bottom: none !important;
	}

	.andreani-notice__body {
		padding-left: var(--andr-sp-4);
	}

	.andreani-pyme-notice {
		flex-direction: column;
		padding: 12px;
	}

	.andreani-pyme-notice__icon {
		align-self: flex-start;
	}
}

.andreani-tracking-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--andr-sp-1);
	width: 100%;
}

.andreani-tracking-link {
	flex-shrink: 0;
}

.andreani-tracking-link svg {
	width: 14px;
	height: 14px;
	color: var(--andr-color-brand);
	vertical-align: middle;
}

/* Expandir ID Andreani en hover (si está truncado en la celda) */
.andreani-shipments-wrap .wp-list-table td.column-andreani_id {
	position: relative;
}

.andreani-shipments-wrap .wp-list-table td.column-andreani_id:hover {
	overflow: visible;
}

.andreani-shipments-wrap .wp-list-table td.column-andreani_id:hover .andreani-tracking-code {
	max-width: none;
	padding: 4px 8px;
	box-shadow: var(--andr-shadow-md);
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	z-index: var(--andr-z-dropdown);
	background: var(--andr-color-surface);
}

.andreani-modal__unmark-section {
	margin-top: var(--andr-sp-4);
	padding-top: var(--andr-sp-4);
	border-top: 1px solid var(--andr-color-border-subtle);
	display: flex;
	align-items: center;
	gap: var(--andr-sp-3);
}

.andreani-modal__unmark-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	background: none;
	border: none;
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-md);
	cursor: pointer;
	transition: var(--andr-transition-fast);
}

.andreani-modal__unmark-link:hover {
	color: var(--andr-color-brand);
}

.andreani-modal__unmark-link .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.andreani-modal__unmark-confirm {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.andreani-modal__unmark-confirm-text {
	font-size: var(--andr-text-md);
	color: var(--andr-color-text-muted);
}

.andreani-confirm-btn--sm {
	width: 24px;
	height: 24px;
}

.andreani-confirm-unmark-yes,
.andreani-confirm-unmark-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border-radius: var(--andr-radius-xs);
	cursor: pointer;
	transition: var(--andr-transition-fast);
	border: 1.5px solid;
	background: var(--andr-color-surface);
}

.andreani-confirm-unmark-yes svg,
.andreani-confirm-unmark-no svg {
	width: 12px;
	height: 12px;
	stroke: currentColor;
	stroke-width: 2.5;
}

.andreani-confirm-unmark-yes {
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-confirm-unmark-yes:hover:not(:disabled) {
	background: var(--andr-color-brand);
	color: var(--andr-color-text-inverse);
}

.andreani-confirm-unmark-yes:hover:not(:disabled) svg {
	stroke: var(--andr-color-text-inverse);
}

/* Disabled — !important necesario para vencer al :hover de arriba */
.andreani-confirm-unmark-yes:disabled,
.andreani-confirm-unmark-yes:disabled:hover {
	background: var(--andr-color-surface) !important;
	color: var(--andr-color-brand) !important;
	border-color: var(--andr-color-brand) !important;
	cursor: wait;
	opacity: 1;
	pointer-events: none;
}

.andreani-confirm-unmark-no {
	border-color: var(--andr-color-text-disabled);
	color: var(--andr-color-text-disabled);
}

.andreani-confirm-unmark-no:hover {
	background: var(--andr-color-text-disabled);
	color: var(--andr-color-text-inverse);
}

.andreani-confirm-unmark-no:hover svg {
	stroke: var(--andr-color-text-inverse);
}

.andreani-bulk-shipped__intro {
	margin: 0 0 var(--andr-sp-4);
	font-size: var(--andr-text-md);
	color: var(--andr-color-text-subtle);
	line-height: 1.5;
}

.andreani-bulk-shipped__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.andreani-bulk-shipped__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px;
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-md);
}

.andreani-bulk-shipped__loading .spinner {
	float: none;
	margin: 0;
}

.andreani-bulk-shipped__empty {
	padding: 20px;
	text-align: center;
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-md);
}

.andreani-bulk-shipped__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: var(--andr-color-surface-subtle);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-sm);
	transition: var(--andr-transition-fast);
}

.andreani-bulk-shipped__item:focus-within {
	border-color: var(--andr-color-brand);
	box-shadow: 0 0 0 2px var(--andr-color-brand-subtle);
}

.andreani-bulk-shipped__item--corpo {
	background: var(--andr-color-info-subtle);
	border-color: var(--andr-blue-200);
}

.andreani-bulk-shipped__order {
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-text-strong);
	font-size: var(--andr-text-sm);
	font-family: var(--andr-font-mono);
	white-space: nowrap;
	flex-shrink: 0;
	padding: 4px 8px;
	background: var(--andr-color-surface-subtle);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-xs);
	cursor: pointer;
	transition: background var(--andr-transition-fast), border-color var(--andr-transition-fast);
}

.andreani-bulk-shipped__order:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand);
}

.andreani-bulk-shipped__order.copied {
	background: var(--andr-color-success-subtle);
	border-color: var(--andr-color-success);
	color: var(--andr-color-success-strong);
}

.andreani-bulk-shipped__type {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	padding: 2px 8px;
	border-radius: var(--andr-radius-pill);
}

.andreani-bulk-shipped__type--pyme {
	background: var(--andr-color-brand-subtle);
	color: var(--andr-color-brand-pressed);
}

.andreani-bulk-shipped__type--corpo {
	background: var(--andr-color-info-subtle);
	color: var(--andr-color-info-strong);
}

.andreani-bulk-shipped__input {
	flex: 1;
	padding: 6px 10px;
	border: 1px solid var(--andr-color-border-strong);
	border-radius: var(--andr-radius-xs);
	font-size: var(--andr-text-sm);
	font-family: var(--andr-font-mono);
	transition: var(--andr-transition-fast);
	background: var(--andr-color-surface);
}

.andreani-bulk-shipped__input:focus {
	outline: none;
	border-color: var(--andr-color-brand);
	box-shadow: 0 0 0 2px var(--andr-color-brand-subtle);
}

.andreani-bulk-shipped__input::placeholder {
	color: var(--andr-color-text-disabled);
	font-family: var(--andr-font-body);
}

.andreani-bulk-shipped__tracking-label {
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-muted);
	white-space: nowrap;
}

.andreani-modal__corpo-info {
	background: var(--andr-color-surface-subtle);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-sm);
	overflow: hidden;
}

.andreani-corpo-info__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--andr-sp-3) var(--andr-sp-4);
	background: var(--andr-color-info-subtle);
	border-bottom: 1px solid var(--andr-blue-200);
}

.andreani-corpo-info__order {
	font-weight: var(--andr-fw-bold);
	font-size: var(--andr-text-md);
	color: var(--andr-color-text-strong);
}

.andreani-corpo-info__header .andr-badge--corpo,
.andreani-corpo-info__header .andreani-badge--corpo {
	font-size: 9px;
	padding: 2px 6px;
}

.andreani-corpo-info__details {
	padding: var(--andr-sp-3) var(--andr-sp-4);
}

.andreani-corpo-info__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--andr-sp-2) 0;
	border-bottom: 1px solid var(--andr-color-border-subtle);
}

.andreani-corpo-info__row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.andreani-corpo-info__row:first-child {
	padding-top: 0;
}

.andreani-corpo-info__label {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-muted);
}

.andreani-corpo-info__value {
	font-size: var(--andr-text-md);
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-strong);
	display: flex;
	align-items: center;
	gap: var(--andr-sp-2);
}

.andreani-corpo-info__value .andreani-tracking-code {
	max-width: none;
	font-size: var(--andr-text-xs);
	padding: 4px 8px;
}

.andreani-corpo-info__track-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: var(--andr-radius-xs);
	color: var(--andr-color-brand);
	transition: var(--andr-transition-fast);
}

.andreani-corpo-info__track-link:hover {
	background: var(--andr-color-brand-subtle);
	color: var(--andr-color-brand-hover);
}

.andreani-corpo-info__track-link svg {
	width: 14px;
	height: 14px;
}

.andreani-corpo-info__value .andr-status,
.andreani-corpo-info__value .andreani-status {
	font-size: var(--andr-text-xs);
	padding: 3px 8px;
}

.andreani-error-trigger {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-left: var(--andr-sp-1);
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	color: var(--andr-color-error);
	cursor: pointer;
	border-radius: 50%;
	transition: background-color var(--andr-transition-fast), color var(--andr-transition-fast), transform var(--andr-transition-fast);
	vertical-align: middle;
}

.andreani-error-trigger:hover {
	background: var(--andr-color-error-subtle);
	color: var(--andr-color-error-strong);
	transform: scale(1.05);
}

.andreani-error-trigger:focus {
	outline: none;
	box-shadow: none;
}

.andreani-error-trigger:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--andr-color-error-subtle), 0 0 0 4px var(--andr-color-error);
}

.andreani-error-trigger:active {
	transform: scale(0.95);
}

.andreani-error-trigger svg {
	width: 18px;
	height: 18px;
	display: block;
	stroke-width: 2.25;
}

/* Row entera clickeable + detalle colapsable (eager-loaded). */

/* Row del envío clickeable — toda la fila dispara el toggle. Los elementos
   actionables (input/button/a/code) están excluidos en el JS por target.closest(). */
.andreani-shipments-wrap .wp-list-table tbody tr[data-order-id] {
	cursor: pointer;
	transition: background-color var(--andr-transition-fast);
}

.andreani-shipments-wrap .wp-list-table tbody tr[data-order-id]:hover {
	background: var(--andr-color-surface-subtle);
}

.andreani-shipments-wrap .wp-list-table tbody tr[data-order-id]:focus-visible {
	outline: 2px solid var(--andr-color-border-focus);
	outline-offset: -2px;
}

/* Estado expandido del row primario: bg subtle + borde izquierdo brand como
   indicador visual de "abierto". */
.andreani-shipments-wrap .wp-list-table tbody tr.andreani-row--expanded {
	background: var(--andr-color-brand-subtle);
	box-shadow: inset 3px 0 0 0 var(--andr-color-brand);
}

.andreani-shipments-wrap .wp-list-table tbody tr.andreani-row--expanded > td,
.andreani-shipments-wrap .wp-list-table tbody tr.andreani-row--expanded > th {
	border-bottom: none;
}

/* ----- Detail row (TR eager-loaded en single_row) -----
   Colapsado por defecto: el contenido tiene max-height:0 + opacity:0, y borramos
   bordes/padding del td para que el `<tr>` ocupe 0px alto cuando esta cerrado.
   max-height generoso (3000px) porque ahora el detalle puede expandir productos
   via <details> nativo y no queremos clipping cuando el carrito tiene muchos items. */
.andreani-shipments-wrap .andreani-detail-row {
	background: var(--andr-color-surface-subtle);
}

.andreani-shipments-wrap .andreani-detail-row__cell {
	padding: 0 !important;
	border-bottom: 0 !important;
	border-top: 0 !important;
}

.andreani-shipments-wrap .andreani-detail-row--visible .andreani-detail-row__cell {
	border-bottom: 1px solid var(--andr-color-border) !important;
}

.andreani-shipments-wrap .andreani-detail-row__content {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition:
		max-height 0.3s ease,
		opacity 0.25s ease;
}

.andreani-shipments-wrap .andreani-detail-row--visible .andreani-detail-row__content {
	max-height: 3000px;
	opacity: 1;
}

/* ----- Detalle: layout denso operativo ----- */
.andreani-shipments-wrap .andreani-detail {
	padding: var(--andr-sp-4) var(--andr-sp-5);
	background: var(--andr-color-surface);
	border-left: 3px solid var(--andr-color-brand);
}

.andreani-shipments-wrap .andreani-detail--error {
	color: var(--andr-color-text-subtle);
	font-size: var(--andr-text-sm);
}

/* ----- HEADER (envío + síntesis inline) ----- */
.andreani-shipments-wrap .andreani-detail__header {
	display: flex;
	flex-direction: column;
	gap: var(--andr-sp-1);
	padding-bottom: var(--andr-sp-3);
	border-bottom: 1px solid var(--andr-color-border);
	margin-bottom: var(--andr-sp-3);
}

.andreani-shipments-wrap .andreani-detail__order {
	margin: 0;
	font-family: var(--andr-font-display);
	font-size: var(--andr-text-md);
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-text-strong);
}

.andreani-shipments-wrap .andreani-detail__highlights {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--andr-sp-3);
	font-size: var(--andr-text-sm);
	color: var(--andr-color-text-subtle);
}

.andreani-shipments-wrap .andreani-detail__highlights > span {
	display: inline-flex;
	align-items: center;
	gap: var(--andr-sp-1);
}

.andreani-shipments-wrap .andreani-detail__highlights svg {
	width: 14px;
	height: 14px;
	color: var(--andr-color-brand);
	flex-shrink: 0;
}

/* ----- ROWS (dl horizontal tipo "Resumen de envíos") ----- */
.andreani-shipments-wrap .andreani-detail__rows {
	margin: 0 0 var(--andr-sp-3);
	display: flex;
	flex-direction: column;
	gap: 0;
}

.andreani-shipments-wrap .andreani-detail__row {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: var(--andr-sp-3);
	padding: var(--andr-sp-2) 0;
	border-bottom: 1px solid var(--andr-color-border-subtle);
	align-items: center;
}

.andreani-shipments-wrap .andreani-detail__row:last-child {
	border-bottom: none;
}

.andreani-shipments-wrap .andreani-detail__row dt {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0;
}

.andreani-shipments-wrap .andreani-detail__row dd {
	margin: 0;
	font-size: var(--andr-text-sm);
	color: var(--andr-color-text);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--andr-sp-2);
	word-break: break-word;
}

.andreani-shipments-wrap .andreani-detail__row dd svg {
	width: 14px;
	height: 14px;
	color: var(--andr-color-brand);
	flex-shrink: 0;
}

.andreani-shipments-wrap .andreani-detail__row dd a {
	color: var(--andr-color-text-link);
	text-decoration: none;
}

.andreani-shipments-wrap .andreani-detail__row dd a:hover {
	text-decoration: underline;
}

.andreani-shipments-wrap .andreani-detail__row-separator {
	color: var(--andr-color-text-disabled);
	margin: 0 var(--andr-sp-1);
}

.andreani-shipments-wrap .andreani-detail__row--error dd {
	color: var(--andr-color-error-strong);
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
}

/* ----- Chip copyable (ID / Tracking) ----- */
.andreani-shipments-wrap .andreani-detail__chip {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	background: var(--andr-color-surface-muted);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-xs);
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-strong);
	cursor: pointer;
	transition:
		background var(--andr-transition-fast),
		border-color var(--andr-transition-fast),
		color var(--andr-transition-fast);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.andreani-shipments-wrap .andreani-detail__chip:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-shipments-wrap .andreani-detail__chip.copied {
	background: var(--andr-color-success-subtle);
	border-color: var(--andr-color-success);
	color: var(--andr-color-success-strong);
}

.andreani-shipments-wrap .andreani-detail__chip:focus-visible {
	outline: 2px solid var(--andr-color-border-focus);
	outline-offset: 2px;
}

/* ----- Layout 2 columnas cuando hay error -----
   Sin error: 1 columna (rows full width). Con error: 50/50, izquierda rows
   (con productos integrado debajo de "Vas a enviar") y derecha aside con
   error card + body card apilados verticalmente. */
.andreani-shipments-wrap .andreani-detail__layout {
	display: block;
}

.andreani-shipments-wrap .andreani-detail__layout--has-error {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--andr-sp-4);
	align-items: start;
}

.andreani-shipments-wrap .andreani-detail__main {
	min-width: 0;
}

.andreani-shipments-wrap .andreani-detail__aside {
	display: flex;
	flex-direction: column;
	gap: var(--andr-sp-3);
	min-width: 0;
}

/* Card del mensaje de error (en el aside derecho) */
.andreani-shipments-wrap .andreani-detail__error-card {
	background: var(--andr-color-error-subtle);
	border: 1px solid var(--andr-color-error);
	border-radius: var(--andr-radius-sm);
	overflow: hidden;
}

.andreani-shipments-wrap .andreani-detail__error-card-header {
	display: flex;
	align-items: center;
	gap: var(--andr-sp-2);
	padding: var(--andr-sp-2) var(--andr-sp-3);
	background: var(--andr-color-surface);
	border-bottom: 1px solid var(--andr-color-error);
}

.andreani-shipments-wrap .andreani-detail__error-card-icon {
	display: inline-flex;
	color: var(--andr-color-error);
}

.andreani-shipments-wrap .andreani-detail__error-card-icon svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.andreani-shipments-wrap .andreani-detail__error-card-title {
	flex: 1;
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-error-strong);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.andreani-detail__error-card-copy {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: var(--andr-color-surface);
	border: 1px solid var(--andr-color-border-strong);
	border-radius: var(--andr-radius-xs);
	box-shadow: none;
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-medium);
	cursor: pointer;
	transition: background-color var(--andr-transition-fast), border-color var(--andr-transition-fast), color var(--andr-transition-fast);
	flex-shrink: 0;
}

.andreani-detail__error-card-copy svg {
	width: 14px;
	height: 14px;
}

.andreani-detail__error-card-copy:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-detail__error-card-copy:focus {
	outline: none;
	box-shadow: none;
}

.andreani-detail__error-card-copy:focus-visible {
	outline: 2px solid var(--andr-color-border-focus);
	outline-offset: 2px;
}

.andreani-detail__error-card-copy.copied {
	background: var(--andr-color-success-subtle);
	border-color: var(--andr-color-success);
	color: var(--andr-color-success-strong);
}

/* Tabs Mensaje / Request dentro del error card */
.andreani-detail__error-tabs {
	background: var(--andr-color-surface);
	overflow: hidden;
}

.andreani-detail__error-tabs .andr-tabs__list {
	padding: 0 var(--andr-sp-2);
	background: var(--andr-color-surface-subtle);
	border-bottom: 1px solid var(--andr-color-error);
	gap: 0;
}

.andreani-detail__error-tabs .andr-tabs__item {
	padding: var(--andr-sp-2) var(--andr-sp-3);
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.andreani-detail__error-tabs .andr-tabs__item--active {
	color: var(--andr-color-error-strong);
	border-bottom-color: var(--andr-color-error);
}

.andreani-detail__error-tabs .andr-tabs__panel {
	padding: 0;
	position: relative;
	animation: none;
}

/* Texto del panel (ambos tabs) */
.andreani-detail__error-tab-text {
	margin: 0;
	padding: var(--andr-sp-3);
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
	line-height: 1.5;
	max-height: 200px;
	overflow: auto;
}

.andreani-detail__error-tab-text--message {
	color: var(--andr-color-error-strong);
	white-space: pre-wrap;
	word-break: break-word;
}

.andreani-detail__error-tab-text--code {
	color: var(--andr-color-text-strong);
	white-space: pre;
	word-break: normal;
}

/* Modal de error — el body del modal (.andr-modal__body) tiene padding por
   defecto que sobra acá: las tabs llenan todo el ancho y el padding interno
   del <pre> ya da el espacio. Sin esto, el padding genera scroll innecesario. */
.andreani-error-modal__body {
	padding: 0;
	overflow: hidden;
}

#andreani-error-modal .andreani-detail__error-tabs {
	border-radius: 0 0 var(--andr-radius-md) var(--andr-radius-md);
}

#andreani-error-modal .andreani-detail__error-tab-text {
	max-height: 320px;
}

/* Body card (al lado de productos, solo cuando hay error) */
.andreani-shipments-wrap .andreani-detail__body-card {
	display: flex;
	flex-direction: column;
	background: var(--andr-color-surface);
	border: 1px solid var(--andr-color-border);
	border-radius: var(--andr-radius-sm);
	overflow: hidden;
	min-width: 0;
}

.andreani-shipments-wrap .andreani-detail__body-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--andr-sp-2);
	padding: var(--andr-sp-2) var(--andr-sp-3);
	background: var(--andr-color-surface-subtle);
	border-bottom: 1px solid var(--andr-color-border);
}

.andreani-shipments-wrap .andreani-detail__body-card-title {
	font-size: var(--andr-text-xs);
	font-weight: var(--andr-fw-semibold);
	color: var(--andr-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.andreani-shipments-wrap .andreani-detail__body-card-copy {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	background: var(--andr-color-surface);
	border: 1px solid var(--andr-color-border-strong);
	border-radius: var(--andr-radius-xs);
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-muted);
	cursor: pointer;
	transition: all var(--andr-transition-fast);
}

.andreani-shipments-wrap .andreani-detail__body-card-copy svg {
	width: 12px;
	height: 12px;
}

.andreani-shipments-wrap .andreani-detail__body-card-copy:hover {
	background: var(--andr-color-brand-subtle);
	border-color: var(--andr-color-brand);
	color: var(--andr-color-brand);
}

.andreani-shipments-wrap .andreani-detail__body-card-copy.copied {
	background: var(--andr-color-success-subtle);
	border-color: var(--andr-color-success);
	color: var(--andr-color-success-strong);
}

.andreani-shipments-wrap .andreani-detail__body-card-content {
	margin: 0;
	padding: var(--andr-sp-3);
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
	line-height: 1.5;
	color: var(--andr-color-text-strong);
	max-height: 200px;
	overflow: auto;
	white-space: pre;
	word-break: normal;
}

@media (max-width: 1024px) {
	.andreani-shipments-wrap .andreani-detail__layout--has-error {
		grid-template-columns: 1fr;
	}
}

/* ----- "Vas a enviar" colapsable: chevron + summary + lista plana sutil -----
   Sin card, sin background. La lista de productos se muestra como texto sutil
   (cursiva, opacidad reducida) bajo el row Vas a enviar al expandir. */
.andreani-shipments-wrap .andreani-detail__shipment-toggle {
	display: block;
	width: 100%;
}

.andreani-shipments-wrap .andreani-detail__shipment-summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--andr-sp-1);
	cursor: pointer;
	user-select: none;
	list-style: none;
}

.andreani-shipments-wrap .andreani-detail__shipment-summary::-webkit-details-marker { display: none; }
.andreani-shipments-wrap .andreani-detail__shipment-summary::marker { content: ""; }

.andreani-shipments-wrap .andreani-detail__shipment-chevron {
	display: inline-flex;
	margin-left: 4px;
	vertical-align: middle;
}

.andreani-shipments-wrap .andreani-detail__shipment-chevron svg {
	width: 10px;
	height: 10px;
	color: var(--andr-color-text-muted);
	transition: transform var(--andr-transition-base);
}

.andreani-shipments-wrap .andreani-detail__shipment-toggle[open] .andreani-detail__shipment-chevron svg {
	transform: rotate(180deg);
}

.andreani-shipments-wrap .andreani-detail__shipment-value,
.andreani-shipments-wrap .andreani-detail__shipment-weight {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* ID Orden / Seguimiento: span clickeable para copiar, sin styling de chip
 * (más limpio que el <code> con background). Mantiene la funcionalidad de
 * andreani-copy-click que vive en admin.js. */
.andreani-shipments-wrap .andreani-detail__copyable {
	font-family: var(--andr-font-mono);
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-strong);
	cursor: pointer;
	transition: color var(--andr-transition-fast);
}

.andreani-shipments-wrap .andreani-detail__copyable:hover {
	color: var(--andr-color-brand);
}

.andreani-shipments-wrap .andreani-detail__copyable.copied {
	color: var(--andr-color-success-strong);
}

/* Estado en el detalle: ícono + texto sin pill background. */
.andreani-shipments-wrap .andreani-detail__status-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--andr-color-text-strong);
}

.andreani-shipments-wrap .andreani-detail__status-text svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	color: var(--andr-color-text-muted);
}

.andreani-shipments-wrap .andreani-detail__status-line {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

/* Estado de pago Pyme: el ícono de tarjeta toma color del estado para que se
 * lea de un vistazo (pendiente warning, pagado success). */
.andreani-shipments-wrap .andreani-detail__status-text--payment-pending svg {
	color: var(--andr-color-warning-strong);
}

.andreani-shipments-wrap .andreani-detail__status-text--payment-paid svg {
	color: var(--andr-color-success-strong);
}

.andreani-shipments-wrap .andreani-detail__shipment-count {
	color: var(--andr-color-text-muted);
	font-size: var(--andr-text-xs);
	font-style: italic;
}

.andreani-shipments-wrap .andreani-detail__shipment-products {
	list-style: none;
	margin: var(--andr-sp-2) 0 0;
	padding: 0 0 0 var(--andr-sp-4);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.andreani-shipments-wrap .andreani-detail__shipment-products li {
	display: flex;
	align-items: baseline;
	gap: var(--andr-sp-1);
	font-size: var(--andr-text-xs);
	color: var(--andr-color-text-subtle);
	font-style: italic;
	opacity: 0.8;
	flex-wrap: wrap;
}

.andreani-shipments-wrap .andreani-detail__shipment-product-qty {
	flex-shrink: 0;
	font-weight: var(--andr-fw-medium);
	color: var(--andr-color-text-muted);
}

.andreani-shipments-wrap .andreani-detail__shipment-product-name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.andreani-shipments-wrap .andreani-detail__shipment-product-price {
	font-variant-numeric: tabular-nums;
	color: var(--andr-color-text-muted);
}

.andreani-shipments-wrap .andreani-detail__shipment-product-price::before {
	content: "—";
	margin-right: var(--andr-sp-1);
	color: var(--andr-color-text-disabled);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
	.andreani-shipments-wrap .andreani-detail {
		padding: var(--andr-sp-3);
	}

	.andreani-shipments-wrap .andreani-detail__row {
		grid-template-columns: 1fr;
		gap: var(--andr-sp-1);
	}

	.andreani-shipments-wrap .andreani-detail__highlights {
		gap: var(--andr-sp-2);
		font-size: var(--andr-text-xs);
	}
}
