/*==========================================================================
  UNQUEST CAPITALS - SHARED UI PRIMITIVES
  Buttons, fields, cards, badges, tables, alerts and the two interactive
  controls (theme switch, password reveal).

  Depends on theme.css. Load order: theme.css -> bootstrap -> ui.css
  (ui.css comes last so it can settle Bootstrap's defaults onto our tokens.)
===========================================================================*/

/*--------------------------------------------------------------------------
  BASE
--------------------------------------------------------------------------*/
body {
	font-family: var(--font-body);
	color: var(--text);
	background-color: var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-title {
	font-family: var(--font-display);
	color: var(--text);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

a {
	color: var(--brand-text);
	text-decoration: none;
	transition: color var(--dur-fast) var(--ease);
}

a:hover {
	color: var(--brand-hover);
}

hr {
	border-color: var(--border);
	opacity: 1;
}

/* Money and any other figure that should not jitter as it updates. */
.tnum,
.figure,
.money {
	font-variant-numeric: tabular-nums;
	font-feature-settings: 'tnum' 1;
}

.mono {
	font-family: var(--font-mono);
	font-size: 0.9em;
	letter-spacing: -0.01em;
}

/*--------------------------------------------------------------------------
  FOCUS - one visible, consistent ring everywhere
--------------------------------------------------------------------------*/
:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
	border-radius: var(--radius-xs);
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 4px var(--ring);
}

/*--------------------------------------------------------------------------
  SCROLLBARS
--------------------------------------------------------------------------*/
* {
	scrollbar-width: thin;
	scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

*::-webkit-scrollbar-track {
	background: transparent;
}

*::-webkit-scrollbar-thumb {
	background-color: var(--border-strong);
	border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
	background-color: var(--text-subtle);
}

/*--------------------------------------------------------------------------
  FORM FIELDS
--------------------------------------------------------------------------*/
.form-control,
.form-select,
textarea.form-control {
	background-color: var(--surface-inset);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 0.75rem 1rem;
	font-size: var(--text-base);
	font-family: var(--font-body);
	transition: border-color var(--dur-fast) var(--ease),
		box-shadow var(--dur-fast) var(--ease),
		background-color var(--dur-fast) var(--ease);
	box-shadow: none;
}

.form-control::placeholder {
	color: var(--text-subtle);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
	border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus {
	background-color: var(--surface);
}

.form-control:disabled,
.form-control[readonly] {
	background-color: var(--surface-3);
	color: var(--text-muted);
	cursor: not-allowed;
}

.form-select {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236e7590' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 14px 11px;
	padding-right: 2.75rem;
	appearance: none;
}

:root[data-theme='dark'] .form-select {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239aa0bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

label,
.form-label {
	color: var(--text-muted);
	font-size: var(--text-sm);
	font-weight: 500;
	margin-bottom: 0.4rem;
	letter-spacing: 0.01em;
}

/* Bootstrap floating labels, re-tuned */
.form-floating>.form-control {
	height: 58px;
	padding: 1.4rem 1rem 0.4rem;
	background-color: var(--surface-inset);
}

.form-floating>label {
	color: var(--text-subtle);
	padding: 1rem;
	font-weight: 400;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
	color: var(--text-muted);
	opacity: 1;
	transform: scale(0.82) translateY(-0.5rem) translateX(0.15rem);
}

/* Validation */
.form-control.is-invalid,
.form-control[aria-invalid='true'] {
	border-color: var(--danger);
}

.invalid-feedback,
.text-danger,
span.error {
	color: var(--danger-text) !important;
	font-size: var(--text-sm);
	font-weight: 500;
}

/*--------------------------------------------------------------------------
  PASSWORD REVEAL
  The button sits absolutely inside the field wrapper, so `.form-floating`
  keeps input + label as direct siblings and Bootstrap's float still works.
--------------------------------------------------------------------------*/
.pw-field {
	position: relative;
}

.pw-toggle {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-xs);
	background: transparent;
	color: var(--text-subtle);
	cursor: pointer;
	transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.pw-toggle:hover {
	color: var(--brand-text);
	background-color: var(--brand-soft);
}

.pw-toggle:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 1px;
}

.pw-toggle i {
	font-size: 1.05rem;
	line-height: 1;
	pointer-events: none;
}

/* Reserve room so long values never run under the button. */
.pw-field>.form-control,
.form-floating>.form-control.has-pw-toggle {
	padding-right: 50px;
}

/* Hide the browser's own reveal control so there are not two. */
.pw-field input::-ms-reveal,
.pw-field input::-ms-clear,
.form-floating input.has-pw-toggle::-ms-reveal {
	display: none;
}

/*--------------------------------------------------------------------------
  THEME SWITCH
--------------------------------------------------------------------------*/
.theme-switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	background: var(--surface);
	color: var(--text-muted);
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
		background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.theme-switch:hover {
	color: var(--brand-text);
	border-color: var(--brand-soft-border);
	background: var(--brand-soft);
}

.theme-switch:active {
	transform: scale(0.94);
}

.theme-switch i {
	font-size: 1.05rem;
	line-height: 1;
	pointer-events: none;
	transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease);
}

/* Cross-fade sun and moon on the same spot. */
.theme-switch .icon-sun,
.theme-switch .icon-moon {
	position: absolute;
}

.theme-switch .icon-sun {
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

.theme-switch .icon-moon {
	opacity: 1;
	transform: rotate(0) scale(1);
}

:root[data-theme='dark'] .theme-switch .icon-sun {
	opacity: 1;
	transform: rotate(0) scale(1);
}

:root[data-theme='dark'] .theme-switch .icon-moon {
	opacity: 0;
	transform: rotate(90deg) scale(0.5);
}

/* On a dark navigation bar the switch needs the inverse treatment. */
.on-dark .theme-switch {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.78);
}

.on-dark .theme-switch:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

/*--------------------------------------------------------------------------
  BUTTONS
--------------------------------------------------------------------------*/
.btn {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: var(--text-base);
	border-radius: var(--radius-sm);
	padding: 0.7rem 1.35rem;
	letter-spacing: 0.01em;
	transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
		background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
		color var(--dur-fast) var(--ease);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: 1px solid transparent;
}

.btn:active {
	transform: translateY(1px);
}

.btn:disabled,
.btn.disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Primary - the brand gradient, with a sheen that sweeps on hover. */
.btn-primary,
.btn-brand {
	background: var(--grad-brand);
	border-color: transparent;
	color: var(--brand-on);
	box-shadow: var(--shadow-sm);
	position: relative;
	overflow: hidden;
}

.btn-primary::after,
.btn-brand::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--grad-sheen);
	transform: translateX(-120%);
	transition: transform var(--dur-slow) var(--ease-out);
	pointer-events: none;
}

.btn-primary:hover,
.btn-brand:hover {
	color: var(--brand-on);
	box-shadow: var(--shadow-brand);
	transform: translateY(-2px);
}

.btn-primary:hover::after,
.btn-brand:hover::after {
	transform: translateX(120%);
}

.btn-primary:disabled:hover,
.btn-brand:disabled:hover {
	transform: none;
}

/* Secondary - quiet, bordered */
.btn-secondary,
.btn-outline-secondary {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
	background: var(--surface-2);
	border-color: var(--border-strong);
	color: var(--text);
}

/* Soft - brand-tinted, for tertiary actions */
.btn-soft {
	background: var(--brand-soft);
	border-color: var(--brand-soft-border);
	color: var(--brand-soft-text);
}

.btn-soft:hover {
	background: var(--brand-soft-hover);
	color: var(--brand-soft-text);
}

.btn-success {
	background: var(--success);
	border-color: transparent;
	color: #fff;
}

.btn-success:hover {
	background: var(--green-700);
	color: #fff;
}

.btn-danger {
	background: var(--danger);
	border-color: transparent;
	color: #fff;
}

.btn-danger:hover {
	background: var(--red-700);
	color: #fff;
}

.btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--text-muted);
}

.btn-ghost:hover {
	background: var(--surface-2);
	color: var(--text);
}

.btn-lg {
	padding: 0.95rem 1.75rem;
	font-size: var(--text-md);
	border-radius: var(--radius-md);
}

.btn-sm {
	padding: 0.45rem 0.9rem;
	font-size: var(--text-sm);
	border-radius: var(--radius-xs);
}

.btn-block,
.btn-full {
	width: 100%;
}

/* The legacy `.button` class used across the auth forms. */
.button {
	width: 100%;
	padding: 0.95rem 1.5rem;
	background: var(--grad-brand);
	color: var(--brand-on);
	border: none;
	border-radius: var(--radius-md);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: var(--text-md);
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.button::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--grad-sheen);
	transform: translateX(-120%);
	transition: transform var(--dur-slow) var(--ease-out);
	pointer-events: none;
}

.button:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: var(--shadow-brand);
}

.button:hover:not(:disabled)::after {
	transform: translateX(120%);
}

.button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/*--------------------------------------------------------------------------
  CARDS
--------------------------------------------------------------------------*/
.card,
.uq-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	color: var(--text);
}

.uq-card {
	padding: 1.5rem;
}

.uq-card-hover {
	transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease),
		border-color var(--dur) var(--ease);
}

.uq-card-hover:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--brand-soft-border);
}

.card-header {
	background: transparent;
	border-bottom: 1px solid var(--border);
	padding: 1.15rem 1.5rem;
	font-weight: 600;
}

/*--------------------------------------------------------------------------
  BADGES / PILLS
--------------------------------------------------------------------------*/
.uq-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.7rem;
	border-radius: var(--radius-full);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: capitalize;
	border: 1px solid transparent;
	white-space: nowrap;
}

.uq-badge::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.uq-badge-success,
.uq-badge-completed,
.uq-badge-active,
.uq-badge-win {
	background: var(--success-soft);
	color: var(--success-text);
	border-color: var(--success-border);
}

.uq-badge-warning,
.uq-badge-pending {
	background: var(--warning-soft);
	color: var(--warning-text);
	border-color: var(--warning-border);
}

.uq-badge-danger,
.uq-badge-cancelled,
.uq-badge-blocked,
.uq-badge-loss {
	background: var(--danger-soft);
	color: var(--danger-text);
	border-color: var(--danger-border);
}

.uq-badge-info {
	background: var(--info-soft);
	color: var(--info-text);
	border-color: var(--info-border);
}

.uq-badge-brand {
	background: var(--brand-soft);
	color: var(--brand-soft-text);
	border-color: var(--brand-soft-border);
}

.uq-badge-gold {
	background: var(--gold-soft);
	color: var(--gold-600);
	border-color: var(--gold-border);
}

:root[data-theme='dark'] .uq-badge-gold {
	color: var(--gold-300);
}

/*--------------------------------------------------------------------------
  ALERTS
--------------------------------------------------------------------------*/
.alert {
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	padding: 0.9rem 1.15rem;
	font-size: var(--text-base);
	font-weight: 500;
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
}

.alert-success {
	background: var(--success-soft);
	color: var(--success-text);
	border-color: var(--success-border);
}

.alert-danger {
	background: var(--danger-soft);
	color: var(--danger-text);
	border-color: var(--danger-border);
}

.alert-warning {
	background: var(--warning-soft);
	color: var(--warning-text);
	border-color: var(--warning-border);
}

.alert-info,
.alert-primary {
	background: var(--info-soft);
	color: var(--info-text);
	border-color: var(--info-border);
}

/*--------------------------------------------------------------------------
  TABLES
--------------------------------------------------------------------------*/
.uq-table-wrap {
	width: 100%;
	overflow-x: auto;
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	background: var(--surface);
}

.table {
	color: var(--text);
	margin-bottom: 0;
	border-color: var(--border);
	font-size: var(--text-base);
	vertical-align: middle;
}

.table>thead {
	background: var(--surface-2);
}

.table>thead th {
	color: var(--text-muted);
	font-weight: 600;
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.table>tbody td {
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--border-soft);
	color: var(--text);
	/*
	  Rows stay on one line and the table scrolls sideways instead of
	  wrapping. Every table already sits inside a .uq-table-wrap with
	  overflow-x: auto, so nothing is cut off - it scrolls.
	*/
	white-space: nowrap;
}

/* Long free-text values may still wrap, or they would stretch the table. */
.table>tbody td.wrap,
.table>tbody td .wrap {
	white-space: normal;
}

.table>tbody tr:last-child td {
	border-bottom: 0;
}

.table>tbody tr {
	transition: background-color var(--dur-fast) var(--ease);
}

.table>tbody tr:hover {
	background: var(--surface-2);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
	background: transparent;
	color: var(--text);
}

/* Empty state for tables with no rows yet. */
.uq-empty {
	text-align: center;
	padding: 3rem 1.5rem;
	color: var(--text-muted);
}

.uq-empty i {
	font-size: 2.5rem;
	color: var(--text-subtle);
	display: block;
	margin-bottom: 0.75rem;
	opacity: 0.6;
}

.uq-empty p {
	margin: 0;
	font-size: var(--text-base);
}

/*--------------------------------------------------------------------------
  TABS
  Used to split "pending" from "completed" queues in the admin console.
--------------------------------------------------------------------------*/
.nav-tabs {
	border-bottom: 0;
	gap: 0.25rem;
	flex-wrap: wrap;
}

.nav-tabs .nav-link {
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	font-weight: 600;
	font-size: var(--text-base);
	padding: 0.5rem 0.9rem;
	background: transparent;
	display: inline-flex;
	align-items: center;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
		border-color var(--dur-fast) var(--ease);
}

.nav-tabs .nav-link:hover {
	background: var(--surface-2);
	color: var(--text);
	border-color: var(--border);
	isolation: auto;
}

.nav-tabs .nav-link.active {
	background: var(--brand-soft);
	border-color: var(--brand-soft-border);
	color: var(--brand-soft-text);
}

/*--------------------------------------------------------------------------
  MODALS
--------------------------------------------------------------------------*/
.modal-content {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-xl);
	overflow: hidden;
}

.modal-header,
div.popup-header {
	background: var(--grad-brand);
	color: #fff;
	border-bottom: 0;
	padding: 1.25rem 1.5rem;
}

.modal-header .modal-title,
div.popup-header .modal-title {
	color: #fff;
	font-weight: 600;
}

.modal-header .btn-close {
	filter: brightness(0) invert(1);
	opacity: 0.85;
}

.modal-body,
div.popup-body {
	padding: 1.5rem;
	background: var(--surface);
}

/*
  Scrollable modals.

  Bootstrap only makes the body scroll when .modal-dialog-scrollable is set,
  and even then a tall form can outgrow the viewport on a short screen. This
  caps every modal to the viewport and lets the body scroll inside it, so a
  long form (the funding modal in particular) is always reachable while the
  header and footer buttons stay put.
*/
.modal-dialog {
	max-height: calc(100vh - 2rem);
}

.modal-dialog .modal-content {
	max-height: calc(100vh - 2rem);
}

.modal-dialog-scrollable,
.modal-dialog-scrollable .modal-content {
	max-height: calc(100vh - 2rem);
	overflow: hidden;
}

.modal-dialog-scrollable .modal-body,
.modal-dialog-scrollable div.popup-body {
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Header and footer must not shrink away as the body scrolls. */
.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable .modal-footer,
.modal-dialog-scrollable div.popup-header,
.modal-dialog-scrollable div.popup-footer {
	flex-shrink: 0;
}

@media (max-width: 576px) {

	.modal-dialog,
	.modal-dialog .modal-content,
	.modal-dialog-scrollable,
	.modal-dialog-scrollable .modal-content {
		max-height: calc(100vh - 1rem);
	}
}

div.popup-body label {
	color: var(--text-muted);
	font-weight: 500;
}

.modal-footer,
div.popup-footer {
	background: var(--surface-2);
	border-top: 1px solid var(--border);
	padding: 1rem 1.5rem;
}

/*--------------------------------------------------------------------------
  COPYABLE VALUE - wallet addresses, referral links
--------------------------------------------------------------------------*/
.uq-copy {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: var(--surface-inset);
	border: 1px dashed var(--brand-soft-border);
	border-radius: var(--radius-sm);
	padding: 0.75rem 0.85rem;
	transition: border-color var(--dur-fast) var(--ease);
}

.uq-copy:hover {
	border-color: var(--brand);
}

.uq-copy code,
.uq-copy .uq-copy-value {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--text);
	word-break: break-all;
	flex: 1;
	min-width: 0;
	background: none;
	padding: 0;
}

.uq-copy button {
	flex: none;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-muted);
	border-radius: var(--radius-xs);
	padding: 0.35rem 0.7rem;
	font-size: var(--text-xs);
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	transition: all var(--dur-fast) var(--ease);
	white-space: nowrap;
}

.uq-copy button:hover {
	background: var(--brand-soft);
	color: var(--brand-soft-text);
	border-color: var(--brand-soft-border);
}

.uq-copy button.is-copied {
	background: var(--success-soft);
	color: var(--success-text);
	border-color: var(--success-border);
}

/*--------------------------------------------------------------------------
  BRAND LOCKUP
--------------------------------------------------------------------------*/
.uq-logo {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}

.uq-logo svg,
.uq-logo .uq-logo-img {
	height: var(--uq-logo-h, 34px);
	width: auto;
	display: block;
	max-width: 100%;
}

.uq-logo:hover {
	text-decoration: none;
}

/* variant="auto" ships both lockups and shows whichever suits the theme */
.uq-logo-auto .uq-logo-on-dark {
	display: none;
}

:root[data-theme='dark'] .uq-logo-auto .uq-logo-on-light {
	display: none;
}

:root[data-theme='dark'] .uq-logo-auto .uq-logo-on-dark {
	display: block;
}

@media (prefers-color-scheme: dark) {

	:root:not([data-theme='light']):not([data-theme='dark']) .uq-logo-auto .uq-logo-on-light {
		display: none;
	}

	:root:not([data-theme='light']):not([data-theme='dark']) .uq-logo-auto .uq-logo-on-dark {
		display: block;
	}
}

/* Always-reversed lockup, for permanently dark surfaces like the sidebar. */
.on-dark .uq-logo-auto .uq-logo-on-light {
	display: none;
}

.on-dark .uq-logo-auto .uq-logo-on-dark {
	display: block;
}

/*--------------------------------------------------------------------------
  UTILITIES
--------------------------------------------------------------------------*/
.text-muted {
	color: var(--text-muted) !important;
}

.text-brand {
	color: var(--brand-text) !important;
}

.text-gain {
	color: var(--success-text) !important;
}

.text-loss {
	color: var(--danger-text) !important;
}

.bg-surface {
	background: var(--surface) !important;
}

.border-token {
	border-color: var(--border) !important;
}

.uq-divider {
	height: 1px;
	background: var(--border);
	border: 0;
	margin: 1.5rem 0;
}

/* A label above a figure: small, upper, tracked out. */
.uq-eyebrow {
	font-size: var(--text-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	margin: 0 0 0.35rem;
}

@keyframes uq-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.uq-rise {
	animation: uq-rise var(--dur-slow) var(--ease-out) both;
}

/*--------------------------------------------------------------------------
  DATATABLES
  The plugin ships its own light-only styling; this maps its controls onto
  the token system so search, pagination and info read correctly in both
  themes.
--------------------------------------------------------------------------*/
.dataTables_wrapper {
	padding: 0.25rem 0 0;
	color: var(--text);
}

/* Search + page-length controls */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
	margin-bottom: 0.9rem;
	color: var(--text-muted);
	font-size: var(--text-sm);
}

.dataTables_wrapper .dataTables_filter {
	text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
	background: var(--surface-inset);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 0.5rem 0.85rem 0.5rem 2.1rem;
	margin-left: 0;
	min-width: 240px;
	font-size: var(--text-base);
	transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
	/* magnifier, so the empty-label search box still reads as a search */
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236e7590' stroke-width='2'%3e%3ccircle cx='7' cy='7' r='5'/%3e%3cpath d='M11 11l4 4' stroke-linecap='round'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: left 0.7rem center;
	background-size: 14px;
}

:root[data-theme='dark'] .dataTables_wrapper .dataTables_filter input {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239aa0bd' stroke-width='2'%3e%3ccircle cx='7' cy='7' r='5'/%3e%3cpath d='M11 11l4 4' stroke-linecap='round'/%3e%3c/svg%3e");
}

.dataTables_wrapper .dataTables_filter input:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 4px var(--ring);
	background-color: var(--surface);
}

.dataTables_wrapper .dataTables_length select {
	background: var(--surface-inset);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-xs);
	padding: 0.35rem 0.5rem;
	margin: 0 0.35rem;
}

/* Row count */
.dataTables_wrapper .dataTables_info {
	color: var(--text-muted);
	font-size: var(--text-sm);
	padding-top: 1rem;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
	padding-top: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
	border-radius: var(--radius-xs) !important;
	border: 1px solid transparent !important;
	background: transparent !important;
	color: var(--text-muted) !important;
	padding: 0.4rem 0.75rem !important;
	margin: 0 2px;
	font-size: var(--text-sm);
	font-weight: 600;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
	background: var(--surface-2) !important;
	border-color: var(--border) !important;
	color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
	background: var(--brand) !important;
	border-color: transparent !important;
	color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
	color: var(--text-subtle) !important;
	background: transparent !important;
	border-color: transparent !important;
	cursor: not-allowed;
}

/* Sort indicators */
table.dataTable thead th {
	position: relative;
	cursor: pointer;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
	color: var(--text-subtle);
	opacity: 0.7;
}

table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
	color: var(--brand-text);
	opacity: 1;
}

table.dataTable.no-footer {
	border-bottom: 1px solid var(--border);
}

/* The empty search label would otherwise reserve dead space */
.dataTables_wrapper .dataTables_filter label {
	margin-bottom: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

@media (max-width: 700px) {

	.dataTables_wrapper .dataTables_filter,
	.dataTables_wrapper .dataTables_length {
		text-align: left;
		float: none !important;
	}

	.dataTables_wrapper .dataTables_filter input {
		min-width: 0;
		width: 100%;
	}
}
