:root {
	--ui-primary: #2563eb;
	--ui-radius: 16px;
	--ui-control-radius: 12px;
	--ui-shadow: 0 0.375rem 1rem rgba(15, 23, 42, 0.08);
	--ui-gap: 1rem;
	--ui-control-height: 48px;
}

body {
	background-color: #f8fafc;
}

body.auth-page {
	display: flex;
	align-items: center;
	min-height: 100vh;
	background: #f6f8fb;
}

body.auth-page > .container {
	width: 100%;
}

.container,
.container-fluid {
	max-width: 1320px;
}

.auth-brand {
	display: none;
}

.auth-wrapper {
	width: 100%;
	max-width: 420px;
	padding: 0.875rem;
	margin: 0 auto;
}

.login-card {
	width: 100%;
	padding: 1.25rem;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: var(--ui-radius);
	box-shadow: var(--ui-shadow);
}

.login-back {
	margin-bottom: 0.875rem;
}

.login-back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	color: #475569;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.login-back-link:hover,
.login-back-link:focus {
	color: var(--ui-primary);
	text-decoration: none;
}

.login-header {
	margin-bottom: 1rem;
	color: #0f172a;
	text-align: center;
}

.login-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0 auto 0.5rem;
	color: #fff;
	background: var(--ui-primary);
	border-radius: 14px;
	font-size: 1.5rem;
}

.login-title {
	margin-bottom: 0.25rem;
	color: #0f172a;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0;
}

.login-subtitle {
	margin: 0;
	color: #64748b;
	font-size: 0.9rem;
	line-height: 1.3;
}

.login-form {
	display: grid;
	gap: 0.75rem;
}

.login-field label {
	display: block;
	margin-bottom: 0.35rem;
	color: #334155;
	font-size: 0.875rem;
	font-weight: 600;
}

.login-input {
	position: relative;
}

.login-input > i {
	position: absolute;
	top: 50%;
	left: 0.875rem;
	z-index: 2;
	color: #64748b;
	line-height: 1;
	transform: translateY(-50%);
}

.login-input .form-control {
	min-height: 48px;
	padding-left: 2.625rem;
}

.login-btn {
	min-height: 48px;
	border-radius: var(--ui-control-radius);
}

.login-meta {
	margin: 0.875rem 0 0;
	color: #475569;
	font-size: 0.86rem;
	line-height: 1.35;
	text-align: center;
	white-space: nowrap;
}

.login-meta strong {
	color: #0f172a;
	font-weight: 700;
}

.login-note {
	margin: 0.875rem 0 0;
	padding-top: 0.875rem;
	border-top: 1px solid #e5e7eb;
	color: #475569;
	font-size: 0.82rem;
	line-height: 1.45;
	text-align: center;
}

.page-header,
.d-flex.justify-content-between.align-items-center.mb-4 {
	gap: var(--ui-gap);
}

.card {
	border: 1px solid #e5e7eb;
	border-radius: var(--ui-radius);
	box-shadow: var(--ui-shadow);
	margin-bottom: var(--ui-gap);
}

.card-header,
.card-footer {
	padding: 1rem 1.25rem;
}

.card-body {
	padding: 1.25rem;
}

.card-body.p-0 {
	padding: 0 !important;
}

.form-control,
.form-select,
.btn {
	min-height: var(--ui-control-height);
	border-radius: var(--ui-control-radius);
}

.form-control,
.form-select {
	font-size: 1rem;
	font-weight: 500;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
	border-color: var(--ui-primary);
	box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

textarea.form-control {
	min-height: 120px;
}

.form-label {
	display: block;
	margin-bottom: 0.375rem;
	color: #334155;
	font-size: 0.9rem;
	font-weight: 600;
}

.form-text,
.invalid-feedback,
.password-strength {
	margin-top: 0.375rem;
	font-size: 0.8125rem;
}

.form-text {
	color: #64748b;
}

form.row:not(.g-0),
.card-body.row:not(.g-0),
.ui-form-grid {
	--bs-gutter-x: 1rem;
	--bs-gutter-y: 1rem;
}

form.row:not(.g-0) > [class*="col-"],
.card-body.row:not(.g-0) > [class*="col-"],
.ui-form-grid > [class*="col-"] {
	flex: 0 0 auto;
	width: 50%;
	max-width: 50%;
}

form.row:not(.g-0) > .col-12,
.card-body.row:not(.g-0) > .col-12,
.ui-form-grid > .col-12 {
	width: 100%;
	max-width: 100%;
}

.ui-form-actions,
.card-footer:has(button[type="submit"]),
form .d-flex:has(button[type="submit"]) {
	flex-wrap: wrap;
	gap: 0.75rem;
}

.ui-password-field,
.profile-password-control,
.login-input:has(input[type="password"]),
.login-input:has(input[data-ui-password-ready]) {
	position: relative;
}

.ui-password-field .form-control,
.profile-password-control .form-control,
.login-input input[type="password"],
.login-input input[data-ui-password-ready] {
	padding-right: 3rem;
}

.ui-password-toggle,
.profile-password-toggle {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	min-height: 2.25rem;
	padding: 0;
	color: #64748b;
	background: transparent;
	border: 0;
	border-radius: var(--ui-control-radius);
	transform: translateY(-50%);
}

.ui-password-toggle:hover,
.ui-password-toggle:focus,
.profile-password-toggle:hover,
.profile-password-toggle:focus {
	color: var(--ui-primary);
	background: #eff6ff;
}

.profile-form-page {
	--profile-control-height: 48px;
	--profile-radius: 16px;
	--profile-primary: var(--ui-primary);
}

.profile-form-card {
	margin-bottom: 1rem;
	border-radius: var(--profile-radius);
	box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.08);
	overflow: hidden;
}

.profile-form-card .card-header {
	padding: 0.875rem 1.25rem;
}

.profile-form-card .card-body {
	padding: 1.25rem;
}

.profile-photo-card .card-body {
	display: grid;
	justify-items: center;
	gap: 0.75rem;
	text-align: center;
}

.profile-photo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	overflow: hidden;
	color: #64748b;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	font-size: 5rem;
	line-height: 1;
}

.profile-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-photo-btn {
	min-height: 40px;
	padding-right: 1rem;
	padding-left: 1rem;
}

.profile-user-summary {
	display: grid;
	gap: 0.35rem;
}

.profile-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.profile-field:first-child,
.profile-actions {
	grid-column: 1 / -1;
}

.profile-field .form-label {
	margin-bottom: 0.375rem;
	font-weight: 600;
}

.profile-form .form-control {
	min-height: var(--profile-control-height);
}

.profile-form .form-control:focus {
	border-color: var(--profile-primary);
	box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.profile-field .form-text,
.profile-field .password-strength {
	margin-top: 0.375rem;
}

.profile-field .invalid-feedback {
	margin-top: 0.375rem;
}

.profile-field:has(.is-invalid) .invalid-feedback {
	display: block;
}

.profile-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.profile-actions .btn {
	flex: 0 0 auto;
	min-height: 48px;
}

.profile-info-card .card-body {
	padding: 1.25rem;
}

.profile-info-card .card-title {
	margin-bottom: 0.5rem;
}

.btn-sm {
	min-height: 34px;
}

.btn-primary {
	background-color: #2563eb;
	border-color: #2563eb;
}

.btn-success {
	background-color: #16a34a;
	border-color: #16a34a;
}

.btn-warning {
	background-color: #f59e0b;
	border-color: #f59e0b;
}

.btn-danger,
.btn-outline-danger:hover {
	background-color: #dc2626;
	border-color: #dc2626;
}

.table {
	--bs-table-hover-bg: #f8fafc;
}

.table thead th {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #475569;
	white-space: nowrap;
}

.table td,
.table th {
	vertical-align: middle;
}

.table .ui-col-no {
	width: 4rem;
	min-width: 4rem;
	text-align: center;
}

.table-responsive {
	border-radius: var(--ui-radius);
	overflow-x: auto;
}

.ui-pagination-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.ui-pagination-info {
	color: #64748b;
	font-size: 0.875rem;
}

.pagination {
	gap: 0.35rem;
}

.pagination .page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0.375rem 0.7rem;
	color: #475569;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--ui-control-radius);
	font-weight: 600;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
	color: var(--ui-primary);
	background: #eff6ff;
	border-color: #bfdbfe;
	box-shadow: none;
}

.pagination .page-item.active .page-link {
	color: #fff;
	background: var(--ui-primary);
	border-color: var(--ui-primary);
}

.pagination .page-item.disabled .page-link {
	color: #94a3b8;
	background: #f8fafc;
	border-color: #e2e8f0;
}

.alert {
	border-radius: var(--ui-radius);
	border-width: 1px;
	box-shadow: var(--ui-shadow);
}

.alert-success {
	background-color: #ecfdf5;
	border-color: #bbf7d0;
	color: #166534;
}

.alert-warning {
	background-color: #fffbeb;
	border-color: #fde68a;
	color: #92400e;
}

.alert-danger {
	background-color: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.alert-info {
	background-color: #eff6ff;
	border-color: #bfdbfe;
	color: #1e40af;
}

.ui-loading {
	pointer-events: none;
	opacity: 0.75;
}

.ui-loading::after {
	display: inline-block;
	width: 0.875rem;
	height: 0.875rem;
	margin-left: 0.5rem;
	vertical-align: -0.125em;
	content: "";
	border: 0.15em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ui-spinner 0.75s linear infinite;
}

@keyframes ui-spinner {
	to {
		transform: rotate(360deg);
	}
}

@media (min-width: 768px) {
	form.row:not(.g-0) > [class*="col-"] {
		margin-bottom: 0.25rem;
	}
}

@media (max-width: 991.98px) and (min-width: 769px) {
	.auth-wrapper {
		max-width: 400px;
	}

	.login-card {
		padding: 1.125rem;
	}
}

@media (max-width: 991.98px) {
	.d-flex.justify-content-between.align-items-center.mb-4 {
		align-items: flex-start !important;
		flex-direction: column;
	}

	.d-flex.justify-content-between.align-items-center.mb-4 > .d-flex {
		width: 100%;
		flex-wrap: wrap;
	}
}

@media (max-width: 768px) {
	body {
		background-color: #f8fafc;
	}

	.container,
	.container-fluid {
		padding-left: 0.875rem;
		padding-right: 0.875rem;
	}

	.card {
		margin-bottom: 0.875rem;
	}

	.card-header,
	.card-body,
	.card-footer {
		padding: 1rem;
	}

	.row.g-3 {
		--bs-gutter-y: 0.75rem;
	}

	.form-control,
	.form-select,
	.btn {
		min-height: 48px;
	}

	.auth-wrapper {
		max-width: 100%;
		padding: 0.75rem;
	}

	.login-card {
		padding: 1rem;
	}

	.login-back {
		margin-bottom: 0.75rem;
	}

	.login-header {
		margin-bottom: 0.875rem;
	}

	.login-icon {
		width: 48px;
		height: 48px;
	}

	.login-title {
		font-size: 1.375rem;
	}

	.login-meta {
		white-space: normal;
	}

	form.row:not(.g-0) > [class*="col-"],
	.card-body.row:not(.g-0) > [class*="col-"],
	.ui-form-grid > [class*="col-"] {
		width: 100%;
		max-width: 100%;
	}

	.card-footer:has(button[type="submit"]) .btn,
	form .d-flex:has(button[type="submit"]) .btn,
	form.row .btn,
	.ui-form-actions .btn {
		width: 100%;
		min-height: 48px;
	}

	.profile-form-card {
		margin-bottom: 0.75rem;
	}

	.profile-form-card .card-header,
	.profile-form-card .card-body {
		padding: 1rem;
	}

	.profile-form {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	.profile-field,
	.profile-field:first-child,
	.profile-actions {
		grid-column: 1;
	}

	.profile-form .form-control {
		min-height: 48px;
	}

	.profile-actions {
		flex-direction: column;
		gap: 0.625rem;
	}

	.profile-actions .btn {
		width: 100%;
	}

	.profile-photo-btn {
		width: 100%;
		min-height: 48px;
	}

	.table-responsive {
		border: 0;
	}

	.table:not(.desktop-only-table) thead {
		display: none;
	}

	.table:not(.desktop-only-table) tr {
		display: block;
		padding: 0.75rem;
		margin: 0.75rem;
		background: #fff;
		border: 1px solid #e5e7eb;
		border-radius: var(--ui-radius);
		box-shadow: var(--ui-shadow);
	}

	.table:not(.desktop-only-table) td {
		display: flex;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.45rem 0;
		border: 0;
	}

	.table:not(.desktop-only-table) td::before {
		flex: 0 0 42%;
		font-weight: 700;
		color: #64748b;
		content: attr(data-label);
	}

	.table:not(.desktop-only-table) td:not([data-label]) {
		display: block;
	}

	.table:not(.desktop-only-table) td:not([data-label])::before {
		display: none;
	}

	.table:not(.desktop-only-table) .ui-col-no {
		width: 100%;
		min-width: 0;
		text-align: right;
	}

	.ui-pagination-bar {
		align-items: flex-start;
		flex-direction: column;
	}

	.pagination {
		flex-wrap: wrap;
	}

	.sticky-save-bar,
	.card-footer:has(button[type="submit"]) {
		position: sticky;
		bottom: 0;
		z-index: 1020;
		border-top: 1px solid #e5e7eb;
		box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12);
	}
}
