/* ── Buttons (Metronic's kt-btn variants: outline is the base, then the variants, the sizes, the states). The base
   comes first (0.45.6: it sat in chrome.css after this file, so the later single-class base overrode every variant
   and size); the pieces are the utilities of utilities.css (0.29.0), so an alias can take them too. ──────── */
.rooster-admin-button {
	@apply ra-button;
	margin: 0;
}

.rooster-admin-button:hover {
	@apply bg-muted;
}

.rooster-admin-button--primary {
	@apply ra-button-primary;
}

.rooster-admin-button--primary:hover {
	border-color: color-mix(in srgb, var(--ra-accent) 88%, black);
	background: color-mix(in srgb, var(--ra-accent) 88%, black);
	color: var(--ra-accent-on);
}

.rooster-admin-button--ghost {
	@apply ra-button-ghost;
}

/* On any ground (a white card, a muted bar), the ghost's hover is a tint of the text, not the muted fill (0.54.2). */
.rooster-admin-button--ghost:hover {
	background: color-mix(in srgb, var(--ra-foreground) 7%, transparent);
	color: var(--ra-foreground);
}

.rooster-admin-button--lg {
	@apply ra-button-lg;
}

/* The variants and sizes, after the base. */
.rooster-admin-button--secondary {
	@apply ra-button-secondary;

	@variant hover {
		background: color-mix(in srgb, var(--ra-muted) 70%, var(--ra-foreground) 8%);
	}
}

.rooster-admin-button--destructive {
	@apply ra-button-destructive;

	@variant hover {
		border-color: color-mix(in srgb, var(--ra-destructive) 85%, black);
		background: color-mix(in srgb, var(--ra-destructive) 85%, black);
		color: white;
	}
}

.rooster-admin-button--mono {
	@apply ra-button-mono;

	@variant hover {
		@apply border-foreground bg-foreground text-background opacity-90;
	}
}

.rooster-admin-button--sm {
	@apply ra-button-sm;
}

.rooster-admin-button--block {
	@apply ra-button-block;
}

.rooster-admin-button--icon {
	@apply min-w-8 px-0;
}

.rooster-admin-button--icon.rooster-admin-button--sm {
	@apply min-w-7;
}

.rooster-admin-button:disabled,
.rooster-admin-button[aria-disabled="true"] {
	@apply pointer-events-none opacity-50;
}

/* A link button keeps its own ink on focus, not core's blue (a:focus, 0,1,1): each variant's ink again, since a plain
   `inherit` here outranked the variants (0.77.3: a clicked primary button kept the focus and took its card footer's
   grey on the blue fill, Rooster One's "Save needs for this product", the owner, 4 Nov 2026). */
.rooster-admin-button:focus {
	color: var(--ra-foreground);
}

.rooster-admin-button--primary:focus {
	color: var(--ra-accent-on);
}

.rooster-admin-button--ghost:focus:not(:hover) {
	color: var(--ra-secondary-foreground);
}

.rooster-admin-button--destructive:focus {
	color: white;
}

.rooster-admin-button--mono:focus {
	color: var(--ra-background);
}

.rooster-admin-button:focus-visible {
	@apply ra-ring;
}

/* A button that is on: it toggles (aria-pressed) or its menu or panel is open (aria-expanded), in the accent (0.46.5:
   the LMS tables' Compact rows and Columns, a side panel's toggle). */
.rooster-admin-button:is([aria-pressed="true"], [aria-expanded="true"]) {
	@apply border-accent;
	color: var(--ra-accent);
	background: color-mix(in srgb, var(--ra-accent) 8%, var(--ra-background));
}

/* A button whose action is done for its record (0.77.1, Rooster One's order documents: a packing slip printed, an
   invoice issued): the success colours and the kit's check after the label, so its icon still names the action and a
   script marks one done with the class alone. It stays a button: the action runs again. */
.rooster-admin-button.is-done {
	@apply border-success bg-success-soft text-success-foreground;
}

.rooster-admin-button.is-done:hover {
	background: color-mix(in srgb, var(--ra-success) 14%, var(--ra-success-soft));
	color: var(--ra-success-foreground);
}

.rooster-admin-button.is-done::after {
	@apply size-4 shrink-0 bg-current;
	content: "";
	mask: var(--ra-check) center / 100% 100% no-repeat;
}
