:root {
	--erp-bg: rgba(15, 23, 42, 0.85);
	--erp-bg-2: rgba(30, 58, 95, 0.85);
	--erp-card: rgba(255, 255, 255, 0.08);
	--erp-text: #f1f5f9;
	--erp-muted: #94a3b8;
	--erp-gold: #e8c547;
	--erp-border: rgba(255, 255, 255, 0.12);
	--erp-radius: 14px;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
	width: 100%;
	max-width: 100%;
	/* Fractional grid tracks leave the layout box a fraction of a pixel wider
	   than the viewport, which is enough to make the page scroll sideways by a
	   pixel or so. `clip` removes that without creating a scroll container, so
	   sticky or fixed positioning elsewhere is unaffected. */
	overflow-x: clip;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	background:
		radial-gradient(ellipse at 20% 10%, rgba(56, 189, 248, 0.18), transparent 45%),
		radial-gradient(ellipse at 80% 80%, rgba(232, 197, 71, 0.12), transparent 40%),
		#0a1220;
}

body {
	font-family: 'Tajawal', 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	overflow-x: clip;
	background: linear-gradient(
		135deg,
		var(--erp-bg) 0%,
		var(--erp-bg-2) 50%,
		var(--erp-bg) 100%
	);
	color: var(--erp-text);
	display: flex;
	flex-direction: column;
}

/* ── Top Navbar ─────────────────────────────────── */
.erp-navbar {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(10, 18, 32, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--erp-border);
	width: 100%;
}

.erp-nav-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1.25rem;
	gap: 1rem;
}

.erp-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: #fff;
	font-weight: 800;
	font-size: 1.2rem;
	letter-spacing: 0.5px;
	/* The brand must never shrink or wrap: if it does, its width follows the
	   space the menu leaves, so the logo slides and the navbar height
	   changes from page to page. */
	flex: 0 0 auto;
	white-space: nowrap;
}

.erp-brand-logo {
	height: 38px;
	width: auto;
	flex: 0 0 auto;
	object-fit: contain;
}

.erp-brand-text {
	background: linear-gradient(135deg, #fff 0%, var(--erp-gold) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.erp-nav-menu {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: flex-end;
	flex: 0 0 auto;
}

.erp-nav-link {
	color: var(--erp-muted);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0.45rem 0.85rem;
	border-radius: 8px;
	/* Reserved on every link so the active state only recolours it. A real
	   border only on .active added 2px, which re-flowed and re-shrank the
	   whole row whenever the active page changed. */
	border: 1px solid transparent;
	transition: all 0.2s ease;
	/* Labels keep their intrinsic size: no wrapping, no flex shrinking. */
	white-space: nowrap;
	flex: 0 0 auto;
}

.erp-nav-link:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.erp-nav-link.active {
	color: var(--erp-gold);
	background: rgba(232, 197, 71, 0.12);
	border-color: rgba(232, 197, 71, 0.3);
}

.erp-nav-toggle {
	display: none;
	background: transparent;
	border: 1px solid var(--erp-border);
	color: #fff;
	font-size: 1.25rem;
	padding: 0.4rem 0.75rem;
	border-radius: 8px;
	cursor: pointer;
}

@media (max-width: 991px) {
	.erp-nav-toggle {
		display: block;
	}

	.erp-nav-menu {
		display: none;
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		padding-top: 1rem;
		gap: 0.25rem;
	}

	.erp-nav-menu.is-open {
		display: flex;
	}

	.erp-nav-container {
		flex-wrap: wrap;
	}
}

/* ── Common Main Layout ───────────────────────────── */
.erp-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
}

.erp-page-header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.erp-page-title {
	font-size: 2.2rem;
	font-weight: 800;
	color: var(--erp-gold);
	margin: 0 0 0.5rem;
}

.erp-page-subtitle {
	color: var(--erp-muted);
	font-size: 1.1rem;
	margin: 0;
}

/* ── Common Cards & Grid ─────────────────────────── */
.erp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1.5rem;
}

.erp-card {
	background: var(--erp-card);
	border: 1px solid var(--erp-border);
	border-radius: var(--erp-radius);
	padding: 1.5rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(8px);
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.erp-card:hover {
	transform: translateY(-2px);
	border-color: rgba(232, 197, 71, 0.4);
}

/* ── Footer ──────────────────────────────────────── */
.erp-footer {
	border-top: 1px solid var(--erp-border);
	background: rgba(10, 18, 32, 0.95);
	padding: 1.5rem 1rem;
	text-align: center;
	margin-top: auto;
}

.erp-footer-content .contact-footer {
	color: var(--erp-muted);
	font-size: 0.9rem;
	margin: 0;
}
