/* ============================================================
   SISU COMMON — site-wide utilities & reusable plugin patterns
   ------------------------------------------------------------
   Loaded on every front-end page. Contains every CSS pattern
   that is shared by more than one module, so individual module
   CSS files only hold module-specific rules.

   COLOURS: never write a hex colour in plugin CSS — use the
   variables (var(--sisu-primary), --sisu-text, --sisu-border,
   --sisu-warning-bg …). They are printed on :root by
   \Sisu\Colors (includes/class-colors.php), which reads the
   theme Customizer colours and falls back to plugin defaults.

   Sections in this file:
     1.  Pager (back-to-top + generic page buttons)
     2.  Spinner @keyframes (sisu-spin)
     3.  Modal pattern (base + overlay + container + parts)
     4.  Status pill (.sisu-status — canonical pill system)
     5.  Notification dot (.sisu-badge — header icon counter)
     6.  Inline tag pill (.sisu-tag — text-flow pill)
     7.  Generic card (.sisu-card)
     8.  Toast / inline notice (.sisu-toast)
     9.  Form row 2-column (.sisu-form__row)
     10. Tooltip (.sisu-tooltip)
     11. Language selector (.sisu-lang-select)
     12. Browse layout + filter form (.sisu-browse, .sisu-filter-form)
     13. Page header / title small (.sisu-page__header)
     14. Table (.sisu-table)
     15. Table filters (.sisu-table-filters)
     16. Table pagination (.sisu-table-pagination)
     17. Stat card (.sisu-stat-card, .sisu-stat-grid)

   IMPORTANT: only use the theme's brand CSS variables
   (--sisu-primary, --sisu-border, --sisu-text, …). No hard-coded
   brand colors. Fallbacks are intentionally neutral, NOT colored,
   so we never paint over the brand.
   ============================================================ */


/* ─────────────────────────────────────────
   1. PAGER  (back-to-top + generic page UI)
   ───────────────────────────────────────── */

.sisu-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin-top: 16px;
}

.sisu-pager__btn {
	background: transparent;
	border: 1px solid var(--sisu-border);
	color: var(--sisu-text);
	padding: 4px 10px;
	min-width: 32px;
	border-radius: 6px;
	font: inherit;
	font-size: .9em;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.sisu-pager__btn:hover:not(:disabled) {
	background: var(--sisu-bg-light);
	border-color: var(--sisu-primary);
	color: var(--sisu-primary);
}

.sisu-pager__btn.is-active {
	background: var(--sisu-primary);
	border-color: var(--sisu-primary);
	color: #fff;
	font-weight: 600;
}

.sisu-pager__btn:disabled {
	opacity: .4;
	cursor: default;
}

/* Back to top (mobile only) — always inserted by JS. */
.sisu-back-to-top {
	display: none;
}

@media (max-width: 768px) {
	.sisu-back-to-top {
		display: flex;
		position: fixed;
		bottom: 16px;
		right: 16px;
		width: 44px;
		height: 44px;
		align-items: center;
		justify-content: center;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--sisu-primary);
		color: #fff;
		box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity .2s ease, transform .2s ease, visibility .2s;
		cursor: pointer;
		z-index: 9999;
	}

	.sisu-back-to-top:hover {
		background: var(--sisu-primary-dark);
	}

	.sisu-back-to-top.is-visible {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}


/* ─────────────────────────────────────────
   2. SPINNER  (shared keyframes)
   Used by salary-guide, vies (checkout), and any future loader.
   ───────────────────────────────────────── */

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

/* Button loading state — add `.is-loading` to any button (or let the global
   sisu-common.js do it on submit) to show a spinner and block extra clicks.
   Reused by every save/submit button across the marketplace. */
.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
	cursor: default;
}
.is-loading > * { visibility: hidden; }
.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1em;
	height: 1em;
	margin: -0.5em 0 0 -0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	color: #fff;
	visibility: visible;
	animation: sisu-spin 0.7s linear infinite;
}


/* ─────────────────────────────────────────
   3. MODAL  (base pattern)
   Hidden by default. JS toggles `.sisu-modal--open` to show.
   Children: __overlay (dimmed backdrop), __container (dialog box),
             __close, __title, __footer, __actions, __messages.
   ───────────────────────────────────────── */

.sisu-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1100;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sisu-modal--open {
	display: flex;
}

/* Variant for long-content modals (e.g. the contract form) — scrolls inside the viewport */
.sisu-modal--scrollable {
	align-items: flex-start;
	padding: 40px 20px;
	overflow-y: auto;
}

.sisu-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	z-index: 0;
}

.sisu-modal__container {
	position: relative;
	z-index: 1;
	background: var(--sisu-bg);
	border-radius: calc(var(--sisu-radius) + 2px);
	padding: 32px;
	max-width: 420px;
	width: 90vw;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Wider container for long forms (contracts) */
.sisu-modal--scrollable .sisu-modal__container {
	max-width: 680px;
	width: 100%;
	max-height: none;
	margin: auto;
}

.sisu-modal__close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--sisu-text-light);
	line-height: 1;
	padding: 4px;
}

.sisu-modal__close:hover {
	color: var(--sisu-text);
}

.sisu-modal__title {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 24px 0;
	color: var(--sisu-secondary);
}

.sisu-modal__footer {
	text-align: center;
	margin-top: 16px;
	font-size: 14px;
	color: var(--sisu-text-light);
}

.sisu-modal__footer a {
	color: var(--sisu-primary);
	font-weight: 500;
}

.sisu-modal__actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 16px;
}

/* Messages container — used INSIDE modals AND as a standalone alert by many
   templates (account, stripe, listings, etc.). Keeps the same look in both. */
.sisu-modal__messages:empty {
	display: none;
}

.sisu-modal__messages {
	margin-bottom: 16px;
	padding: 12px 16px;
	border-radius: var(--sisu-radius);
	font-size: 14px;
	line-height: 1.5;
}

.sisu-modal__messages--error {
	background: var(--sisu-error-bg);
	color: var(--sisu-error);
	border: 1px solid var(--sisu-error-border);
}

.sisu-modal__messages--success {
	background: var(--sisu-success-bg);
	color: var(--sisu-success);
	border: 1px solid #bbf7d0;
}

.sisu-modal__messages p {
	margin: 0 0 4px 0;
}

.sisu-modal__messages p:last-child {
	margin-bottom: 0;
}

body.sisu-modal-open {
	overflow: hidden;
}

/* Mobile: fullscreen modal */
@media (max-width: 480px) {
	.sisu-modal__container {
		padding: 24px 20px;
		border-radius: 0;
		max-height: 100vh;
		height: 100vh;
		width: 100vw;
		max-width: 100vw;
	}

	.sisu-modal--scrollable .sisu-modal__container {
		height: auto;
		min-height: 100vh;
	}
}


/* ─────────────────────────────────────────
   4. STATUS PILL  (.sisu-status — the canonical pill system). 
   Module-specific variants (sisu-in-progress, publish, draft, paid, …) 
   stay in their module's CSS — only the GENERIC variants live here.
   ───────────────────────────────────────── */

.sisu-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	line-height: 1.6;
}

/* Semantic variants */
.sisu-status--success  { background: var(--sisu-success-bg); color: var(--sisu-success); }
.sisu-status--warning  { background: var(--sisu-warning-bg);                        color: var(--sisu-warning); }
.sisu-status--info     { background: var(--sisu-info-bg-strong);                        color: var(--sisu-info); }
.sisu-status--neutral  { background: var(--sisu-bg-light);  color: var(--sisu-text-light); }
.sisu-status--danger   { background: var(--sisu-error-bg);  color: var(--sisu-error); }

/* Time-state variants (formerly .sisu-pill--active/--upcoming/--past in business-tools.css) */
.sisu-status--active   { background: var(--sisu-success-bg-strong); color: var(--sisu-success-strong); }
.sisu-status--upcoming { background: var(--sisu-info-bg-strong); color: var(--sisu-info); }
.sisu-status--past     { background: #f3f4f6; color: #6b7280; }

/* Order-stage variants (used on the dashboard "current tasks" + order pages) */
.sisu-status--sisu-in-progress { background: var(--sisu-warning-bg); color: var(--sisu-warning); } /* waiting for delivery — yellow */
.sisu-status--sisu-delivered   { background: #ede9fe; color: #5b21b6; } /* waiting for feedback — lilac  */
.sisu-status--sisu-disputed    { background: var(--sisu-error-bg); color: var(--sisu-error); } /* in dispute — red */


/* ─────────────────────────────────────────
   5. NOTIFICATION DOT  (.sisu-badge)
   Red counter on header icons (messages, notifications).
   notification-badge.js sets `el.style.display = 'none'` when the
   count is 0, so the default state must be visible.
   ───────────────────────────────────────── */

.sisu-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	color: #fff;
	background: var(--sisu-error);
	border-radius: 8px;
	box-sizing: border-box;
}

/* Legacy modifier kept for any inline JS that still toggles it. */
.sisu-badge--visible {
	display: block;
}


/* ─────────────────────────────────────────
   6. INLINE TAG PILL  (.sisu-tag)
   Inline pill used inside text flow — Verified / Pending /
   Not verified, etc. Different from .sisu-status (which is a
   table-cell pill) only in spacing + alignment.
   ───────────────────────────────────────── */

.sisu-tag {
	display: inline-block;
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 12px;
	margin-left: 8px;
	vertical-align: middle;
}

.sisu-tag--success {
	background: var(--sisu-success-bg);
	color: var(--sisu-success);
}

.sisu-tag--warning {
	background: var(--sisu-warning-bg);
	color: var(--sisu-warning);
}

.sisu-tag--error {
	background: var(--sisu-error-bg);
	color: var(--sisu-error);
}


/* ─────────────────────────────────────────
   7. CARD  (.sisu-card)
   White surface, 1px border, radius, padding. Modules can extend with their own
   layout rules, but the base look is shared.
   ───────────────────────────────────────── */

.sisu-card {
	background: var(--sisu-bg);
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	padding: 20px;
}

.sisu-card--muted {
	background: var(--sisu-bg-light);
}

.sisu-card--dashed {
	border-style: dashed;
}


/* ─────────────────────────────────────────
   8. TOAST  (.sisu-toast)
   Fixed bottom-right notification.
   JS adds `.is-visible` to fade in.
   ───────────────────────────────────────── */

.sisu-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 10px 16px;
	border-radius: var(--sisu-radius);
	background: var(--sisu-secondary);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 9999;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sisu-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.sisu-toast--success {
	background: var(--sisu-success-bg);
	color: var(--sisu-success);
}

.sisu-toast--error {
	background: var(--sisu-error);
	color: #fff;
}

.sisu-toast--warning {
	background: var(--sisu-warning-bg);
	color: var(--sisu-warning);
}


/* ─────────────────────────────────────────
   9. FORM ROW 2-COLUMN  (.sisu-form__row)
   Shared by account, checkout, contracts.
   ───────────────────────────────────────── */

.sisu-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

/* Backward-compat alias for contracts' `--2col` modifier. */
.sisu-form__row--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 768px) {
	.sisu-form__row,
	.sisu-form__row--2col {
		grid-template-columns: 1fr;
	}
}


/* ─────────────────────────────────────────
   10. TOOLTIP  (.sisu-tooltip)
   "?" hover bubble used in filter labels, form hints, etc.
   ───────────────────────────────────────── */

.sisu-tooltip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--sisu-border);
	color: var(--sisu-text-light);
	font-size: 10px;
	font-weight: 700;
	cursor: help;
	position: relative;
	flex-shrink: 0;
	line-height: 1;
}

.sisu-tooltip:hover::after,
.sisu-tooltip:focus::after {
	content: attr(aria-label);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 6px);
	transform: translateX(-50%);
	background: var(--sisu-secondary);
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	padding: 8px 12px;
	border-radius: var(--sisu-radius);
	white-space: normal;
	width: 200px;
	z-index: 10;
	line-height: 1.4;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sisu-tooltip:hover::before,
.sisu-tooltip:focus::before {
	content: '';
	position: absolute;
	left: 50%;
	bottom: calc(100% + 2px);
	transform: translateX(-50%);
	border: 4px solid transparent;
	border-top-color: var(--sisu-secondary);
	z-index: 11;
}


/* ─────────────────────────────────────────
   11. LANGUAGE SELECTOR  (.sisu-lang-select)
   ───────────────────────────────────────── */

.sisu-lang-select {
	position: relative;
}

.sisu-lang-select__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.sisu-lang-select__tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	padding: 4px 10px;
	background: var(--sisu-bg-alt);
	border-radius: 14px;
	color: var(--sisu-text);
}

.sisu-lang-select__tag button {
	background: none;
	border: none;
	font-size: 14px;
	color: var(--sisu-text-light);
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
}

.sisu-lang-select__tag button:hover {
	color: var(--sisu-error);
}

.sisu-lang-select__input-wrap {
	position: relative;
}

.sisu-lang-select__dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 50;
	background: var(--sisu-bg);
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	max-height: 200px;
	overflow-y: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sisu-lang-select__option {
	padding: 8px 14px;
	font-size: 14px;
	cursor: pointer;
	color: var(--sisu-text);
}

.sisu-lang-select__option:hover {
	background: var(--sisu-bg-light);
}

/* Compact variant used inside the browse filter sidebar */
.sisu-lang-select--filter {
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	padding: 6px;
}

.sisu-lang-select--filter .sisu-lang-select__input {
	border: none;
	padding: 4px 8px;
	font-size: 13px;
}

.sisu-lang-select--filter .sisu-lang-select__tags {
	margin-bottom: 4px;
}

.sisu-lang-select--filter .sisu-lang-select__tag {
	font-size: 12px;
}


/* ─────────────────────────────────────────
   12. BROWSE LAYOUT + FILTER FORM
   Two-column listing/browse layout with sticky sidebar.
   ───────────────────────────────────────── */

.sisu-browse {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 32px;
	align-items: start;
}

.sisu-browse__sidebar {
	position: sticky;
	top: 24px;
}

.sisu-browse__main {
	min-width: 0;
}

.sisu-browse__result-count {
	font-size: 14px;
	color: var(--sisu-text-light);
	margin: 0 0 16px;
}

.sisu-browse__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.sisu-browse__toolbar .sisu-browse__result-count {
	margin: 0;
}

.sisu-browse__sort {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sisu-browse__sort-label {
	font-size: 14px;
	color: var(--sisu-text-light);
	white-space: nowrap;
}

.sisu-browse__sort select {
	width: auto;
}

/* Specificity bumped to .sisu-btn.* so it beats .sisu-btn's own
   display:inline-flex from the theme — otherwise the toggle leaks onto desktop. */
.sisu-btn.sisu-browse__mobile-toggle {
	display: none;
}

.sisu-filter-form {
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	padding: 20px;
	background: var(--sisu-bg);
}

.sisu-filter-form__section {
	margin-bottom: 20px;
}

.sisu-filter-form__section:last-child {
	margin-bottom: 0;
}

.sisu-filter-form__heading {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--sisu-text-light);
	margin: 0 0 8px;
}

.sisu-filter-form__radios,
.sisu-filter-form__checks {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sisu-filter-form__radio,
.sisu-filter-form__check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--sisu-text);
	cursor: pointer;
	line-height: 1.4;
}

.sisu-filter-form__radio input,
.sisu-filter-form__check input {
	margin: 0;
	flex-shrink: 0;
}

.sisu-filter-form__radio--inline {
	display: inline-flex;
	margin-right: 12px;
}

.sisu-filter-form__lang-mode {
	margin-bottom: 8px;
}

@media (max-width: 768px) {
	.sisu-browse {
		grid-template-columns: 1fr;
	}

	.sisu-browse__sidebar {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1000;
		background: var(--sisu-bg);
		overflow-y: auto;
		padding: 20px;
		display: none;
	}

	.sisu-browse__sidebar--open {
		display: block;
	}

	.sisu-btn.sisu-browse__mobile-toggle {
		display: inline-flex;
		margin-bottom: 12px;
	}

	.sisu-filter-form__close {
		display: block;
		text-align: right;
		margin-bottom: 12px;
	}
}

@media (min-width: 769px) {
	.sisu-filter-form__close {
		display: none;
	}
}


/* ─────────────────────────────────────────
   13. PAGE HEADER  (small, mobile-friendly variant)
   Used by all the table pages (orders, sales, listings…).
   ───────────────────────────────────────── */

.sisu-page__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	gap: 10px;
	flex-wrap: wrap;
}

/* The plugin's account/listing/order/messages pages all want the
   smaller, mobile-friendly page title. This override matches the
   second `.sisu-page__title` block that used to live at the END
   of the theme's main.css (cascade winner). */
.sisu-page__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0;
}

@media (max-width: 600px) {
	.sisu-page__title {
		font-size: 16px;
	}
}


/* ─────────────────────────────────────────
   14. TABLE  (.sisu-table)
   Reusable for any tabular page. Used by orders, sales,
   listings, spendings, earnings, admin pages.
   ───────────────────────────────────────── */

.sisu-table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.sisu-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	color: var(--sisu-text);
}

.sisu-table th,
.sisu-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--sisu-border);
	vertical-align: middle;
}

.sisu-table th {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--sisu-text-light);
	background: var(--sisu-bg-light);
	white-space: nowrap;
}

.sisu-table tbody tr:hover td {
	background: var(--sisu-bg-light);
}

/* Plain text links in a cell — but NOT button links (.sisu-btn keeps its own
   colors; otherwise this teal rule overrode the white button text). */
.sisu-table a:not(.sisu-btn) {
	color: var(--sisu-primary);
	text-decoration: none;
	font-weight: 500;
}

.sisu-table a:not(.sisu-btn):hover {
	text-decoration: underline;
}

.sisu-table__actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.sisu-table__num {
	text-align: right;
	white-space: nowrap;
}

.sisu-table__empty {
	text-align: center;
	padding: 32px 16px;
	color: var(--sisu-text-light);
	font-size: 14px;
}

/* Loading state while AJAX is in flight */
.sisu-table-wrap--loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* Show icons only on mobile (hidden by default on desktop, label shown) */
.sisu-btn__icon { display: none; }
.sisu-btn__label { display: inline; }

@media (max-width: 600px) {
	.sisu-table {
		font-size: 11px;
	}
	.sisu-table th,
	.sisu-table td {
		padding: 8px 6px;
	}
	.sisu-table th {
		font-size: 10px;
		letter-spacing: 0.2px;
	}
	.sisu-table__cell--hide-sm {
		display: none;
	}
	.sisu-table__actions {
		gap: 4px;
	}
	.sisu-table__actions .sisu-btn {
		padding: 4px 6px;
		font-size: 11px;
	}
	.sisu-table__actions .sisu-btn--icon-sm .sisu-btn__label {
		display: none;
	}
	.sisu-table__actions .sisu-btn--icon-sm .sisu-btn__icon {
		display: inline;
		font-size: 14px;
	}
}


/* ─────────────────────────────────────────
   15. TABLE FILTERS  (.sisu-table-filters)
   Search + dropdowns sitting above a .sisu-table.
   ───────────────────────────────────────── */

.sisu-table-filters {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) repeat(auto-fit, minmax(140px, 180px));
	gap: 10px;
	margin-bottom: 16px;
	padding: 12px;
	background: var(--sisu-bg-light);
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
}

.sisu-table-filters__search {
	position: relative;
}

.sisu-table-filters__search-input,
.sisu-table-filters__select {
	width: 100%;
	height: 36px;
	padding: 0 12px;
	font-size: 13px;
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	background: var(--sisu-bg);
	color: var(--sisu-text);
	font-family: inherit;
}

.sisu-table-filters__search-input {
	padding-left: 32px;
}

.sisu-table-filters__search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 14px;
	color: var(--sisu-text-light);
	pointer-events: none;
}

.sisu-table-filters__clear {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: var(--sisu-text-light);
	cursor: pointer;
	display: none;
	padding: 4px 6px;
}

.sisu-table-filters__search--has-text .sisu-table-filters__clear {
	display: block;
}

.sisu-table-filters__select:focus,
.sisu-table-filters__search-input:focus {
	outline: 2px solid var(--sisu-primary);
	outline-offset: -1px;
}

@media (max-width: 600px) {
	.sisu-table-filters {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 10px;
	}
}


/* ─────────────────────────────────────────
   16. TABLE PAGINATION  (.sisu-table-pagination)
   ───────────────────────────────────────── */

.sisu-table-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 16px;
	font-size: 13px;
	color: var(--sisu-text-light);
	flex-wrap: wrap;
	gap: 10px;
}

.sisu-table-pagination__pages {
	display: flex;
	gap: 4px;
}

.sisu-table-pagination__btn {
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	border: 1px solid var(--sisu-border);
	background: var(--sisu-bg);
	color: var(--sisu-text);
	border-radius: var(--sisu-radius);
	cursor: pointer;
	font-size: 13px;
	font-family: inherit;
}

.sisu-table-pagination__btn:hover:not(:disabled) {
	border-color: var(--sisu-primary);
	color: var(--sisu-primary);
}

.sisu-table-pagination__btn--active {
	background: var(--sisu-primary);
	border-color: var(--sisu-primary);
	color: #fff;
}

.sisu-table-pagination__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

@media (max-width: 600px) {
	.sisu-table-pagination {
		flex-direction: column;
		align-items: stretch;
	}
}


/* ─────────────────────────────────────────
   17. STAT CARD  (donut with value INSIDE the ring)
   Used on Spendings + Earnings. Brand-coloured ring.
   ───────────────────────────────────────── */

.sisu-stat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.sisu-stat-grid--2 { grid-template-columns: repeat(2, 1fr); }
.sisu-stat-grid--4 { grid-template-columns: repeat(4, 1fr); }

.sisu-stat-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 20px 16px;
	border: 1px solid var(--sisu-border);
	border-radius: var(--sisu-radius);
	background: var(--sisu-bg);
}

.sisu-stat-card__label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--sisu-text-light);
	margin-bottom: 12px;
}

.sisu-stat-card__donut {
	position: relative;
	width: 140px;
	height: 140px;
}

.sisu-stat-card__donut svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.sisu-stat-card__donut-track {
	fill: none;
	stroke: var(--sisu-border);
	stroke-width: 2;
}

.sisu-stat-card__donut-fill {
	fill: none;
	stroke: var(--sisu-primary);
	stroke-width: 2;
	stroke-linecap: round;
}

/* Donut colour variants */
.sisu-stat-card--primary   .sisu-stat-card__donut-fill { stroke: var(--sisu-primary); }
.sisu-stat-card--secondary .sisu-stat-card__donut-fill { stroke: var(--sisu-secondary); }
.sisu-stat-card--muted     .sisu-stat-card__donut-fill { stroke: var(--sisu-text-light); }
.sisu-stat-card--warning   .sisu-stat-card__donut-fill { stroke: #f59e0b; }
.sisu-stat-card--success   .sisu-stat-card__donut-fill { stroke: var(--sisu-success); }

.sisu-stat-card__value {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 700;
	color: var(--sisu-secondary);
	line-height: 1.1;
	padding: 0 10px;
	text-align: center;
	word-break: break-word;
}

.sisu-stat-card__hint {
	display: block;
	font-size: 11px;
	color: var(--sisu-text-light);
	margin-top: 10px;
}

/* Flat variant (no donut) — Lifetime totals on Earnings */
.sisu-stat-card--flat {
	align-items: flex-start;
	text-align: left;
	padding: 18px 22px;
}

.sisu-stat-card--flat .sisu-stat-card__label {
	margin-bottom: 6px;
}

.sisu-stat-card__big-value {
	display: block;
	font-size: 26px;
	font-weight: 700;
	color: var(--sisu-secondary);
	line-height: 1.2;
	margin-bottom: 4px;
}

.sisu-stat-card__big-value--primary {
	color: var(--sisu-primary);
}

@media (max-width: 768px) {
	.sisu-stat-grid,
	.sisu-stat-grid--2,
	.sisu-stat-grid--4 {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		margin-bottom: 16px;
	}
	.sisu-stat-card {
		padding: 14px 10px;
	}
	.sisu-stat-card__donut { width: 110px; height: 110px; }
	.sisu-stat-card__value { font-size: 17px; padding: 0 6px; }
	.sisu-stat-card__label { font-size: 10px; margin-bottom: 8px; }
	.sisu-stat-card__hint  { font-size: 10px; margin-top: 6px; }
}

@media (max-width: 480px) {
	.sisu-stat-grid,
	.sisu-stat-grid--2,
	.sisu-stat-grid--4 {
		grid-template-columns: 1fr;
	}
	.sisu-stat-card__donut { width: 130px; height: 130px; }
	.sisu-stat-card__value { font-size: 19px; }
}


/* ─────────────────────────────────────────
   18. INLINE READ-ONLY STARS  (.sisu-stars)
   ------------------------------------------
   Used everywhere a rating can appear — listing cards, profiles,
   the single listing page, order/sales rows. Lives here (not in
   reviews.css) so the stars render correctly on every page that
   shows a card, including the home page, even when the reviews
   module CSS is not enqueued.
   ───────────────────────────────────────── */

.sisu-stars {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	font-size: 1em;
	line-height: 1;
	white-space: nowrap;
	vertical-align: middle;
}

.sisu-stars--small { font-size: .85em; }
.sisu-stars--large { font-size: 1.35em; }

/* Rail = the *stars only* layer. The fill is positioned within this so it
   never bleeds over the "5.0 (6)" label sitting beside the stars. */
.sisu-stars__rail {
	position: relative;
	display: inline-block;
	line-height: 1;
}

.sisu-stars__track,
.sisu-stars__fill {
	display: inline-block;
	letter-spacing: 1px;
	white-space: nowrap;
}

.sisu-stars__track {
	color: var(--sisu-border);
}

.sisu-stars__fill {
	color: var(--sisu-star);
	position: absolute;
	left: 0; top: 0;
	width: 0;
	overflow: hidden;
}

.sisu-stars__value {
	font-weight: 600;
	color: var(--sisu-text);
}

.sisu-stars__count {
	color: var(--sisu-text-light);
	font-weight: 400;
}


/* ─────────────────────────────────────────
   19. ALERT VARIANTS  (.sisu-alert--*)
   ------------------------------------------
   The .sisu-alert BASE (padding/radius/margin) lives in the theme's
   main.css, together with --error and --success. The --info / --warning
   / --neutral variants were previously scattered across module CSS
   (listings, account, stripe-connect), so they only appeared when that
   module's stylesheet happened to be loaded. They live here now so the
   full set is available on every page (this file is enqueued site-wide).
   Palette matches the .sisu-status pills above for consistency.
   ───────────────────────────────────────── */

.sisu-alert--info {
	background: var(--sisu-info-bg-strong);
	color: var(--sisu-info);
	border: 1px solid var(--sisu-info-border);
}

.sisu-alert--warning {
	background: var(--sisu-warning-bg);
	color: var(--sisu-warning);
	border: 1px solid var(--sisu-warning-border);
}

.sisu-alert--neutral {
	background: var(--sisu-bg-light);
	color: var(--sisu-text-light);
	border: 1px solid var(--sisu-border);
}

/* Headings/paragraphs inside an alert sit flush so banners stay compact. */
.sisu-alert strong { display: block; margin-bottom: 4px; }
.sisu-alert p { margin: 4px 0 0; }
.sisu-alert p:first-child { margin-top: 0; }


/* ─────────────────────────────────────────
   20. SPINNER ELEMENT  (.sisu-spinner)
   ------------------------------------------
   A ready-to-use loader element built on the shared `sisu-spin`
   keyframes (section 2). Drop <div class="sisu-spinner"></div> into
   any AJAX target. Replaces the per-module spinner markup.
   ───────────────────────────────────────── */

.sisu-spinner {
	width: 28px;
	height: 28px;
	margin: 32px auto;
	border: 3px solid var(--sisu-border);
	border-top-color: var(--sisu-primary);
	border-radius: 50%;
	animation: sisu-spin 0.8s linear infinite;
}


/* ─────────────────────────────────────────
   21. TEXT UTILITIES  (.sisu-text-*)
   Tiny inline helpers used by templates and by JS-injected markup.
   ───────────────────────────────────────── */

.sisu-text-muted { color: var(--sisu-text-light); }
.sisu-text-error { color: var(--sisu-error); }


/* ─────────────────────────────────────────
   22. FORM LABEL HELPERS  (extend the theme's .sisu-form__label)
   The base .sisu-form__label lives in main.css; these add the
   required-asterisk and the inline "(optional)" hint used by the
   contract form and other plugin forms.
   ───────────────────────────────────────── */

.sisu-form__label--required::after {
	content: ' *';
	color: var(--sisu-error);
}

.sisu-form__label-hint {
	margin-left: 6px;
	font-size: 11px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: var(--sisu-text-light);
}


/* ─────────────────────────────────────────
   23. BACK LINK  (.sisu-back-link)
   "← All contracts" style nav link used on detail pages.
   ───────────────────────────────────────── */

.sisu-back-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	color: var(--sisu-text-light);
	text-decoration: none;
}

.sisu-back-link:hover {
	color: var(--sisu-primary);
	text-decoration: none;
}


/* ─────────────────────────────────────────
   24. EMPTY STATE  (.sisu-empty-state)
   Centered "nothing here yet" block for list pages that aren't tables
   (the table version is .sisu-table__empty, section 14).
   ───────────────────────────────────────── */

.sisu-empty-state {
	text-align: center;
	padding: 40px 20px;
	border: 1px dashed var(--sisu-border);
	border-radius: var(--sisu-radius);
	background: var(--sisu-bg-light);
	color: var(--sisu-text);
}

.sisu-empty-state__hint {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--sisu-text-light);
}

/* ─────────────────────────────────────────────
   SHARED CONFIRM MODAL
   Used by any module's styled confirm() replacement
   (offers, jobs, contracts, disputes, order actions…).
   Lives here (global) so it is available on every page
   and there is a single place to restyle it.
   ───────────────────────────────────────────── */
.sisu-confirm-modal[hidden] {
	display: none;
}
.sisu-confirm-modal {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.sisu-confirm-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}
.sisu-confirm-modal__container {
	position: relative;
	background: var(--sisu-bg);
	border-radius: var(--sisu-radius);
	padding: 24px 24px 20px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.sisu-confirm-modal__message {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--sisu-text);
}
.sisu-confirm-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

/* Siltaamo: read-only value shown in place of an input (e.g. the fixed "Finland" country). */
.sisu-form__static {
	margin: 0;
	padding: 8px 0;
	font-weight: 500;
}

/* Siltaamo: simple inline checkbox + label (e.g. "Show my municipality"). */
.sisu-form__checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 400;
}

/* Siltaamo: let the [hidden] attribute win over display:flex above. */
.sisu-form__checkbox[hidden] {
	display: none;
}

/* Siltaamo E8-1/E8-2: education (profile editor + public lists). */
.sisu-education-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
.sisu-education-row textarea { grid-column: 1 / -1; }
.sisu-education-row__remove { justify-self: start; }
.sisu-education-list { list-style: none; margin: 0; padding: 0; }
.sisu-education-list__item { margin-bottom: 12px; }
.sisu-education-list__item p { margin: 4px 0 0; }
.sisu-education-list__years { opacity: 0.7; font-size: 0.9em; }
