/*
 * PIXVA v12 — admin & portal design system.
 *
 * Loaded after staff-admin-v10.css and admin-motion-v11.css on every pixva-*
 * screen, and after the portal's inline stylesheet on /technician-portal/.
 *
 * It does not introduce a new look. It restates the decisions the screens
 * already make — spacing, radii, control sizes, status colours, focus states —
 * in one token block, then closes the gaps that were handled ad hoc per screen:
 *
 *   1. tokens            one source for spacing, radii, elevation, status hues
 *   2. focus & targets   a visible ring everywhere, 40px minimum tap targets
 *   3. control sizes     inputs, selects and buttons share one height
 *   4. status language   one badge family, readable at a glance in a dense table
 *   5. responsive        filters, actions and pagers reflow instead of overflowing
 *   6. print             a screen full of panels becomes a clean document
 */

/* ============================================================ 1. tokens = */

.px10-admin,
.px10-portal {
	--px12-space-1: 4px;
	--px12-space-2: 8px;
	--px12-space-3: 12px;
	--px12-space-4: 16px;
	--px12-space-5: 20px;
	--px12-space-6: 24px;
	--px12-space-8: 32px;

	--px12-radius-sm: 8px;
	--px12-radius-md: 12px;
	--px12-radius-lg: 16px;
	--px12-radius-pill: 999px;

	--px12-line: #dfe8ec;
	--px12-line-soft: #eef4f6;
	--px12-ink: #17252b;
	--px12-body: #40545e;
	--px12-muted: #7b93a0;

	--px12-brand: #0b5b78;
	--px12-brand-hover: #084a63;
	--px12-accent: #16736d;

	--px12-ok: #19734c;
	--px12-ok-bg: #e7f4ed;
	--px12-warn: #8a5a0b;
	--px12-warn-bg: #fdf3e2;
	--px12-bad: #b42318;
	--px12-bad-bg: #fdecea;
	--px12-info: #0b5b78;
	--px12-info-bg: #eaf4f8;

	--px12-control-h: 38px;
	--px12-ease: cubic-bezier(.2, .7, .3, 1);
	--px12-dur: 160ms;
}

/* =================================================== 2. focus & targets = */

/*
 * WordPress ships a focus ring for the admin chrome; plugin screens need the
 * same promise on their own controls, otherwise keyboard users lose their place
 * the moment they tab into a pixva panel.
 */
.px10-admin a:focus-visible,
.px10-admin button:focus-visible,
.px10-admin input:focus-visible,
.px10-admin select:focus-visible,
.px10-admin textarea:focus-visible,
.px10-admin summary:focus-visible,
.px10-portal a:focus-visible,
.px10-portal button:focus-visible,
.px10-portal input:focus-visible,
.px10-portal select:focus-visible,
.px10-portal textarea:focus-visible,
.px10-portal summary:focus-visible {
	outline: 2px solid var(--px12-brand);
	outline-offset: 2px;
	border-radius: var(--px12-radius-sm);
}

/* Enough room to hit with a thumb without making the desktop view clumsy. */
.px10-btn,
.px10-admin .button,
.px10-filter .button,
.px10-pager a,
.px10-pager span {
	min-height: var(--px12-control-h);
}

/* =================================================== 3. control sizes == */

.px10-admin input[type='text'],
.px10-admin input[type='email'],
.px10-admin input[type='search'],
.px10-admin input[type='number'],
.px10-admin input[type='date'],
.px10-admin input[type='tel'],
.px10-admin input[type='url'],
.px10-admin select,
.px10-admin textarea,
.px10-portal input[type='text'],
.px10-portal input[type='email'],
.px10-portal input[type='search'],
.px10-portal input[type='number'],
.px10-portal input[type='date'],
.px10-portal select,
.px10-portal textarea {
	max-width: 100%;
	border: 1px solid var(--px12-line);
	border-radius: var(--px12-radius-sm);
	background: #fff;
	color: var(--px12-ink);
	transition: border-color var(--px12-dur) var(--px12-ease),
	            box-shadow var(--px12-dur) var(--px12-ease);
}

.px10-admin input:not([type='checkbox']):not([type='radio']):not([type='submit']):hover,
.px10-admin select:hover,
.px10-admin textarea:hover,
.px10-portal select:hover,
.px10-portal textarea:hover {
	border-color: #b7cdd6;
}

.px10-admin input:not([type='checkbox']):not([type='radio']):not([type='submit']):focus,
.px10-admin select:focus,
.px10-admin textarea:focus,
.px10-portal select:focus,
.px10-portal textarea:focus {
	border-color: var(--px12-brand);
	box-shadow: 0 0 0 3px rgba(11, 91, 120, .22);
	outline: none;
}

/* A read-only box whose only job is to be copied from. Textareas keep line
   breaks as line breaks, which a rendered <br> does not guarantee. */
.px10-copy {
	width: 100%;
	min-width: 13rem;
	padding: 8px 10px;
	border: 1px dashed var(--px12-line);
	border-radius: var(--px12-radius-sm);
	background: #f7fafc;
	color: var(--px12-ink);
	font-family: inherit;
	font-size: 13px;
	line-height: 1.9;
	resize: vertical;
}

/* ==================================================== 4. status badges = */

/*
 * One family: a pill, one hue per meaning, and a background light enough that
 * dark text stays readable. Nothing here relies on colour alone — every badge
 * also carries its meaning in words.
 */
.px10-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--px12-space-1);
	padding: 3px 10px;
	border-radius: var(--px12-radius-pill);
	background: #eef4f6;
	color: #5d7c8b;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.7;
	white-space: nowrap;
}

.px10-badge-ok    { background: var(--px12-ok-bg);   color: var(--px12-ok); }
.px10-badge-warn  { background: var(--px12-warn-bg); color: var(--px12-warn); }
.px10-badge-bad   { background: var(--px12-bad-bg);  color: var(--px12-bad); }
.px10-badge-info  { background: var(--px12-info-bg); color: var(--px12-info); }
.px10-badge-none  { background: #f1f4f5; color: #8199a6; }
.px10-badge-revoked { background: #f1f4f5; color: #8199a6; text-decoration: line-through; }

/* A dot before the label, so meaning survives greyscale printing. */
.px10-badge-ok::before,
.px10-badge-warn::before,
.px10-badge-bad::before,
.px10-badge-info::before {
	content: '';
	inline-size: 6px;
	block-size: 6px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

/* ========================================================== 5. buttons = */

/* One filled action per screen; the rest are ghost or danger. */
.px10-btn {
	transition: background-color var(--px12-dur) var(--px12-ease),
	            border-color var(--px12-dur) var(--px12-ease),
	            color var(--px12-dur) var(--px12-ease),
	            transform var(--px12-dur) var(--px12-ease);
}

.px10-btn:hover { transform: translateY(-1px); }
.px10-btn:active { transform: translateY(0); }

.px10-btn[aria-disabled='true'],
.px10-btn:disabled { opacity: .55; pointer-events: none; transform: none; }

.px10-btn-small { min-height: 32px; }

@media (prefers-reduced-motion: reduce) {
	.px10-btn:hover { transform: none; }
}

/* ================================================== 6. tables & panels = */

.px10-panel {
	border: 1px solid var(--px12-line);
	border-radius: var(--px12-radius-lg);
	background: #fff;
	overflow: hidden;
}

.px10-panel-body { padding: var(--px12-space-5); }

.px10-panel-head h2 { letter-spacing: -.008em; }

.px10-panel-hint { color: var(--px12-muted); font-size: 12px; line-height: 1.9; }

.px10-empty {
	border: 1px dashed var(--px12-line);
	border-radius: var(--px12-radius-md);
	background: #fbfdfd;
	text-align: center;
}

.px10-empty-title { color: var(--px12-ink); font-weight: 800; }
.px10-empty p { color: var(--px12-muted); }

/* A dense table must not force the whole page sideways. */
.px10-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.px10-table.widefat > tbody > tr > td,
.px10-table.widefat > thead > tr > th {
	vertical-align: middle;
}

/* ====================================================== 7. responsive == */

@media (max-width: 782px) {
	/* Filters and action rows stack instead of squeezing side by side. */
	.px10-filter,
	.px10-head-row,
	.px10-form-actions,
	.px10-inline-row {
		flex-direction: column;
		align-items: stretch;
	}

	.px10-filter > *,
	.px10-form-actions > * {
		inline-size: 100%;
	}

	/* The portal's filter fields carry a 180px floor that a 320px phone
	   cannot honour; let them shrink and fill the row instead. */
	.px10-filter input,
	.px10-filter select {
		min-width: 0;
		inline-size: 100%;
	}

	.px10-actions .px10-btn,
	.px10-actions .button {
		flex: 1 1 auto;
		justify-content: center;
	}

	/* A pager with many pages wraps rather than clipping. */
	.px10-pager {
		flex-wrap: wrap;
		gap: var(--px12-space-2);
	}

	.px10-panel-body { padding: var(--px12-space-4); }

	.px10-bento { gap: var(--px12-space-3); }

	.px10-bento__item { padding: var(--px12-space-4); border-radius: var(--px12-radius-md); }

	/* The hero number is the point of the dashboard; keep it prominent. */
	.px10-bento__item--hero .px10-bento__value { font-size: clamp(34px, 13vw, 46px); }
}

@media (max-width: 480px) {
	.px10-head-row { gap: var(--px12-space-3); }
	.px10-crumbs { font-size: 11px; }
}

/* ============================================================ 8. print = */

@media print {
	.px10-admin, .px10-portal { --px12-line: #b9c6cc; }

	.px10-side,
	.px10-actions,
	.px10-pager,
	.px10-filter,
	.px10-logout { display: none !important; }

	.px10-app { display: block; }
	.px10-main { padding: 0; }

	.px10-panel,
	.px10-table-wrap { border: 0; }

	.px10-panel { break-inside: avoid; margin-bottom: 12px; }

	.px10-bento { display: block; }
	.px10-bento__item { break-inside: avoid; margin-bottom: 8px; }
	.px10-bento__item--accent { background: #fff !important; color: #000 !important; }
	.px10-bento__item--accent .px10-bento__label,
	.px10-bento__item--accent .px10-bento__hint,
	.px10-bento__item--accent .px10-bento__value,
	.px10-bento__item--accent .px10-bento__link { color: #000 !important; }
}
