/**
 * Vacuum Image Optimizer — Admin Foundation
 * ChatBubble Design System
 */

:root {
	--vacimg-primary: #22C55E;
	--vacimg-primary-dark: #16A34A;
	--vacimg-secondary: #3B82F6;
	--vacimg-tertiary: #A855F7;
	--vacimg-surface: #F3F4F6;
	--vacimg-background: #FFFFFF;
	--vacimg-success: #22C55E;
	--vacimg-warning: #F59E0B;
	--vacimg-error: #EF4444;
	--vacimg-info: #3B82F6;
	--vacimg-text: #111827;
	--vacimg-muted: #6B7280;
	--vacimg-border: #E5E7EB;
	--vacimg-radius: 20px;
	--vacimg-radius-small: 14px;
	--vacimg-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
}

.vacimg-admin {
	max-width: 1180px;
	margin-top: 24px;
	color: var(--vacimg-text);
}

.vacimg-page-header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}

.vacimg-page-header__logo {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
}

.vacimg-page-header__text {
	min-width: 0;
}

.vacimg-page-title {
	margin: 0 0 8px;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
}

.vacimg-page-description {
	max-width: 760px;
	margin: 0;
	color: var(--vacimg-muted);
	font-size: 14px;
}

.vacimg-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px;
	margin: 0 0 24px;
	background: var(--vacimg-surface);
	border-radius: var(--vacimg-radius);
}

.vacimg-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 16px;
	border-radius: var(--vacimg-radius-small);
	color: var(--vacimg-text);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease;
}

.vacimg-tab:hover,
.vacimg-tab:focus {
	background: var(--vacimg-background);
	color: var(--vacimg-secondary);
	box-shadow: none;
}

.vacimg-tab.is-active {
	background: var(--vacimg-primary);
	color: #FFFFFF;
}

.vacimg-tab-content {
	padding-bottom: 32px;
}

.vacimg-card,
.vacimg-stat-card {
	background: var(--vacimg-background);
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius);
	box-shadow: var(--vacimg-shadow);
}

.vacimg-card {
	padding: 24px;
	margin-bottom: 24px;
}

.vacimg-card h2 {
	margin: 0 0 12px;
	font-size: 19px;
	line-height: 1.35;
}

.vacimg-card p {
	margin: 0 0 16px;
	color: var(--vacimg-muted);
	font-size: 14px;
	line-height: 1.65;
}

.vacimg-card p:last-child {
	margin-bottom: 0;
}

.vacimg-stats-grid,
.vacimg-cards-row {
	display: grid;
	gap: 20px;
}

.vacimg-stats-grid {
	grid-template-columns: repeat(6, minmax(0, 1fr));
	margin-bottom: 20px;
}

.vacimg-cards-row {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vacimg-stat-card {
	padding: 24px;
}

.vacimg-stat-number {
	display: block;
	margin-bottom: 8px;
	color: var(--vacimg-primary);
	font-size: 34px;
	font-weight: 800;
	line-height: 1;
}

.vacimg-stat-label {
	display: block;
	color: var(--vacimg-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vacimg-stat-number--text {
	font-size: 24px;
	line-height: 1.2;
}

.vacimg-quick-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vacimg-quick-links li + li {
	margin-top: 10px;
}

.vacimg-quick-links a {
	color: var(--vacimg-secondary);
	font-weight: 600;
	text-decoration: none;
}

.vacimg-quick-links a:hover,
.vacimg-quick-links a:focus {
	text-decoration: underline;
}

.vacimg-health-list,
.vacimg-pipeline {
	margin: 0;
	padding: 0;
}

.vacimg-health-list {
	list-style: none;
}

.vacimg-health-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 40px;
	font-weight: 700;
}

.vacimg-health-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	font-weight: 800;
}

.vacimg-health-list .is-pass .vacimg-health-icon {
	background: rgba(34, 197, 94, 0.12);
	color: var(--vacimg-success);
}

.vacimg-health-list .is-fail .vacimg-health-icon {
	background: rgba(239, 68, 68, 0.12);
	color: var(--vacimg-error);
}

.vacimg-pipeline {
	display: grid;
	gap: 10px;
	list-style-position: inside;
	counter-reset: vacimg-pipeline;
}

.vacimg-pipeline li {
	padding: 12px 14px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
	font-weight: 700;
}

.vacimg-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: var(--vacimg-radius-small);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.vacimg-button--primary {
	background: var(--vacimg-primary);
	color: #FFFFFF;
}

.vacimg-button--primary:hover,
.vacimg-button--primary:focus {
	background: var(--vacimg-primary-dark);
	color: #FFFFFF;
}

.vacimg-button--secondary {
	background: var(--vacimg-surface);
	border-color: var(--vacimg-border);
	color: var(--vacimg-text);
}

.vacimg-button--small {
	min-height: 32px;
	padding: 4px 10px;
	font-size: 12px;
}

.vacimg-button:disabled {
	cursor: wait;
	opacity: 0.6;
}

.vacimg-button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.vacimg-card-header-inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.vacimg-card-header-inline h2 {
	margin-bottom: 0;
}

.vacimg-notice {
	margin-bottom: 16px;
	padding: 12px 14px;
	border-radius: var(--vacimg-radius-small);
	font-weight: 700;
}

.vacimg-notice--success {
	background: rgba(34, 197, 94, 0.12);
	color: var(--vacimg-success);
}

.vacimg-notice--error {
	background: rgba(239, 68, 68, 0.12);
	color: var(--vacimg-error);
}

.vacimg-notice--info {
	background: rgba(59, 130, 246, 0.12);
	color: var(--vacimg-info);
}

.vacimg-queue-stats {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.vacimg-queue-stat {
	padding: 16px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
}

.vacimg-queue-stat__number,
.vacimg-queue-stat__label {
	display: block;
}

.vacimg-queue-stat__number {
	margin-bottom: 6px;
	color: var(--vacimg-primary);
	font-size: 24px;
	font-weight: 800;
}

.vacimg-queue-stat__label {
	color: var(--vacimg-muted);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vacimg-progress {
	height: 22px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--vacimg-surface);
}

.vacimg-progress__bar {
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--vacimg-primary), var(--vacimg-secondary));
	transition: width 240ms ease;
}

.vacimg-progress-label {
	margin-top: 10px;
	text-align: right;
}

.vacimg-table-wrap {
	overflow-x: auto;
}

.vacimg-failed-jobs td,
.vacimg-failed-jobs th {
	vertical-align: middle;
}

.vacimg-empty-row td {
	color: var(--vacimg-muted);
	font-style: italic;
}

.vacimg-form-table th,
.vacimg-form-table td {
	padding-top: 16px;
	padding-bottom: 16px;
}

.vacimg-toggle {
	position: relative;
	display: inline-flex;
	width: 52px;
	height: 30px;
}

.vacimg-toggle input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
	min-height: 0;
	background: transparent;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	opacity: 0 !important;
	cursor: pointer;
	z-index: 3;
}

.vacimg-toggle input::before,
.vacimg-toggle input::after {
	content: none !important;
}

.vacimg-toggle__slider {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	border-radius: 999px;
	background: var(--vacimg-border);
}

.vacimg-toggle__slider::before {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #FFFFFF;
	content: "";
	transition: transform 160ms ease;
}

.vacimg-toggle input:checked + .vacimg-toggle__slider {
	background: var(--vacimg-primary);
}

.vacimg-toggle input:checked + .vacimg-toggle__slider::before {
	transform: translateX(22px);
}

.vacimg-toggle input:focus-visible + .vacimg-toggle__slider {
	outline: 2px solid var(--vacimg-primary);
	outline-offset: 2px;
}

.vacimg-toggle input:disabled {
	cursor: not-allowed;
}

.vacimg-toggle input:disabled + .vacimg-toggle__slider {
	opacity: 0.6;
}

.vacimg-profile-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.vacimg-profile-card {
	min-height: 44px;
	padding: 16px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius);
	background: var(--vacimg-surface);
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease;
}

.vacimg-profile-card.is-active {
	border-color: var(--vacimg-primary);
	background: rgba(34, 197, 94, 0.08);
}

.vacimg-profile-card input {
	display: none;
}

.vacimg-quality-control {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 420px;
}

.vacimg-quality-control input[type="range"] {
	width: 100%;
}

.vacimg-quality-control strong {
	min-width: 52px;
	color: var(--vacimg-primary);
	font-size: 16px;
}

.vacimg-profile-card__title,
.vacimg-profile-card__desc {
	display: block;
}

.vacimg-profile-card__title {
	margin-bottom: 6px;
	font-weight: 800;
}

.vacimg-profile-card__desc {
	color: var(--vacimg-muted);
	font-size: 13px;
}

.vacimg-radio-group {
	display: grid;
	gap: 6px;
	margin-top: 14px;
}

.vacimg-radio-group label {
	font-weight: 700;
}

.vacimg-radio-group .description {
	margin: 0 0 8px 24px;
}

.vacimg-status-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vacimg-status-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding: 10px 0;
	border-bottom: 1px solid var(--vacimg-border);
}

.vacimg-status-list li:last-child {
	border-bottom: 0;
}

.vacimg-status-label {
	font-weight: 700;
}

.vacimg-status-value {
	margin-left: auto;
	color: var(--vacimg-muted);
	font-weight: 600;
}

.vacimg-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vacimg-badge--success {
	background: rgba(34, 197, 94, 0.12);
	color: var(--vacimg-success);
}

.vacimg-badge--error {
	background: rgba(239, 68, 68, 0.12);
	color: var(--vacimg-error);
}

.vacimg-badge--warning {
	background: rgba(234, 179, 8, 0.14);
	color: #854d0e;
}

.vacimg-debug-info {
	box-sizing: border-box;
	width: 100%;
	padding: 14px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	font-size: 12px;
	line-height: 1.6;
}

.vacimg-activity-list {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.vacimg-activity-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--vacimg-border);
}

.vacimg-activity-list li:last-child {
	border-bottom: 0;
}

.vacimg-activity-list span {
	font-weight: 700;
}

.vacimg-activity-list small {
	color: var(--vacimg-muted);
}

.wp-list-table .column-vacimg_image_optimizer {
	width: 190px;
	max-width: 190px;
	white-space: normal;
	word-break: normal;
	overflow-wrap: normal;
}

.vacimg-media-status {
	font-size: 12px;
	line-height: 1.45;
	white-space: normal;
	word-break: normal;
	overflow-wrap: normal;
}

.vacimg-media-status__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.vacimg-media-status strong {
	font-weight: 600;
}

.vacimg-media-status span {
	color: #50575E;
	text-align: right;
}

.vacimg-media-message {
	margin-top: 4px;
	color: #B45309;
}

/* Dashboard UI polish (Phase 7.6) */
.vacimg-dashboard-hero {
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 28px;
	margin-bottom: 28px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius);
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(59, 130, 246, 0.08));
}

.vacimg-dashboard-hero__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.vacimg-dashboard-hero__content {
	flex: 1 1 320px;
	min-width: 0;
}

.vacimg-dashboard-hero__head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 12px;
}

.vacimg-dashboard-hero__logo {
	flex: 0 0 auto;
	width: clamp(36px, 7vw, 56px);
	height: auto;
}

.vacimg-dashboard-hero__title {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: clamp(28px, 4.5vw, 44px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.vacimg-dashboard-hero__lead {
	max-width: 800px;
	margin: 0 0 14px;
	color: var(--vacimg-muted);
	font-size: 15px;
	line-height: 1.65;
}

.vacimg-dashboard-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.vacimg-dashboard-hero__actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 10px;
}

.vacimg-daily-quote {
	margin: 0;
	padding: 18px 20px;
	border: 1px solid var(--vacimg-border);
	border-left: 4px solid var(--vacimg-tertiary);
	border-radius: var(--vacimg-radius);
	background: var(--vacimg-background);
}

.vacimg-daily-quote__eyebrow {
	margin: 0 0 8px;
	color: var(--vacimg-tertiary);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.vacimg-daily-quote__text {
	margin: 0 0 8px;
	max-width: 800px;
	color: var(--vacimg-text);
	font-size: 16px;
	font-style: italic;
	line-height: 1.5;
	quotes: "\201C" "\201D";
}

.vacimg-daily-quote__text::before {
	content: open-quote;
}

.vacimg-daily-quote__text::after {
	content: close-quote;
}

.vacimg-daily-quote__author {
	color: var(--vacimg-muted);
	font-size: 13px;
	font-style: normal;
	font-weight: 700;
}

.vacimg-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid var(--vacimg-border);
	border-radius: 999px;
	background: var(--vacimg-background);
	color: var(--vacimg-muted);
	font-size: 12px;
	font-weight: 700;
}

.vacimg-status-pill strong {
	color: var(--vacimg-text);
}

.vacimg-dashboard-section {
	margin-bottom: 28px;
}

.vacimg-dashboard-section:last-child {
	margin-bottom: 0;
}

.vacimg-dashboard-section-header {
	margin-bottom: 14px;
}

.vacimg-dashboard-section-header h2 {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 800;
}

.vacimg-dashboard-section-header p {
	margin: 0;
	color: var(--vacimg-muted);
	font-size: 13px;
}

.vacimg-kpi-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.vacimg-dashboard .vacimg-card h3 {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
}

.vacimg-dashboard .vacimg-card h4 {
	margin: 18px 0 8px;
	color: var(--vacimg-muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vacimg-empty-state {
	margin: 0;
	padding: 16px;
	border: 1px dashed var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
	color: var(--vacimg-muted);
	font-size: 13px;
	text-align: center;
}

.vacimg-quick-actions {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.vacimg-quick-actions .vacimg-button {
	width: 100%;
}

/* Reports tab (Phase 8.1) */
.vacimg-reports-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.vacimg-kpi-grid--wide {
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.vacimg-distribution-row + .vacimg-distribution-row {
	margin-top: 16px;
}

.vacimg-distribution-row__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.vacimg-report-table {
	min-width: 600px;
	margin: 0;
}

.vacimg-report-table th {
	text-align: left;
}

@media screen and (max-width: 960px) {
	.vacimg-cards-row,
	.vacimg-profile-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vacimg-stats-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.vacimg-kpi-grid,
	.vacimg-quick-actions {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vacimg-queue-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 640px) {
	.vacimg-stats-grid,
	.vacimg-cards-row,
	.vacimg-profile-cards,
	.vacimg-kpi-grid,
	.vacimg-quick-actions {
		grid-template-columns: 1fr;
	}

	.vacimg-dashboard-hero__actions {
		width: 100%;
	}

	.vacimg-dashboard-hero__actions .vacimg-button {
		flex: 1 1 auto;
	}

	.vacimg-tab {
		width: 100%;
	}

	.vacimg-status-list li {
		align-items: flex-start;
		flex-direction: column;
	}

	.vacimg-status-value {
		margin-left: 0;
	}

	.vacimg-queue-stats {
		grid-template-columns: 1fr;
	}

	.vacimg-card-header-inline,
	.vacimg-activity-list li {
		align-items: flex-start;
		flex-direction: column;
	}
}

/* Format Generation (WebP & AVIF) status panel */
.vacimg-format-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.vacimg-format-card {
	margin: 0;
}

.vacimg-format-card h3 {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 800;
}

.vacimg-format-workflow {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: vacimg-format-step;
}

.vacimg-format-step {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	flex: 1 1 140px;
	min-height: 44px;
	padding: 12px 14px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
}

.vacimg-format-step__name {
	font-weight: 700;
}

.vacimg-wizard-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.vacimg-wizard-grid section {
	padding: 16px;
	border: 1px solid var(--vacimg-border);
	border-radius: var(--vacimg-radius-small);
	background: var(--vacimg-surface);
}

.vacimg-wizard-grid h3 {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 800;
}

.vacimg-wizard-grid label {
	display: block;
	margin: 8px 0;
	font-weight: 600;
}

.vacimg-wizard-grid input[type="number"] {
	max-width: 110px;
	margin-left: 8px;
}

.vacimg-media-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.vacimg-media-action {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 2px 8px;
	border: 1px solid var(--vacimg-border);
	border-radius: 6px;
	background: var(--vacimg-surface);
	color: var(--vacimg-secondary);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.vacimg-media-action:hover,
.vacimg-media-action:focus {
	border-color: var(--vacimg-secondary);
	color: var(--vacimg-secondary);
	box-shadow: none;
}

@media (max-width: 782px) {
	.vacimg-wizard-grid {
		grid-template-columns: 1fr;
	}
}
