:root {
	color-scheme: light;
	--brand-pink: #eaafc8;
	--brand-lilac: #a77eb5;
	--brand-purple: #654ea3;
	--brand-purple-deep: #4b397f;
	--primary: #654ea3;
	--primary-hover: #503d86;
	--primary-soft: rgba(101, 78, 163, 0.11);
	--bg: #f6f7fb;
	--surface: #ffffff;
	--surface-2: #f9fafc;
	--surface-3: #f0f2f7;
	--text: #181a22;
	--text-soft: #656b78;
	--text-faint: #9298a5;
	--border: #e6e8ef;
	--shadow-sm: 0 10px 30px rgba(31, 35, 48, 0.06);
	--shadow-lg: 0 24px 80px rgba(25, 28, 38, 0.14);
	--success: #159b73;
	--success-soft: rgba(21, 155, 115, 0.11);
	--warning: #d58c13;
	--warning-soft: rgba(213, 140, 19, 0.12);
	--danger: #d64545;
	--danger-soft: rgba(214, 69, 69, 0.11);
	--info: #7559aa;
	--info-soft: rgba(117, 89, 170, 0.11);
	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 24px;
	--sidebar-width: 276px;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--primary: #eaafc8;
	--primary-hover: #f4cadc;
	--primary-soft: rgba(234, 175, 200, 0.14);
	--bg: #0e1016;
	--surface: #171a22;
	--surface-2: #1c202a;
	--surface-3: #242935;
	--text: #f4f5f8;
	--text-soft: #a8afbd;
	--text-faint: #747c8c;
	--border: #2b303c;
	--shadow-sm: 0 12px 34px rgba(0, 0, 0, 0.18);
	--shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.44);
	--success: #3ed2a3;
	--success-soft: rgba(62, 210, 163, 0.12);
	--warning: #f3b34b;
	--warning-soft: rgba(243, 179, 75, 0.13);
	--danger: #ff7373;
	--danger-soft: rgba(255, 115, 115, 0.12);
	--info: #c7a6d7;
	--info-soft: rgba(199, 166, 215, 0.13);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body.panel-body {
	margin: 0;
	min-width: 320px;
	min-height: 100vh;
	min-height: 100dvh;
	overflow-x: hidden;
	background: var(--bg);
	color: var(--text);
	font-family: IRANYekanX, Tahoma, Arial, sans-serif;
	direction: rtl;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.25s ease, color 0.25s ease;
}

button,
input,
select,
textarea {
	font: inherit;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
}

button,
a,
input,
select,
textarea {
	-webkit-tap-highlight-color: transparent;
}

button {
	cursor: pointer;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
}

[hidden] {
	display: none !important;
}

.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

:focus-visible {
	outline: 3px solid rgba(101, 78, 163, 0.3);
	outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: none;
}

::selection {
	background: rgba(234, 175, 200, 0.36);
}

.button {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	border: 1px solid transparent;
	border-radius: 12px;
	padding: 9px 17px;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.5;
	transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.button:hover {
	transform: translateY(-1px);
}

.button:active {
	transform: translateY(0) scale(0.98);
}

.button:disabled,
.text-button:disabled,
.icon-button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.button-primary {
	color: #fff;
	background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-deep));
	box-shadow: 0 10px 24px rgba(101, 78, 163, 0.22);
}

.button-primary:hover {
	box-shadow: 0 14px 30px rgba(101, 78, 163, 0.3);
}

.button-soft {
	background: var(--primary-soft);
	color: var(--primary);
	border-color: rgba(101, 78, 163, 0.14);
}

.button-ghost {
	background: transparent;
	color: var(--text-soft);
	border-color: var(--border);
}

.button-light {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(10px);
}

.button-danger {
	background: var(--danger);
	color: #fff;
}

.button-small {
	min-height: 34px;
	padding: 6px 11px;
	font-size: 12px;
	border-radius: 9px;
}

.button-large {
	width: 100%;
	min-height: 52px;
	border-radius: 14px;
	font-size: 15px;
}

.button-full {
	width: 100%;
}

.button.is-loading,
.icon-button.is-loading {
	pointer-events: none;
	color: transparent !important;
	position: relative;
}

.button.is-loading::after,
.icon-button.is-loading::after {
	content: "";
	position: absolute;
	width: 17px;
	height: 17px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	color: #fff;
	animation: spin 0.7s linear infinite;
}

.button-ghost.is-loading::after,
.button-soft.is-loading::after,
.icon-button.is-loading::after {
	color: var(--primary);
}

.icon-button,
.theme-toggle {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	border: 1px solid var(--border);
	border-radius: 12px;
	display: inline-grid;
	place-items: center;
	background: var(--surface);
	color: var(--text-soft);
	transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-button:hover,
.theme-toggle:hover {
	color: var(--primary);
	border-color: rgba(101, 78, 163, 0.3);
	transform: translateY(-1px);
}

.danger-ghost:hover {
	color: var(--danger);
	background: var(--danger-soft);
	border-color: transparent;
}

.text-button {
	border: 0;
	padding: 4px;
	background: transparent;
	color: var(--primary);
	font-weight: 700;
}

.eyebrow {
	display: block;
	margin-bottom: 6px;
	color: var(--primary);
	font-size: 11px;
	font-weight: 900;
	letter-spacing: 0.05em;
}

/* Authentication */
.auth-page {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 48px 24px 56px;
	overflow-x: hidden;
	overflow-y: auto;
	background:
		radial-gradient(circle at 90% 10%, rgba(234, 175, 200, 0.2), transparent 30%),
		radial-gradient(circle at 8% 84%, rgba(101, 78, 163, 0.16), transparent 28%),
		var(--bg);
}

.auth-page::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.3;
	background-image: radial-gradient(var(--text-faint) 0.6px, transparent 0.6px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
	mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

.auth-theme {
	position: fixed;
	top: 22px;
	left: 22px;
	z-index: 5;
}

.auth-ambient {
	position: fixed;
	width: 360px;
	height: 360px;
	border-radius: 50%;
	filter: blur(85px);
	opacity: 0.16;
	pointer-events: none;
	animation: float 9s ease-in-out infinite;
}

.ambient-one {
	top: -160px;
	right: -90px;
	background: var(--brand-purple);
}

.ambient-two {
	bottom: -180px;
	left: -110px;
	background: var(--brand-pink);
	animation-delay: -4s;
}

.auth-card {
	position: relative;
	z-index: 1;
	width: min(1010px, 100%);
	min-height: 560px;
	min-height: min(620px, calc(100dvh - 104px));
	display: grid;
	grid-template-columns: 1.06fr 0.94fr;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 30px;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	animation: card-in 0.55s cubic-bezier(0.2, 0.85, 0.35, 1) both;
}

.auth-brand {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: clamp(35px, 5vw, 64px);
	color: #fff;
	overflow: hidden;
	background:
		linear-gradient(145deg, rgba(57, 39, 94, 0.94), rgba(101, 78, 163, 0.9)),
		url("../imgs/header.png") center/cover no-repeat;
}

.auth-brand::before,
.auth-brand::after {
	content: "";
	position: absolute;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 50%;
}

.auth-brand::before {
	width: 320px;
	height: 320px;
	top: -90px;
	left: -110px;
}

.auth-brand::after {
	width: 190px;
	height: 190px;
	bottom: 40px;
	right: -100px;
}

.brand-mark {
	position: relative;
	z-index: 1;
	width: 66px;
	height: 66px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(234, 175, 200, 0.92), rgba(101, 78, 163, 0.92));
	backdrop-filter: blur(10px);
}

.brand-mark img {
	width: 51px;
	height: 51px;
}

.brand-kicker {
	display: block;
	margin-bottom: 12px;
	font: 700 12px/1.5 Arial, sans-serif;
	letter-spacing: 0.18em;
	opacity: 0.68;
}

.auth-brand h1 {
	max-width: 380px;
	margin: 0 0 16px;
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.35;
	font-weight: 950;
}

.auth-brand p {
	max-width: 430px;
	margin: 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 15px;
	line-height: 2;
}

.auth-benefits {
	position: relative;
	z-index: 1;
	list-style: none;
	padding: 0;
	margin: 36px 0 0;
	display: grid;
	gap: 14px;
}

.auth-benefits li {
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.8);
}

.auth-benefits i {
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 9px;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.auth-form-side {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(34px, 6vw, 74px);
}

.auth-form-header {
	margin-bottom: 26px;
}

.auth-form-header h2 {
	margin: 0 0 9px;
	font-size: 29px;
	font-weight: 950;
}

.auth-form-header p {
	margin: 0;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 1.9;
}

.stack-form {
	display: grid;
	gap: 15px;
}

.stack-form > div {
	display: grid;
	gap: 8px;
}

.stack-form > .input-wrap {
	display: flex;
}

.stack-form label {
	font-size: 13px;
	font-weight: 800;
}

.input-wrap {
	position: relative;
	min-height: 50px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 15px;
	border: 1px solid var(--border);
	border-radius: 13px;
	background: var(--surface-2);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-wrap:focus-within {
	border-color: rgba(101, 78, 163, 0.5);
	box-shadow: 0 0 0 4px var(--primary-soft);
	background: var(--surface);
}

.input-wrap > i:first-child {
	width: 18px;
	flex: 0 0 18px;
	color: var(--text-faint);
	text-align: center;
}

.input-wrap input,
.input-wrap select {
	min-width: 0;
	width: 100%;
	height: 48px;
	border: 0;
	padding: 0;
	background: transparent;
	color: var(--text);
	outline: 0;
}

.input-wrap select {
	appearance: none;
	padding-left: 28px;
	cursor: pointer;
}

.select-arrow {
	position: absolute;
	left: 16px;
	font-size: 11px;
	color: var(--text-faint);
	pointer-events: none;
}

.input-ltr {
	direction: rtl;
}

.input-ltr input {
	direction: ltr;
	text-align: left;
	font-family: Arial, sans-serif;
	letter-spacing: 0.04em;
	unicode-bidi: isolate;
}

.input-ltr select {
	direction: ltr;
	text-align: left;
}

.login-phone-wrap {
	direction: ltr;
	padding: 0 16px;
}

.login-phone-wrap input {
	height: 54px;
	font-size: 16px;
	letter-spacing: 0.035em;
}

textarea {
	width: 100%;
	resize: vertical;
	min-height: 130px;
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 14px 16px;
	background: var(--surface-2);
	color: var(--text);
	line-height: 1.95;
	outline: 0;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea:focus {
	border-color: rgba(101, 78, 163, 0.5);
	box-shadow: 0 0 0 4px var(--primary-soft);
	background: var(--surface);
}

.otp-wrap input {
	width: 100%;
	height: 64px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface-2);
	color: var(--text);
	font: 800 28px/1 Arial, sans-serif;
	letter-spacing: 0.42em;
	text-align: center;
	padding-left: 0.42em;
	outline: 0;
}

.otp-wrap input:focus {
	border-color: rgba(101, 78, 163, 0.5);
	box-shadow: 0 0 0 4px var(--primary-soft);
}

.auth-secondary {
	display: flex !important;
	grid-template-columns: none !important;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.auth-privacy {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 24px 0 0;
	color: var(--text-faint);
	font-size: 11px;
}

.form-alert {
	margin-bottom: 16px;
	padding: 11px 13px;
	border-radius: 11px;
	background: var(--danger-soft);
	color: var(--danger);
	font-size: 12px;
	line-height: 1.8;
}

.form-alert.is-success {
	background: var(--success-soft);
	color: var(--success);
}

.auth-footer {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 26px;
	left: 0;
	display: flex;
	justify-content: center;
	gap: 20px;
	color: var(--text-faint);
	font-size: 11px;
}

.auth-footer a:hover {
	color: var(--primary);
}

/* Application shell */
.panel-app {
	min-height: 100vh;
	min-height: 100dvh;
}

.panel-sidebar {
	position: fixed;
	z-index: 40;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--sidebar-width);
	display: flex;
	flex-direction: column;
	padding: 24px 18px;
	border-left: 1px solid var(--border);
	background: var(--surface);
	transition: transform 0.25s ease, background 0.25s ease;
}

.panel-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 3px 7px 25px;
}

.panel-logo img {
	width: 48px;
	height: 48px;
	padding: 4px;
	border-radius: 14px;
	background: rgba(101, 78, 163, 0.08);
	box-shadow: inset 0 0 0 1px var(--border);
}

.panel-logo-mark {
	position: relative;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	display: grid !important;
	place-items: center;
	border-radius: 14px;
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(101, 78, 163, 0.18), 0 8px 24px rgba(101, 78, 163, 0.08);
}

.panel-logo-mark img {
	display: block;
	width: 37px;
	height: 37px;
	padding: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	filter: brightness(0) saturate(100%) invert(36%) sepia(23%) saturate(1762%) hue-rotate(214deg) brightness(88%) contrast(86%);
}

:root[data-theme="dark"] .panel-logo-mark {
	background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 24px rgba(101, 78, 163, 0.2);
}

:root[data-theme="dark"] .panel-logo-mark img {
	filter: none;
}

@supports ((-webkit-mask: url("../imgs/logo.svg")) or (mask: url("../imgs/logo.svg"))) {
	.panel-logo-mark::before {
		content: "";
		position: absolute;
		inset: 7px;
		background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
		-webkit-mask: url("../imgs/logo.svg") center / contain no-repeat;
		mask: url("../imgs/logo.svg") center / contain no-repeat;
	}

	.panel-logo-mark img {
		opacity: 0;
	}

	:root[data-theme="dark"] .panel-logo-mark::before {
		background: #fff;
	}
}

.panel-logo span {
	display: grid;
	gap: 1px;
}

.panel-logo strong {
	font-size: 17px;
	font-weight: 950;
}

.panel-logo small {
	color: var(--text-faint);
	font-size: 10px;
}

.panel-nav {
	min-height: 0;
	flex: 1;
	display: grid;
	align-content: start;
	gap: 6px;
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.panel-nav::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.nav-label {
	padding: 10px 13px 5px;
	color: var(--text-faint);
	font-size: 10px;
	font-weight: 800;
}

.panel-nav-item {
	position: relative;
	width: 100%;
	min-height: 47px;
	display: flex;
	align-items: center;
	gap: 12px;
	border: 0;
	border-radius: 12px;
	padding: 9px 13px;
	background: transparent;
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 700;
	text-align: right;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.panel-nav-item i {
	width: 24px;
	font-size: 16px;
	text-align: center;
}

.panel-nav-item:hover {
	color: var(--text);
	background: var(--surface-2);
	transform: translateX(-2px);
}

.panel-nav-item.is-active {
	color: var(--primary);
	background: var(--primary-soft);
}

.panel-nav-item.is-active::before {
	content: "";
	position: absolute;
	right: -18px;
	width: 4px;
	height: 25px;
	border-radius: 4px 0 0 4px;
	background: linear-gradient(var(--brand-pink), var(--brand-purple));
}

.sidebar-bottom {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 15px;
	background: var(--surface-2);
}

.sidebar-profile {
	min-width: 0;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sidebar-profile > span:last-child {
	min-width: 0;
	display: grid;
	align-content: center;
	gap: 4px;
}

.sidebar-profile strong {
	overflow: hidden;
	text-overflow: ellipsis;
	font: 700 12px/1.25 Arial, sans-serif;
}

.sidebar-profile-copy {
	text-align: right;
}

.sidebar-profile-copy em {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 0;
	color: var(--primary);
	font-size: 9px;
	font-style: normal;
	font-weight: 800;
	white-space: nowrap;
}

.profile-avatar {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	display: grid;
	place-items: center;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
	color: #fff;
}

.sidebar-bottom .icon-button {
	width: 34px;
	height: 34px;
	flex-basis: 34px;
	border: 0;
	background: transparent;
}

.panel-main {
	margin-right: var(--sidebar-width);
	min-height: 100vh;
	min-height: 100dvh;
}

.panel-header {
	position: sticky;
	z-index: 30;
	top: 0;
	height: 82px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 0 clamp(24px, 4vw, 56px);
	border-bottom: 1px solid rgba(230, 232, 239, 0.76);
	background: var(--bg);
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .panel-header {
	border-bottom-color: rgba(43, 48, 60, 0.8);
}

.header-start,
.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.header-refresh {
	border-color: var(--border);
	background: var(--surface);
	color: var(--text-soft);
}

.header-start h1 {
	margin: 0;
	font-size: 20px;
	font-weight: 900;
}

.header-start .eyebrow {
	margin-bottom: 1px;
	font-size: 9px;
}

.menu-toggle {
	display: none;
}

.panel-content {
	width: min(1480px, 100%);
	margin: 0 auto;
	padding: 34px clamp(24px, 4vw, 56px) 64px;
}

.panel-view {
	display: none;
}

.panel-view.is-active {
	display: block;
	animation: view-in 0.35s ease both;
}

.welcome-card {
	position: relative;
	min-height: 245px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	overflow: hidden;
	padding: clamp(28px, 5vw, 52px);
	border-radius: var(--radius-lg);
	color: #fff;
	background:
		radial-gradient(circle at 10% 110%, rgba(234, 175, 200, 0.34), transparent 34%),
		linear-gradient(128deg, #241b3d 0%, #4b397f 54%, #7256ad 100%);
	box-shadow: 0 24px 60px rgba(75, 57, 127, 0.22);
}

.welcome-card::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.15;
	background-image: radial-gradient(#fff 0.6px, transparent 0.6px);
	background-size: 19px 19px;
}

.welcome-card > div:first-child {
	position: relative;
	z-index: 2;
	max-width: 640px;
}

.welcome-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 14px;
	padding: 6px 10px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	font-size: 10px;
}

.welcome-card h2 {
	margin: 0 0 10px;
	font-size: clamp(27px, 4vw, 40px);
	font-weight: 950;
}

.welcome-card p {
	margin: 0 0 24px;
	color: rgba(255, 255, 255, 0.69);
	font-size: 13px;
	line-height: 2;
}

.welcome-orbit {
	position: relative;
	z-index: 1;
	width: 200px;
	height: 200px;
	flex: 0 0 200px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 50%;
}

.welcome-orbit::before,
.welcome-orbit::after {
	content: "";
	position: absolute;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 50%;
}

.welcome-orbit::before {
	width: 145px;
	height: 145px;
}

.welcome-orbit::after {
	width: 260px;
	height: 260px;
}

.welcome-orbit span {
	width: 85px;
	height: 85px;
	display: grid;
	place-items: center;
	border-radius: 26px;
	background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
	color: #fff;
	box-shadow: 0 18px 50px rgba(101, 78, 163, 0.36);
	font-size: 32px;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin-top: 22px;
}

.stat-card {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 108px;
	padding: 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
	transform: translateY(-3px);
	border-color: rgba(101, 78, 163, 0.2);
}

.stat-icon {
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
	display: grid;
	place-items: center;
	border-radius: 16px;
	font-size: 19px;
}

.color-blue { color: var(--info); background: var(--info-soft); }
.color-green { color: var(--success); background: var(--success-soft); }
.color-pink { color: var(--primary); background: var(--primary-soft); }

.stat-card > div {
	min-width: 0;
	flex: 1;
	display: grid;
	gap: 4px;
}

.stat-card small {
	color: var(--text-soft);
	font-size: 11px;
}

.stat-card strong {
	font-size: 26px;
	font-weight: 950;
}

.stat-card > button {
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text-faint);
	transition: color 0.18s ease, transform 0.18s ease;
}

.stat-card > button:hover {
	color: var(--primary);
	transform: translateX(-2px);
}

.overview-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
	gap: 18px;
	margin-top: 18px;
}

.surface {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.surface-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 21px 22px;
	border-bottom: 1px solid var(--border);
}

.surface-heading h3 {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 900;
}

.surface-heading p {
	margin: 0;
	color: var(--text-faint);
	font-size: 10px;
}

.recent-list {
	min-height: 235px;
	padding: 7px 22px;
}

.recent-item {
	display: flex;
	align-items: center;
	gap: 13px;
	width: 100%;
	padding: 14px 0;
	border: 0;
	border-bottom: 1px solid var(--border);
	background: transparent;
	color: var(--text);
	text-align: right;
}

.recent-item:last-child {
	border-bottom: 0;
}

.recent-item:hover .recent-title {
	color: var(--primary);
}

.recent-icon {
	width: 39px;
	height: 39px;
	flex: 0 0 39px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--primary-soft);
	color: var(--primary);
}

.recent-copy {
	min-width: 0;
	flex: 1;
	display: grid;
	gap: 4px;
}

.recent-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 800;
	transition: color 0.18s ease;
}

.recent-meta {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--text-faint);
	font-size: 9px;
}

.membership-card {
	padding-bottom: 20px;
	overflow: hidden;
}

.membership-card .surface-heading {
	border-bottom: 0;
}

.level-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: max-content;
	padding: 6px 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 9px;
	font-weight: 900;
	white-space: nowrap;
}

.level-silver { background: rgba(132, 142, 158, 0.14); color: #778296; border-color: rgba(132, 142, 158, 0.24); }
.level-gold { background: rgba(222, 161, 25, 0.14); color: #c28609; border-color: rgba(222, 161, 25, 0.25); }
.level-diamond { background: rgba(101, 78, 163, 0.13); color: var(--brand-purple); border-color: rgba(101, 78, 163, 0.25); }

.membership-quest {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 5px 22px 17px;
}

.membership-icon {
	width: 50px;
	height: 50px;
	flex: 0 0 50px;
	display: grid;
	place-items: center;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--primary-soft), rgba(234, 175, 200, 0.18));
	color: var(--primary);
	font-size: 20px;
}

.membership-icon.level-icon-silver { background: rgba(132, 142, 158, 0.14); color: #778296; }
.membership-icon.level-icon-gold { background: rgba(222, 161, 25, 0.14); color: #c28609; }
.membership-icon.level-icon-diamond { background: rgba(101, 78, 163, 0.13); color: var(--brand-purple); }

:root[data-theme="dark"] .level-silver,
:root[data-theme="dark"] .membership-icon.level-icon-silver,
:root[data-theme="dark"] .membership-steps span:nth-child(1) { color: #c5cbd5; }

.membership-quest strong {
	display: block;
	font-size: 13px;
}

.membership-quest p {
	margin: 4px 0 0;
	color: var(--text-soft);
	font-size: 10px;
	line-height: 1.8;
}

.membership-progress {
	height: 9px;
	margin: 0 22px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface-3);
}

.membership-progress span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--brand-pink), var(--brand-lilac), var(--brand-purple));
	transition: width 0.5s ease;
}

.membership-steps {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	padding: 9px 22px 18px;
	color: var(--text-faint);
	font-size: 8px;
}

.membership-steps span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.membership-steps span:nth-child(1) { color: #778296; }
.membership-steps span:nth-child(2) { color: #c28609; }
.membership-steps span:nth-child(3) { color: var(--brand-purple); }

.membership-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0 22px;
}

.membership-actions .button {
	width: 100%;
	padding-inline: 10px;
	font-size: 11px;
}

.level-benefits-intro {
	margin: 0 0 18px;
	color: var(--text-soft);
	font-size: 11px;
	line-height: 2;
}

.level-benefits-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.level-benefit-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--surface-2);
}

.level-benefit-card.is-current {
	border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
	box-shadow: 0 0 0 3px var(--primary-soft);
}

.level-benefit-card.is-current::after {
	content: "سطح فعلی";
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 7px;
	border-radius: 999px;
	background: var(--primary-soft);
	color: var(--primary);
	font-size: 8px;
	font-weight: 900;
}

.level-benefit-card > span {
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--surface-3);
	color: var(--text-soft);
}

.level-benefit-gold > span { color: #c28609; background: rgba(222, 161, 25, 0.14); }
.level-benefit-diamond > span { color: var(--brand-purple); background: rgba(101, 78, 163, 0.13); }

.level-benefit-card h3 {
	margin: 0 0 3px;
	font-size: 13px;
}

.level-benefit-card small {
	color: var(--text-faint);
	font-size: 9px;
}

.level-benefit-card ul {
	display: grid;
	gap: 7px;
	margin: 13px 0 0;
	padding: 0;
	list-style: none;
	color: var(--text-soft);
	font-size: 9px;
}

.level-benefit-card li {
	display: flex;
	align-items: center;
	gap: 5px;
}

.level-benefit-card li::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--primary);
}

.section-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 22px;
}

.section-heading h2 {
	margin: 0 0 7px;
	font-size: 25px;
	font-weight: 950;
}

.section-heading p {
	margin: 0;
	color: var(--text-soft);
	font-size: 12px;
	line-height: 1.8;
}

.section-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 9px;
	flex-wrap: wrap;
}

.info-banner {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	margin-bottom: 16px;
	padding: 13px 16px;
	border: 1px solid rgba(37, 133, 200, 0.15);
	border-radius: 13px;
	background: var(--info-soft);
	color: var(--info);
}

.info-banner p {
	margin: 0;
	font-size: 11px;
	line-height: 1.8;
}

/* Announcement and manager settings */
.panel-announcement {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 22px;
	padding: 17px 19px;
	overflow: hidden;
	border: 1px solid rgba(37, 133, 200, 0.2);
	border-radius: var(--radius);
	background: linear-gradient(135deg, var(--info-soft), var(--surface));
	box-shadow: var(--shadow-sm);
}

.panel-announcement::after {
	content: "";
	position: absolute;
	top: -35px;
	left: -25px;
	width: 105px;
	height: 105px;
	border-radius: 50%;
	background: rgba(101, 78, 163, 0.08);
}

.announcement-icon,
.settings-icon {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	border-radius: 13px;
	background: var(--info-soft);
	color: var(--info);
}

.panel-announcement > div {
	position: relative;
	z-index: 1;
}

.panel-announcement strong {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
}

.panel-announcement p {
	margin: 0;
	color: var(--text-soft);
	font-size: 11px;
	line-height: 1.95;
	white-space: pre-wrap;
	word-break: break-word;
}

.settings-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
	gap: 18px;
}

.settings-card {
	padding: 24px;
}

.settings-card-head {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	margin-bottom: 22px;
}

.settings-card-head h3 {
	margin: 1px 0 5px;
	font-size: 16px;
	font-weight: 900;
}

.settings-card-head p,
.danger-list p {
	margin: 0;
	color: var(--text-soft);
	font-size: 10px;
	line-height: 1.9;
}

.danger-icon {
	background: var(--danger-soft);
	color: var(--danger);
}

.settings-form {
	display: grid;
	gap: 10px;
}

.settings-form > label {
	font-size: 12px;
	font-weight: 800;
}

.settings-form textarea {
	min-height: 180px;
}

.settings-form-meta,
.settings-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.settings-form-meta {
	color: var(--text-faint);
	font-size: 9px;
	line-height: 1.8;
}

.settings-actions {
	justify-content: flex-start;
	margin-top: 7px;
}

.storage-stat-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.storage-stat-grid article {
	display: flex;
	align-items: center;
	gap: 13px;
	min-width: 0;
	padding: 17px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.storage-stat-grid article > i {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	border-radius: 13px;
	background: var(--primary-soft);
	color: var(--primary);
}

.storage-stat-grid span {
	min-width: 0;
	display: grid;
	gap: 3px;
}

.storage-stat-grid small {
	color: var(--text-faint);
	font-size: 9px;
}

.storage-stat-grid strong {
	overflow: hidden;
	font-size: 17px;
	font-weight: 950;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.staff-overview-card {
	margin-top: 18px;
	overflow: hidden;
}

.staff-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 22px 24px 4px;
}

.staff-section-head .settings-card-head {
	min-width: 0;
	margin-bottom: 0;
}

.staff-section-head .button {
	flex: 0 0 auto;
}

.staff-icon {
	background: linear-gradient(135deg, var(--primary-soft), rgba(234, 175, 200, 0.14));
	color: var(--primary);
}

.staff-name-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}

.staff-name-cell > span:last-child {
	display: grid;
	gap: 2px;
}

.staff-name-cell strong {
	color: var(--text);
	font-size: 11px;
}

.staff-name-cell small {
	color: var(--text-faint);
	font-size: 8px;
}

.staff-avatar {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	display: grid;
	place-items: center;
	border-radius: 11px;
	background: var(--success-soft);
	color: var(--success);
}

.staff-avatar.is-manager {
	background: var(--info-soft);
	color: var(--info);
}

.key-creator-card {
	display: grid;
	grid-template-columns: minmax(280px, 0.7fr) minmax(300px, 1.3fr);
	align-items: start;
	gap: 28px;
}

.key-creator-card .settings-form small {
	color: var(--text-faint);
	font-size: 9px;
}

.key-creator-card .settings-form .button {
	width: max-content;
	margin-top: 6px;
}

.key-result {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	min-width: 0;
	padding: 17px;
	border: 1px solid rgba(21, 155, 115, 0.2);
	border-radius: 15px;
	background: var(--success-soft);
}

.key-result-icon {
	width: 43px;
	height: 43px;
	display: grid;
	place-items: center;
	border-radius: 13px;
	background: var(--surface);
	color: var(--success);
}

.key-result > div {
	min-width: 0;
	display: grid;
	gap: 4px;
}

.key-result small {
	color: var(--text-soft);
	font-size: 9px;
}

.key-result .activation-code {
	display: block;
	overflow-wrap: anywhere;
	color: var(--text);
	font: 800 18px/1.7 Consolas, "Courier New", monospace;
	letter-spacing: 0.06em;
	text-align: left;
	unicode-bidi: isolate;
}

.key-result p {
	margin: 0;
	color: var(--text-soft);
	font-size: 9px;
	line-height: 1.9;
}

.activation-code-row {
	direction: rtl;
}

.activation-code {
	direction: ltr;
	font-family: Consolas, "Courier New", monospace;
	letter-spacing: 0.02em;
	unicode-bidi: isolate;
}

.danger-list {
	display: grid;
	gap: 12px;
}

.danger-list article {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 15px;
	border: 1px solid rgba(214, 69, 69, 0.16);
	border-radius: 13px;
	background: var(--danger-soft);
}

.danger-list article > div {
	min-width: 0;
}

.danger-list strong {
	display: block;
	margin-bottom: 3px;
	font-size: 11px;
}

.danger-list .button {
	flex: 0 0 auto;
	min-height: 38px;
	font-size: 11px;
}

/* Data tables */
.table-loading-state,
.table-load-error {
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	padding: 28px;
	color: var(--text-soft);
	font-size: 11px;
	text-align: center;
}

.table-loading-state span {
	width: 24px;
	height: 24px;
	border: 2px solid var(--border);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.72s linear infinite;
}

.table-load-error {
	flex-direction: column;
}

.table-load-error > i {
	color: var(--danger);
	font-size: 25px;
}

.table-load-error strong {
	max-width: 480px;
	line-height: 1.9;
}

.table-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 17px 20px;
	border-bottom: 1px solid var(--border);
}

.table-search {
	position: relative;
	width: min(350px, 100%);
}

.table-search i {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	color: var(--text-faint);
	font-size: 13px;
}

.table-search input {
	width: 100%;
	height: 42px;
	border: 1px solid var(--border);
	border-radius: 11px;
	padding: 0 39px 0 13px;
	background: var(--surface-2);
	color: var(--text);
	font-size: 12px;
	outline: 0;
}

.table-search input:focus {
	border-color: rgba(101, 78, 163, 0.42);
	box-shadow: 0 0 0 3px var(--primary-soft);
}

.table-total {
	color: var(--text-faint);
	font-size: 10px;
	white-space: nowrap;
}

.table-scroll {
	width: 100%;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
}

.data-table {
	width: 100%;
	min-width: 810px;
	border-collapse: collapse;
	border-spacing: 0;
	text-align: right;
}

.data-table th {
	height: 48px;
	padding: 0 18px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text-soft);
	font-size: 10px;
	font-weight: 800;
	white-space: nowrap;
}

.sort-button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 0;
	padding: 0;
	background: transparent;
	color: inherit;
	font: inherit;
}

.sort-button i {
	font-size: 9px;
	opacity: 0.45;
}

.sort-button.is-sorted {
	color: var(--primary);
}

.sort-button.is-sorted i {
	opacity: 1;
}

.sort-order {
	min-width: 17px;
	height: 17px;
	display: inline-grid;
	place-items: center;
	border-radius: 6px;
	background: var(--primary);
	color: #fff;
	font-size: 8px;
	font-weight: 900;
}

.data-table td {
	padding: 15px 18px;
	border-bottom: 1px solid var(--border);
	color: var(--text-soft);
	font-size: 11px;
	line-height: 1.75;
	vertical-align: middle;
}

.data-table tbody tr {
	transition: background 0.16s ease;
}

.data-table tbody tr:hover {
	background: var(--surface-2);
}

.data-table tbody tr:last-child td {
	border-bottom: 0;
}

.cell-main {
	display: block;
	color: var(--text);
	font-size: 11px;
	font-weight: 800;
}

.cell-sub {
	display: block;
	max-width: 340px;
	margin-top: 3px;
	overflow: hidden;
	color: var(--text-faint);
	font-size: 9px;
	line-height: 1.65;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mono {
	direction: ltr;
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 10px;
	text-align: right;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 9px;
	font-weight: 800;
	white-space: nowrap;
}

.badge::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.badge-neutral { color: var(--text-soft); background: var(--surface-3); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }

.current-device {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-right: 6px;
	padding: 3px 7px;
	border-radius: 999px;
	background: var(--success-soft);
	color: var(--success);
	font-size: 8px;
	font-weight: 800;
}

.table-actions {
	display: flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.table-action {
	min-height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 5px 10px;
	background: var(--surface);
	color: var(--text-soft);
	font-size: 9px;
	font-weight: 800;
}

.table-action:hover {
	color: var(--primary);
	border-color: rgba(101, 78, 163, 0.3);
}

.table-action.is-danger:hover {
	color: var(--danger);
	border-color: rgba(214, 69, 69, 0.25);
	background: var(--danger-soft);
}

.smart-time {
	display: inline-block;
	min-width: 115px;
	cursor: help;
	border-bottom: 1px dashed var(--text-faint);
	color: var(--text-soft);
	white-space: nowrap;
}

.table-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 20px;
	border-top: 1px solid var(--border);
}

.pagination-info {
	color: var(--text-faint);
	font-size: 9px;
}

.pagination-buttons {
	display: flex;
	align-items: center;
	gap: 5px;
	direction: rtl;
}

.pagination-buttons button {
	min-width: 31px;
	height: 31px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface);
	color: var(--text-soft);
	font-size: 10px;
}

.pagination-buttons button:hover:not(:disabled),
.pagination-buttons button.is-active {
	border-color: transparent;
	background: var(--primary-soft);
	color: var(--primary);
}

.pagination-buttons button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.empty-state {
	min-height: 300px;
	display: grid;
	place-items: center;
	padding: 42px 20px;
	text-align: center;
}

.empty-state > div {
	max-width: 340px;
}

.empty-icon {
	position: relative;
	width: 76px;
	height: 76px;
	display: grid;
	place-items: center;
	margin: 0 auto 18px;
	border-radius: 24px;
	background: var(--surface-3);
	color: var(--text-faint);
	font-size: 28px;
}

.empty-icon::after {
	content: "";
	position: absolute;
	inset: -8px;
	border: 1px dashed var(--border);
	border-radius: 29px;
}

.empty-state h3 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 900;
}

.empty-state p {
	margin: 0;
	color: var(--text-faint);
	font-size: 11px;
	line-height: 1.9;
}

/* Dialogs and tickets */
.panel-dialog {
	width: min(610px, calc(100% - 28px));
	max-height: min(880px, calc(100vh - 28px));
	max-height: min(880px, calc(100dvh - 28px));
	padding: 0;
	border: 0;
	border-radius: 22px;
	background: transparent;
	color: var(--text);
	overflow: visible;
}

.panel-dialog-wide {
	width: min(820px, calc(100% - 28px));
}

.panel-dialog-small {
	width: min(420px, calc(100% - 28px));
}

.panel-dialog::backdrop {
	background: rgba(10, 12, 18, 0.64);
	backdrop-filter: blur(5px);
}

.panel-dialog[open] .dialog-card {
	animation: dialog-in 0.26s cubic-bezier(0.22, 0.82, 0.3, 1) both;
}

.dialog-card {
	max-height: min(880px, calc(100dvh - 28px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 22px;
	background: var(--surface);
	box-shadow: var(--shadow-lg);
}

.dialog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 23px 24px 19px;
	border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 950;
}

.dialog-body {
	overflow-y: auto;
	padding: 22px 24px;
}

.dialog-body small {
	color: var(--text-faint);
	font-size: 9px;
	line-height: 1.8;
}

.dialog-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 9px;
	padding: 16px 24px;
	border-top: 1px solid var(--border);
	background: var(--surface-2);
}

.required {
	color: var(--danger);
}

.optional {
	margin-right: 5px;
	color: var(--text-faint);
	font-size: 9px;
	font-weight: 500;
}

.counter {
	justify-self: end;
	direction: ltr;
}

.upload-zone {
	min-height: 128px;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 6px;
	border: 1px dashed #c9ccd5;
	border-radius: 15px;
	padding: 18px;
	background: var(--surface-2);
	color: var(--text-soft);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
	border-color: var(--primary);
	background: var(--primary-soft);
	color: var(--primary);
}

.upload-zone > i {
	font-size: 25px;
}

.upload-zone strong {
	font-size: 12px;
}

.upload-zone span,
.upload-zone small {
	font-size: 9px;
}

.ticket-limit-note {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0;
	padding: 11px 13px;
	border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
	border-radius: 12px;
	background: var(--primary-soft);
	color: var(--text-soft);
	font-size: 10px;
	line-height: 1.9;
}

.ticket-limit-note[hidden] {
	display: none;
}

.ticket-limit-note > i {
	margin-top: 4px;
	color: var(--primary);
}

.ticket-limit-note.is-compact {
	margin-top: 10px;
	padding: 8px 11px;
}

.ticket-thread {
	min-height: 420px;
}

.ticket-meta-card {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 20px;
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface-2);
}

.ticket-meta-card > div {
	display: grid;
	gap: 4px;
}

.ticket-meta-card small {
	color: var(--text-faint);
	font-size: 9px;
}

.ticket-meta-card strong {
	font-size: 11px;
	font-weight: 800;
}

.status-control {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 13px;
	background: var(--surface-2);
}

.status-control label {
	font-size: 10px;
	font-weight: 800;
}

.status-control select {
	min-width: 0;
	flex: 1;
	height: 37px;
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 0 9px;
	background: var(--surface);
	color: var(--text);
	font-size: 10px;
}

.messages-list {
	display: grid;
	gap: 13px;
}

.message-bubble {
	max-width: 84%;
	padding: 13px 15px;
	border: 1px solid var(--border);
	border-radius: 16px 16px 5px 16px;
	background: var(--surface-2);
}

.message-bubble.is-supporter {
	margin-right: auto;
	border-color: rgba(101, 78, 163, 0.18);
	border-radius: 16px 16px 16px 5px;
	background: var(--primary-soft);
}

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

.message-head strong {
	font-size: 10px;
	font-weight: 900;
}

.message-head time {
	font-size: 8px;
}

.message-body {
	margin: 0;
	color: var(--text);
	font-size: 11px;
	line-height: 2;
	white-space: pre-wrap;
	word-break: break-word;
}

.attachment-list {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 10px;
}

.attachment-button {
	max-width: 100%;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 6px 9px;
	background: var(--surface);
	color: var(--text-soft);
	font-size: 8px;
}

.attachment-button span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.attachment-button:hover:not(:disabled) {
	color: var(--primary);
	border-color: rgba(101, 78, 163, 0.3);
}

.attachment-preview-content {
	min-height: 260px;
	display: grid;
	place-items: center;
	background: var(--surface-2);
}

.attachment-preview-content > img,
.attachment-preview-content > video {
	display: block;
	max-width: 100%;
	max-height: min(66vh, 620px);
	border-radius: 14px;
	background: #0c0c10;
	box-shadow: var(--shadow-sm);
}

.attachment-preview-content > video {
	width: 100%;
}

.audio-preview,
.preview-unavailable {
	width: min(460px, 100%);
	display: grid;
	justify-items: center;
	gap: 14px;
	padding: 28px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	text-align: center;
}

.audio-preview > span,
.preview-unavailable > i {
	width: 68px;
	height: 68px;
	display: grid;
	place-items: center;
	border-radius: 22px;
	background: var(--primary-soft);
	color: var(--primary);
	font-size: 27px;
}

.audio-preview strong {
	max-width: 100%;
	overflow-wrap: anywhere;
	font-size: 12px;
}

.audio-preview audio {
	width: 100%;
}

.preview-unavailable p {
	margin: 0;
	color: var(--text-soft);
	font-size: 11px;
}

.reply-box {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--border);
}

.reply-box textarea {
	min-height: 100px;
}

.reply-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 10px;
}

.reply-file-label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--text-soft);
	font-size: 10px;
	cursor: pointer;
}

.reply-file-label:hover {
	color: var(--primary);
}

.confirm-icon {
	width: 66px;
	height: 66px;
	display: grid;
	place-items: center;
	margin: 28px auto 15px;
	border-radius: 21px;
	background: var(--warning-soft);
	color: var(--warning);
	font-size: 25px;
}

.confirm-copy {
	padding: 0 26px 25px;
	text-align: center;
}

.confirm-copy h2 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 950;
}

.confirm-copy p {
	margin: 0;
	color: var(--text-soft);
	font-size: 11px;
	line-height: 1.9;
}

.skeleton-lines {
	display: grid;
	gap: 13px;
}

.skeleton-lines span,
.loading-block::before {
	background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
	background-size: 200% 100%;
	animation: shimmer 1.4s infinite;
}

.skeleton-lines span {
	height: 70px;
	border-radius: 14px;
}

.loading-block {
	position: relative;
}

.loading-block::before {
	content: "";
	position: absolute;
	inset: 20px;
	border-radius: 13px;
}

/* Notifications and global states */
.toast-region {
	position: fixed;
	z-index: 100;
	top: 20px;
	left: 20px;
	width: min(365px, calc(100% - 40px));
	display: grid;
	gap: 9px;
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 13px 15px;
	border: 1px solid var(--border);
	border-radius: 13px;
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	pointer-events: auto;
	animation: toast-in 0.3s ease both;
}

.toast.is-leaving {
	animation: toast-out 0.25s ease both;
}

.toast > i {
	margin-top: 3px;
	color: var(--success);
}

.toast.is-error > i {
	color: var(--danger);
}

.toast strong {
	display: block;
	margin-bottom: 2px;
	font-size: 11px;
}

.toast p {
	margin: 0;
	color: var(--text-soft);
	font-size: 9px;
	line-height: 1.7;
}

.global-loader {
	position: fixed;
	z-index: 90;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(14, 16, 22, 0.18);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}

.global-loader.is-visible {
	opacity: 1;
	visibility: visible;
}

.global-loader span {
	width: 42px;
	height: 42px;
	border: 3px solid rgba(101, 78, 163, 0.22);
	border-top-color: var(--brand-purple);
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
}

:root[data-theme="dark"] .global-loader span {
	border-color: rgba(234, 175, 200, 0.24);
	border-top-color: var(--brand-pink);
}

.noscript-message {
	position: fixed;
	z-index: 200;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 30px;
	background: var(--bg);
	color: var(--text);
	font-weight: 800;
	text-align: center;
}

.mobile-overlay,
.mobile-bottom-nav {
	display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translate3d(24px, -18px, 0) scale(1.06); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-16px); } }

@media (max-width: 1100px) {
	:root { --sidebar-width: 240px; }
	.panel-sidebar { padding-inline: 14px; }
	.panel-nav-item.is-active::before { right: -14px; }
	.overview-grid { grid-template-columns: 1fr; }
	.settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
	.auth-card { grid-template-columns: 1fr; width: min(560px, 100%); }
	.auth-brand { min-height: 280px; padding: 34px; }
	.auth-brand h1 { margin-top: 32px; font-size: 30px; }
	.auth-benefits { display: none; }
	.auth-form-side { padding: 38px 34px 42px; }

	.panel-sidebar {
		width: min(294px, calc(100vw - 54px));
		transform: translateX(110%);
		box-shadow: -24px 0 60px rgba(0, 0, 0, 0.18);
	}
	.panel-app.menu-open .panel-sidebar { transform: translateX(0); }
	.mobile-overlay {
		position: fixed;
		z-index: 35;
		inset: 0;
		display: block;
		background: rgba(10, 12, 18, 0.52);
		opacity: 0;
		visibility: hidden;
		backdrop-filter: blur(3px);
		transition: opacity 0.22s ease, visibility 0.22s ease;
	}
	.panel-app.menu-open .mobile-overlay { opacity: 1; visibility: visible; }
	.panel-main { margin-right: 0; }
	.menu-toggle { display: inline-grid; }
	.panel-content { padding-bottom: 102px; }
	.mobile-bottom-nav {
		position: fixed;
		z-index: 32;
		right: 13px;
		bottom: max(12px, env(safe-area-inset-bottom));
		left: 13px;
		height: 67px;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		align-items: center;
		padding: 6px 9px;
		border: 1px solid var(--border);
		border-radius: 19px;
		background: var(--surface);
		background: color-mix(in srgb, var(--surface) 90%, transparent);
		box-shadow: var(--shadow-lg);
		backdrop-filter: blur(18px);
	}
	.mobile-bottom-nav button {
		height: 52px;
		display: grid;
		place-items: center;
		align-content: center;
		gap: 4px;
		border: 0;
		border-radius: 13px;
		background: transparent;
		color: var(--text-faint);
		font-size: 9px;
	}
	.mobile-bottom-nav button i { font-size: 15px; }
	.mobile-bottom-nav button.is-active { color: var(--primary); background: var(--primary-soft); }
	.mobile-bottom-nav .mobile-create {
		width: 52px;
		margin: -24px auto 0;
		border-radius: 17px;
		background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
		color: #fff;
		box-shadow: 0 10px 25px rgba(101, 78, 163, 0.3);
	}
	.mobile-bottom-nav .mobile-create span { display: none; }
	.key-creator-card { grid-template-columns: 1fr; }
	.level-benefits-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
	.auth-page { display: block; padding: 76px 14px 74px; }
	.auth-theme { top: 15px; left: 15px; }
	.auth-card { min-height: 0; border-radius: 23px; }
	.auth-brand { min-height: 220px; padding: 28px 25px; }
	.brand-mark { width: 54px; height: 54px; border-radius: 15px; }
	.brand-mark img { width: 42px; height: 42px; }
	.auth-brand h1 { margin-top: 25px; font-size: 25px; }
	.auth-brand p { font-size: 12px; }
	.auth-form-side { padding: 32px 23px 35px; }
	.auth-form-header h2 { font-size: 24px; }

	.panel-header { height: 70px; padding: 0 15px; }
	.panel-header .icon-button,
	.panel-header .theme-toggle { width: 38px; height: 38px; flex-basis: 38px; }
	.header-start h1 { font-size: 16px; }
	.header-start .eyebrow { display: none; }
	.header-actions { gap: 7px; }
	.panel-content { padding: 22px 14px 100px; }
	.welcome-card { min-height: 260px; padding: 27px 22px; }
	.welcome-card h2 { font-size: 27px; }
	.welcome-orbit { position: absolute; left: -70px; bottom: -82px; opacity: 0.5; }
	.stat-grid { grid-template-columns: 1fr; gap: 10px; }
	.stat-card { min-height: 90px; padding: 16px; }
	.stat-icon { width: 46px; height: 46px; flex-basis: 46px; border-radius: 14px; }
	.stat-card strong { font-size: 22px; }
	.overview-grid { gap: 12px; margin-top: 12px; }
	.membership-steps { display: grid; grid-template-columns: 1fr; gap: 7px; font-size: 8px; }
	.membership-actions { grid-template-columns: 1fr; }
	.surface-heading { padding: 18px 16px; }
	.recent-list { padding-inline: 16px; }
	.section-heading { align-items: stretch; flex-direction: column; gap: 14px; }
	.section-heading h2 { font-size: 21px; }
	.section-heading .button { align-self: flex-start; }
	.section-actions { justify-content: flex-start; }
	.panel-announcement { margin-bottom: 16px; padding: 15px; }
	.settings-card { padding: 18px 16px; }
	.storage-stat-grid { grid-template-columns: 1fr; gap: 9px; }
	.staff-section-head { align-items: stretch; flex-direction: column; padding: 18px 16px 4px; }
	.staff-section-head .button { align-self: flex-start; }
	.key-creator-card { gap: 18px; }
	.key-result { grid-template-columns: auto minmax(0, 1fr); }
	.key-result .button { grid-column: 1 / -1; width: 100%; }
	.settings-form-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
	.danger-list article { align-items: stretch; flex-direction: column; }
	.danger-list .button { align-self: flex-start; }
	.table-toolbar { align-items: stretch; flex-direction: column; padding: 14px; }
	.table-search { width: 100%; }
	.table-total { padding-right: 2px; }
	.data-table th { padding-inline: 14px; }
	.data-table td { padding: 13px 14px; }
	.table-pagination { align-items: flex-start; flex-direction: column; padding: 13px 14px; }
	.pagination-buttons { width: 100%; justify-content: center; }
	.panel-dialog { width: 100%; max-width: none; max-height: 100vh; max-height: 100dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
	.panel-dialog::backdrop { background: rgba(10, 12, 18, 0.68); }
	.dialog-card { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); border-radius: 22px 22px 0 0; border-bottom: 0; }
	.dialog-header { padding: 20px 17px 16px; }
	.dialog-body { padding: 18px 17px; }
	.dialog-footer { padding: 14px 17px calc(14px + env(safe-area-inset-bottom)); }
	.ticket-meta-card { grid-template-columns: 1fr 1fr; }
	.message-bubble { max-width: 94%; }
	.toast-region { top: 12px; left: 12px; width: calc(100% - 24px); }
}

@media (max-width: 410px) {
	.auth-secondary { align-items: flex-start; flex-direction: column; }
	.ticket-meta-card { grid-template-columns: 1fr; }
	.dialog-footer .button { flex: 1; }
	.header-start { gap: 7px; min-width: 0; }
	.header-start > div { min-width: 0; }
	.header-start h1 { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.header-actions { gap: 4px; }
	.reply-actions { align-items: stretch; flex-direction: column; }
	.reply-actions .button { width: 100%; }
	.settings-actions { align-items: stretch; flex-direction: column; }
	.settings-actions .button,
	.danger-list .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media print {
	.panel-sidebar,
	.panel-header,
	.mobile-bottom-nav,
	.table-toolbar,
	.table-pagination,
	.table-actions,
	.button {
		display: none !important;
	}
	.panel-main { margin: 0; }
	.panel-content { padding: 0; }
	.panel-view { display: none !important; }
	.panel-view.is-active { display: block !important; }
	.surface { box-shadow: none; }
}
