:root {
	--primary:       #0f172a;
	--primary-mid:   #1e3a5f;
	--accent:        #0ea5e9;
	--accent-hover:  #0284c7;
	--surface:       #ffffff;
	--surface-alt:   #f8fafc;
	--border:        #e2e8f0;
	--text:          #1e293b;
	--text-muted:    #64748b;
	--success:       #22c55e;
	--warning:       #f59e0b;
	--danger:        #ef4444;
	--shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
	--shadow:        0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
	--shadow-md:     0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
	--radius:        8px;
	--radius-lg:     12px;
	--transition:    .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	background-color: var(--surface-alt);
	color: var(--text);
	font-family: 'Inter', 'Poppins', 'Open Sans', sans-serif;
	font-size: 14px;
	line-height: 1.6;
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background-image:
		radial-gradient(circle at 10% -10%, rgba(14,165,233,.12), transparent 35%),
		radial-gradient(circle at 90% 0%, rgba(30,58,95,.12), transparent 40%);
	display: flex;
	flex-direction: column;
}

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

a:hover {
	color: var(--accent-hover);
}

/* ─── Footer ────────────────────────────────────────────────── */
.footer {
	background: var(--primary);
	color: #94a3b8;
	text-align: center;
	padding: 20px 16px;
	font-size: 12px;
	margin-top: 0;
	border-top: 1px solid #1e3a5f;
}
.footer p { margin: 4px 0; }
.footer a { color: var(--accent); }

/* ─── Page wrapper ──────────────────────────────────────────── */
.page-content {
	max-width: min(1800px, calc(100vw - 16px));
	margin: 0 auto;
	padding: 20px 8px;
	flex: 1 0 auto;
	animation: pageEnter .35s ease;
}

.page-content.page-download {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

footer {
	margin-top: auto;
}

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

/* Legacy page compatibility */
img {
	max-width: 100%;
	height: auto;
}

.page-content > table {
	max-width: 100%;
	width: 100%;
}

.page-content table {
	border-collapse: collapse;
}

.page-content h1,
.page-content h2,
.page-content h3 {
	font-family: 'Poppins', 'Inter', sans-serif;
	font-weight: 600;
	letter-spacing: .01em;
	color: #0f172a;
}

.page-content h1 {
	font-size: clamp(22px, 2.2vw, 30px);
	margin: 0 0 14px;
}

.page-content input[type=text],
.page-content input[type=password],
.page-content input[type=number],
.page-content select,
.page-content textarea {
	max-width: 100%;
	font-family: inherit;
}

.ui-surface {
	background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow-sm);
	padding: 14px;
	margin-bottom: 16px;
	overflow: hidden;
}

.ui-input {
	border: 1px solid #d1dbe8;
	border-radius: 8px;
	padding: 8px 10px;
	background: #f8fafc;
	transition: border-color .2s, box-shadow .2s, background .2s;
}

.ui-input:focus {
	outline: none;
	border-color: #0ea5e9;
	box-shadow: 0 0 0 3px rgba(14,165,233,.15);
	background: #fff;
}

.ui-btn {
	height: 34px;
	padding: 0 14px;
	border: none;
	border-radius: 8px;
	background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(14,165,233,.25);
	transition: transform .12s, filter .2s, box-shadow .2s;
}

.ui-btn:hover {
	filter: brightness(1.07);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(14,165,233,.28);
}

.ui-btn:active {
	transform: translateY(0);
	filter: brightness(.95);
}

/* Improve old center-aligned table pages on smaller screens */
@media (max-width: 900px) {
	.page-content {
		max-width: calc(100vw - 8px);
		padding: 14px 4px;
	}

	.page-content.page-download {
		max-width: 100%;
		padding-left: 0;
		padding-right: 0;
	}

	.page-content table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.ui-surface {
		padding: 10px;
		border-radius: 12px;
	}
}

/* ─── Card ──────────────────────────────────────────────────── */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	padding: 24px;
	margin-bottom: 20px;
}

/* ─── Pagination ────────────────────────────────────────────── */
.dc-pagination {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0 18px;
	padding: 8px;
	border: 1px solid #d9e4f2;
	border-radius: 14px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	box-shadow: 0 6px 18px rgba(2, 6, 23, .08);
	max-width: 100%;
	overflow: hidden;
}

.dc-page-track {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	padding: 2px;
	scrollbar-width: thin;
}

.dc-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid #d6e3f3;
	border-radius: 10px;
	background: #ffffff;
	color: #1f3b5b;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: transform .12s ease, border-color .2s ease, background .2s ease, color .2s ease;
	white-space: nowrap;
}

.dc-page-btn:hover {
	background: #eef6ff;
	border-color: #90c2f7;
	color: #0f4c81;
	transform: translateY(-1px);
}

.dc-page-btn.is-active {
	background: linear-gradient(135deg, #0ea5e9 0%, #1d4ed8 100%);
	border-color: #1d4ed8;
	color: #ffffff;
	box-shadow: 0 8px 14px rgba(29, 78, 216, .28);
	pointer-events: none;
}

.dc-page-btn.is-disabled {
	background: #f3f7fc;
	border-color: #dbe6f3;
	color: #9bb2c8;
	pointer-events: none;
	box-shadow: none;
}

.dc-page-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 34px;
	color: #7a93ad;
	font-weight: 700;
	letter-spacing: .1em;
	user-select: none;
}

.dc-page-nav {
	min-width: 38px;
	font-size: 18px;
	font-weight: 700;
	padding-bottom: 2px;
	flex: 0 0 auto;
}

.dc-page-jump {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	border-left: 1px solid #d3e4f3;
	padding-left: 10px;
	margin-left: 2px;
}

.dc-page-info {
	font-size: 12px;
	font-weight: 600;
	color: #4d6e8a;
	white-space: nowrap;
}

.dc-jump-divider {
	width: 1px;
	height: 20px;
	background: #ccdaec;
}

.dc-jump-label {
	font-size: 12px;
	color: #6b8aaa;
	white-space: nowrap;
	user-select: none;
}

.dc-jump-input {
	width: 52px;
	height: 34px;
	padding: 0 7px;
	border: 1px solid #c5d8ec;
	border-radius: 9px;
	background: #f6f9fd;
	color: #1a3a5c;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
}

.dc-jump-input:focus {
	border-color: #0ea5e9;
	box-shadow: 0 0 0 3px rgba(14,165,233,.15);
	background: #fff;
}

.dc-jump-input::-webkit-inner-spin-button,
.dc-jump-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.dc-jump-input[type=number] { -moz-appearance: textfield; }

.dc-jump-go {
	padding: 0 10px;
	background: linear-gradient(135deg, #0ea5e9 0%, #1d4ed8 100%);
	border-color: #1d4ed8;
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	flex: 0 0 auto;
}

.dc-jump-go:hover {
	background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
	border-color: #3b82f6;
	color: #fff;
}

.dc-quick-jump {
	padding: 0 8px;
	background: #f0f8ff;
	border-color: #a8d4f0;
	color: #0369a1;
	font-size: 12px;
}

.dc-quick-jump:hover {
	background: #dbeafe;
	border-color: #60a5fa;
	color: #1d4ed8;
}

@media (max-width: 900px) {
	.dc-pagination {
		gap: 6px;
		padding: 6px;
		border-radius: 12px;
		flex-wrap: wrap;
	}

	.dc-page-btn {
		min-width: 32px;
		height: 32px;
		font-size: 13px;
		padding: 0 8px;
	}

	.dc-page-jump {
		border-left: none;
		border-top: 1px solid #d3e4f3;
		padding-left: 0;
		padding-top: 6px;
		margin-left: 0;
		width: 100%;
		flexible-wrap: wrap;
	}

	.dc-jump-divider { display: none; }
	.dc-jump-input { width: 46px; }
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-alt); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }