/* ============================================================
   Application Styles — Layout, Components, Animations
   ============================================================ */

/* --- Reset --- */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-family);
	font-size: var(--font-size-base);
	line-height: var(--line-height);
	color: var(--color-text);
	background-color: var(--color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--color-primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	display: block;
}

button {
	font-family: inherit;
	cursor: pointer;
	border: none;
	background: none;
}

input, select, textarea {
	font-family: inherit;
	font-size: inherit;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* --- Login Page --- */
.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
	padding: var(--space-4);
}

.login-card {
	width: 100%;
	max-width: 400px;
	background: var(--color-surface);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-xl);
	padding: var(--space-8);
	animation: fadeInUp var(--animation-slow) var(--ease-out);
}

.login-card__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-3);
	margin-bottom: var(--space-6);
}

.login-card__logo img {
	width: 40px;
	height: 40px;
}

.login-card__logo span {
	font-size: var(--font-size-xl);
	font-weight: 700;
	color: var(--color-text);
}

.login-card__title {
	font-size: var(--font-size-lg);
	font-weight: 600;
	text-align: center;
	margin-bottom: var(--space-6);
	color: var(--color-text);
}

.login-card__form {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.login-card__remember {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
	cursor: pointer;
}

.login-card__remember input {
	accent-color: var(--color-primary);
	width: 16px;
	height: 16px;
}

.login-card__submit {
	width: 100%;
	height: 44px;
	background: var(--color-primary);
	color: var(--color-primary-text);
	border: none;
	border-radius: var(--radius-md);
	font-size: var(--font-size-base);
	font-weight: 600;
	cursor: pointer;
	transition: background var(--animation-fast) ease;
	position: relative;
}

.login-card__submit:hover {
	background: var(--color-primary-hover);
}

.login-card__submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.login-card__submit.loading::after {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: rotate 0.6s linear infinite;
}

.login-card__forgot {
	display: block;
	text-align: center;
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
	margin-top: var(--space-2);
}

.login-card__error {
	font-size: var(--font-size-sm);
	color: var(--color-error);
	text-align: center;
	min-height: 1.25rem;
}

.login-card__footer {
	margin-top: var(--space-6);
	text-align: center;
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

/* --- Layout: Sidebar --- */
.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--sidebar-width);
	background: var(--sidebar-bg);
	color: var(--sidebar-text);
	z-index: var(--z-sticky);
	display: flex;
	flex-direction: column;
	transition: transform var(--animation-normal) var(--ease-out), width var(--animation-normal) var(--ease-out);
	overflow-x: hidden;
}

.sidebar.collapsed {
	width: var(--sidebar-collapsed);
}

.sidebar__brand {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-4) var(--space-4);
	height: 56px;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	flex-shrink: 0;
}

.sidebar__brand img {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}

.sidebar__brand-text {
	font-size: var(--font-size-lg);
	font-weight: 700;
	color: white;
	white-space: nowrap;
	transition: opacity var(--animation-fast) ease;
}

.sidebar.collapsed .sidebar__brand-text {
	opacity: 0;
}

.sidebar__nav {
	flex: 1;
	padding: var(--space-2) 0;
	overflow-y: auto;
}

.sidebar__section {
	padding: var(--space-2) var(--space-3);
}

.sidebar__section-title {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-text-muted);
	padding: var(--space-2) var(--space-3);
	margin-bottom: var(--space-1);
}

.sidebar__link {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-md);
	color: var(--sidebar-text);
	font-size: var(--font-size-sm);
	transition: all var(--animation-fast) ease;
	white-space: nowrap;
	margin: 2px var(--space-2);
}

.sidebar__link:hover {
	background: rgba(255,255,255,0.08);
	color: var(--sidebar-text-hover);
	text-decoration: none;
}

.sidebar__link.active {
	background: var(--sidebar-active);
	color: white;
	font-weight: 600;
}

.sidebar__icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sidebar__icon svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sidebar__label {
	transition: opacity var(--animation-fast) ease;
}

.sidebar.collapsed .sidebar__label,
.sidebar.collapsed .sidebar__section-title {
	opacity: 0;
	pointer-events: none;
}

.sidebar__footer {
	padding: var(--space-3) var(--space-4);
	border-top: 1px solid rgba(255,255,255,0.08);
}

/* --- Layout: Main wrapper --- */
.main-wrapper {
	margin-left: var(--sidebar-width);
	min-height: 100vh;
	transition: margin-left var(--animation-normal) var(--ease-out);
}

.sidebar.collapsed ~ .main-wrapper,
.main-wrapper.sidebar-collapsed {
	margin-left: var(--sidebar-collapsed);
}

/* --- Layout: Top bar --- */
.topbar {
	position: sticky;
	top: 0;
	height: 56px;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	padding: 0 var(--space-6);
	gap: var(--space-4);
	z-index: var(--z-sticky);
}

.topbar__hamburger {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-md);
	color: var(--color-text-secondary);
	transition: background var(--animation-fast) ease;
}

.topbar__hamburger:hover {
	background: var(--color-bg);
}

.topbar__hamburger svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

.topbar__search {
	flex: 1;
	max-width: 400px;
	position: relative;
}

.topbar__search input {
	width: 100%;
	height: 36px;
	padding: 0 var(--space-4) 0 36px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-full);
	background: var(--color-bg);
	color: var(--color-text);
	font-size: var(--font-size-sm);
	transition: border-color var(--animation-fast) ease, box-shadow var(--animation-fast) ease;
}

.topbar__search input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px var(--color-primary-light);
}

.topbar__search input::placeholder {
	color: var(--color-text-muted);
}

.topbar__search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--color-text-muted);
}

.topbar__search-icon svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

.topbar__actions {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	margin-left: auto;
}

.topbar__btn {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-md);
	color: var(--color-text-secondary);
	position: relative;
	transition: background var(--animation-fast) ease;
}

.topbar__btn:hover {
	background: var(--color-bg);
}

.topbar__btn svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
}

.topbar__user {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-1) var(--space-2);
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: background var(--animation-fast) ease;
}

.topbar__user:hover {
	background: var(--color-bg);
}

.topbar__avatar {
	width: 32px;
	height: 32px;
	border-radius: var(--radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: white;
	flex-shrink: 0;
}

.topbar__username {
	font-size: var(--font-size-sm);
	font-weight: 500;
	color: var(--color-text);
}

/* --- Layout: Content --- */
.content {
	padding: var(--space-6);
	max-width: 1400px;
	animation: pageEnter var(--animation-normal) var(--ease-out);
}

.page-leave {
	animation: pageLeave var(--animation-normal) var(--ease-in-out) forwards;
}

.page-enter {
	animation: pageEnter var(--animation-normal) var(--ease-out);
}

.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--space-6);
}

.page-header h1 {
	font-size: var(--font-size-2xl);
	font-weight: 700;
	color: var(--color-text);
}

/* --- Cards --- */
.card {
	background: var(--color-surface);
	border-radius: var(--radius-lg);
	border: 1px solid var(--color-border);
	overflow: hidden;
}

.card__header {
	padding: var(--space-4) var(--space-5);
	border-bottom: 1px solid var(--color-border);
	font-weight: 600;
	font-size: var(--font-size-sm);
	color: var(--color-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card__body {
	padding: var(--space-5);
}

/* Stat cards grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-4);
	margin-bottom: var(--space-6);
}

.stat-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: var(--space-5);
	transition: box-shadow var(--animation-fast) ease;
}

.stat-card:hover {
	box-shadow: var(--shadow-md);
}

.stat-card__icon {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-3);
}

.stat-card__icon svg {
	width: 20px;
	height: 20px;
	stroke-width: 2;
}

.stat-card__value {
	font-size: var(--font-size-3xl);
	font-weight: 700;
	color: var(--color-text);
	line-height: 1;
	margin-bottom: var(--space-1);
}

.stat-card__label {
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
}

.stat-card__trend {
	font-size: var(--font-size-xs);
	font-weight: 500;
	margin-top: var(--space-2);
}

.stat-card__trend--up {
	color: var(--color-success);
}

.stat-card__trend--down {
	color: var(--color-error);
}

/* --- Data Grid --- */
.datagrid-wrapper {
	overflow: hidden;
}

.datagrid-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	margin-bottom: var(--space-4);
	flex-wrap: wrap;
}

.datagrid-filters {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.datagrid-search {
	position: relative;
}

.datagrid-search input {
	height: 36px;
	padding: 0 var(--space-4) 0 36px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	font-size: var(--font-size-sm);
	background: var(--color-surface);
	color: var(--color-text);
	min-width: 220px;
}

.datagrid-search input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px var(--color-primary-light);
}

.datagrid-search svg {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	stroke: var(--color-text-muted);
	fill: none;
	stroke-width: 2;
}

.datagrid {
	overflow-x: auto;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.datagrid table {
	width: 100%;
	border-collapse: collapse;
}

.datagrid th {
	background: var(--color-bg);
	padding: var(--space-3) var(--space-4);
	font-size: var(--font-size-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-text-secondary);
	text-align: left;
	white-space: nowrap;
	position: sticky;
	top: 0;
	border-bottom: 1px solid var(--color-border);
	user-select: none;
}

.datagrid th.sortable {
	cursor: pointer;
}

.datagrid th.sortable:hover {
	color: var(--color-text);
}

.datagrid th .sort-icon {
	display: inline-block;
	margin-left: 4px;
	opacity: 0.4;
	font-size: 10px;
}

.datagrid th.sort-asc .sort-icon,
.datagrid th.sort-desc .sort-icon {
	opacity: 1;
	color: var(--color-primary);
}

.datagrid td {
	padding: var(--space-3) var(--space-4);
	font-size: var(--font-size-sm);
	border-bottom: 1px solid var(--color-border);
	color: var(--color-text);
	white-space: nowrap;
}

.datagrid tbody tr {
	transition: background var(--animation-fast) ease;
}

.datagrid tbody tr:hover {
	background: var(--color-primary-light);
}

.datagrid tbody tr:last-child td {
	border-bottom: none;
}

.datagrid .row-actions {
	display: flex;
	gap: var(--space-1);
}

.datagrid .row-actions button {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	color: var(--color-text-muted);
	transition: all var(--animation-fast) ease;
}

.datagrid .row-actions button:hover {
	background: var(--color-bg);
	color: var(--color-text);
}

.datagrid .row-actions button svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

/* --- Pagination --- */
.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-3) 0;
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
}

.pagination__info {
	white-space: nowrap;
}

.pagination__buttons {
	display: flex;
	gap: var(--space-1);
}

.pagination__btn {
	min-width: 32px;
	height: 32px;
	padding: 0 var(--space-2);
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
	background: var(--color-surface);
	transition: all var(--animation-fast) ease;
}

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

.pagination__btn.active {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: white;
}

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

/* --- Toast --- */
.toast-container {
	position: fixed;
	bottom: var(--space-4);
	right: var(--space-4);
	z-index: var(--z-toast);
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	min-width: 300px;
	max-width: 420px;
	font-size: var(--font-size-sm);
	color: var(--color-text);
	pointer-events: auto;
	animation: toastIn var(--animation-normal) var(--ease-out);
	border-left: 3px solid var(--color-info);
}

.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-error); }
.toast--warning { border-left-color: var(--color-warning); }

.toast.toast--dismissing {
	animation: toastOut var(--animation-normal) var(--ease-in-out) forwards;
}

.toast__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.toast__message {
	flex: 1;
}

.toast__close {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	color: var(--color-text-muted);
	flex-shrink: 0;
}

.toast__close:hover {
	background: var(--color-bg);
	color: var(--color-text);
}

/* --- Modal --- */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: var(--z-modal);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-4);
	animation: fadeIn var(--animation-fast) ease;
}

.modal {
	background: var(--color-surface);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-xl);
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	animation: modalIn var(--animation-normal) var(--ease-out);
}

.modal__header {
	padding: var(--space-5) var(--space-6) 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.modal__title {
	font-size: var(--font-size-lg);
	font-weight: 600;
	color: var(--color-text);
}

.modal__close {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-md);
	color: var(--color-text-muted);
}

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

.modal__body {
	padding: var(--space-5) var(--space-6);
}

.modal__footer {
	padding: 0 var(--space-6) var(--space-5);
	display: flex;
	justify-content: flex-end;
	gap: var(--space-3);
}

/* --- Skeleton --- */
.skeleton {
	background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
	border-radius: var(--radius-sm);
}

.skeleton--text {
	height: 14px;
	width: 80%;
	margin-bottom: var(--space-2);
}

.skeleton--title {
	height: 24px;
	width: 60%;
	margin-bottom: var(--space-3);
}

.skeleton--avatar {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-full);
}

.skeleton--card {
	height: 120px;
	width: 100%;
}

.skeleton--row {
	height: 48px;
	width: 100%;
	margin-bottom: var(--space-1);
}

.skeleton-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-4);
}

.skeleton-table {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

/* --- Loading Spinner --- */
.spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid var(--color-border);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: rotate 0.6s linear infinite;
}

.spinner--lg {
	width: 40px;
	height: 40px;
	border-width: 3px;
}

.spinner-overlay {
	position: fixed;
	inset: 0;
	background: rgba(255,255,255,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: var(--z-overlay);
}

[data-theme="dark"] .spinner-overlay {
	background: rgba(15, 23, 42, 0.7);
}

/* --- Forms --- */
.form-group {
	margin-bottom: var(--space-4);
}

.form-label {
	display: block;
	font-size: var(--font-size-sm);
	font-weight: 500;
	color: var(--color-text);
	margin-bottom: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
	width: 100%;
	height: 40px;
	padding: 0 var(--space-3);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	font-size: var(--font-size-sm);
	color: var(--color-text);
	background: var(--color-surface);
	transition: border-color var(--animation-fast) ease, box-shadow var(--animation-fast) ease;
}

.form-textarea {
	height: auto;
	padding: var(--space-3);
	resize: vertical;
	min-height: 80px;
}

.form-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 32px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input--error,
.form-select--error {
	border-color: var(--color-error);
}

.form-input--error:focus,
.form-select--error:focus {
	box-shadow: 0 0 0 3px var(--color-error-light);
}

.form-error {
	font-size: var(--font-size-xs);
	color: var(--color-error);
	margin-top: var(--space-1);
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-4);
}

/* --- Badges --- */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: var(--font-size-xs);
	font-weight: 600;
	border-radius: var(--radius-full);
	white-space: nowrap;
}

.badge--primary  { background: var(--color-primary-light); color: var(--color-primary); }
.badge--success  { background: var(--color-success-light); color: #059669; }
.badge--error    { background: var(--color-error-light); color: #DC2626; }
.badge--warning  { background: var(--color-warning-light); color: #D97706; }
.badge--neutral  { background: var(--color-bg); color: var(--color-text-secondary); }

[data-theme="dark"] .badge--success { color: var(--color-success); }
[data-theme="dark"] .badge--error { color: var(--color-error); }
[data-theme="dark"] .badge--warning { color: var(--color-warning); }

.badge--dot {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 8px;
	height: 8px;
	background: var(--color-error);
	border-radius: 50%;
	border: 2px solid var(--color-surface);
	padding: 0;
}

.badge--count {
	background: var(--color-error);
	color: white;
	font-size: 10px;
	min-width: 18px;
	height: 18px;
	border-radius: var(--radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}

/* --- Activity Timeline --- */
.timeline {
	position: relative;
	padding-left: 28px;
}

.timeline::before {
	content: "";
	position: absolute;
	left: 9px;
	top: 4px;
	bottom: 4px;
	width: 2px;
	background: var(--color-border);
}

.timeline__item {
	position: relative;
	padding-bottom: var(--space-4);
}

.timeline__item:last-child {
	padding-bottom: 0;
}

.timeline__dot {
	position: absolute;
	left: -28px;
	top: 4px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--color-border);
	background: var(--color-surface);
}

.timeline__content {
	font-size: var(--font-size-sm);
	color: var(--color-text);
}

.timeline__time {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-top: 2px;
}

/* --- Buttons --- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	height: 36px;
	padding: 0 var(--space-4);
	font-size: var(--font-size-sm);
	font-weight: 500;
	border-radius: var(--radius-md);
	transition: all var(--animation-fast) ease;
	white-space: nowrap;
}

.btn--primary {
	background: var(--color-primary);
	color: var(--color-primary-text);
}

.btn--primary:hover {
	background: var(--color-primary-hover);
}

.btn--secondary {
	background: var(--color-surface);
	color: var(--color-text);
	border: 1px solid var(--color-border);
}

.btn--secondary:hover {
	background: var(--color-bg);
}

.btn--danger {
	background: var(--color-error);
	color: white;
}

.btn--danger:hover {
	opacity: 0.9;
}

.btn--ghost {
	color: var(--color-text-secondary);
}

.btn--ghost:hover {
	background: var(--color-bg);
	color: var(--color-text);
}

.btn svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

/* --- Breadcrumbs --- */
.breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	margin-bottom: var(--space-4);
}

.breadcrumb a {
	color: var(--color-text-secondary);
}

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

.breadcrumb__sep {
	color: var(--color-text-muted);
}

/* --- Chart container --- */
.chart-container {
	position: relative;
	height: 220px;
}

.chart-container canvas {
	width: 100%;
	height: 100%;
}

/* --- Empty state --- */
.empty-state {
	text-align: center;
	padding: var(--space-12) var(--space-4);
	color: var(--color-text-muted);
}

.empty-state svg {
	width: 48px;
	height: 48px;
	stroke: var(--color-text-muted);
	fill: none;
	stroke-width: 1;
	margin: 0 auto var(--space-4);
	opacity: 0.5;
}

.empty-state__title {
	font-size: var(--font-size-lg);
	font-weight: 600;
	color: var(--color-text-secondary);
	margin-bottom: var(--space-2);
}

/* --- Toggle switch --- */
.toggle {
	position: relative;
	width: 44px;
	height: 24px;
	display: inline-block;
}

.toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle__slider {
	position: absolute;
	inset: 0;
	background: var(--color-border-dark);
	border-radius: var(--radius-full);
	transition: background var(--animation-fast) ease;
	cursor: pointer;
}

.toggle__slider::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 2px;
	width: 20px;
	height: 20px;
	background: white;
	border-radius: 50%;
	transition: transform var(--animation-fast) ease;
}

.toggle input:checked + .toggle__slider {
	background: var(--color-primary);
}

.toggle input:checked + .toggle__slider::before {
	transform: translateX(20px);
}

/* --- Dashboard grid --- */
.dashboard-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: var(--space-4);
}

/* --- Settings sections --- */
.settings-section {
	margin-bottom: var(--space-6);
}

.settings-section__title {
	font-size: var(--font-size-base);
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: var(--space-4);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--color-border);
}

.settings-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-3) 0;
}

.settings-row__label {
	font-size: var(--font-size-sm);
	color: var(--color-text);
}

.settings-row__desc {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-top: 2px;
}

/* --- Profile --- */
.profile-card {
	text-align: center;
	padding: var(--space-6);
}

.profile-card__avatar {
	width: 80px;
	height: 80px;
	border-radius: var(--radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--font-size-2xl);
	font-weight: 700;
	color: white;
	margin: 0 auto var(--space-4);
}

.profile-card__name {
	font-size: var(--font-size-xl);
	font-weight: 600;
	color: var(--color-text);
}

.profile-card__role {
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
	margin-top: var(--space-1);
}

.profile-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-4);
	margin: var(--space-6) 0;
}

.profile-stat {
	text-align: center;
}

.profile-stat__value {
	font-size: var(--font-size-2xl);
	font-weight: 700;
	color: var(--color-text);
}

.profile-stat__label {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-top: var(--space-1);
}

/* --- Animations --- */
@keyframes fadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes fadeInUp {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageEnter {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageLeave {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes modalIn {
	from { opacity: 0; transform: scale(0.95) translateY(10px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastIn {
	from { opacity: 0; transform: translateX(100%); }
	to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(100%); }
}

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

@keyframes shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

@keyframes shake {
	10%, 90% { transform: translateX(-1px); }
	20%, 80% { transform: translateX(2px); }
	30%, 50%, 70% { transform: translateX(-4px); }
	40%, 60% { transform: translateX(4px); }
}

.shake { animation: shake 0.5s ease-out; }

/* --- Responsive --- */
@media (max-width: 1024px) {
	.sidebar {
		transform: translateX(-100%);
	}

	.sidebar.open {
		transform: translateX(0);
		box-shadow: var(--shadow-xl);
	}

	.main-wrapper {
		margin-left: 0 !important;
	}

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

	.dashboard-grid {
		grid-template-columns: 1fr;
	}

	.form-row {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.content {
		padding: var(--space-4);
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.profile-stats {
		grid-template-columns: 1fr;
	}

	.topbar__search {
		display: none;
	}

	.topbar__username {
		display: none;
	}

	.pagination {
		flex-direction: column;
		gap: var(--space-2);
		align-items: center;
	}
}

/* --- Utility --- */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
