/* Modern UI layer — loaded after core31b1.css / layout.css / form.css.
   Scoped to the shared site chrome (#container/#header/#nav/#footer) plus the
   dedicated .modern-* wrappers used on index.php and main.php, so pages that
   still render with the legacy tdac1/tdac2/lnk table markup are unaffected. */

:root {
	--mu-bg: #f4f6fb;
	--mu-surface: #ffffff;
	--mu-text: #1b2537;
	--mu-muted: #64748b;
	--mu-border: #e3e8f0;
	--mu-primary: #4f46e5;
	--mu-primary-dark: #4338ca;
	--mu-primary-soft: #eef0fe;
	--mu-danger: #dc2626;
	--mu-danger-soft: #fef2f2;
	--mu-radius: 14px;
	--mu-radius-sm: 9px;
	--mu-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -8px rgba(16, 24, 40, .12);
	--mu-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--mu-bg: #10131c;
		--mu-surface: #1a1f2e;
		--mu-text: #e7eaf3;
		--mu-muted: #97a1b8;
		--mu-border: #2b3245;
		--mu-primary: #6366f1;
		--mu-primary-dark: #818cf8;
		--mu-primary-soft: #23263a;
		--mu-danger-soft: #2a1518;
	}
}

body#body_home {
	background-color: var(--mu-bg);
	background-image:
		radial-gradient(600px circle at 8% -10%, color-mix(in srgb, var(--mu-primary) 14%, transparent), transparent 60%),
		radial-gradient(500px circle at 100% 0%, color-mix(in srgb, var(--mu-primary) 10%, transparent), transparent 55%);
	background-attachment: fixed;
	font-family: var(--mu-font);
	color: var(--mu-text);
	margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.mu-auth-card,
	.mu-auth-hero {
		animation: mu-rise .5s ease both;
	}
	.mu-auth-hero { animation-delay: .08s; }
}

@keyframes mu-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

#container {
	width: auto; /* layout.css (loaded via @import in core31b1.css) pins this to a flat 960px */
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Unified header bar: logo + nav + lang/user ---------- */

#header {
	height: auto; /* layout.css pins this to a fixed 62px */
	background: var(--mu-surface);
	border-bottom: 1px solid var(--mu-border);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	position: sticky;
	top: 0;
	z-index: 30;
}

.mu-header-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
	min-height: 64px;
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}

#header_quote {
	/* layout.css makes this position:absolute (a 690px-wide box pinned over the
	   header), which floats on top of #nav and swallows clicks on the links
	   underneath — must be pinned back to a normal flex item. */
	position: static;
	width: auto;
	top: auto;
	text-align: left;
	margin: 0 0 0 auto;
	order: 3;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--mu-muted);
	padding: 10px 0;
}

#header_quote p {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

#header_quote br { display: none; }

@media (max-width: 760px) {
	.mu-header-inner { gap: 10px 20px; }
	#nav { order: 3; flex: 1 1 100%; }
	#header_quote { order: 2; margin-left: auto; }
}

.mu-langswitch {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.mu-langswitch a {
	display: inline-flex;
	border-radius: 6px;
	overflow: hidden;
	line-height: 0;
	opacity: .55;
	transition: opacity .15s ease;
}

.mu-langswitch a:hover,
.mu-langswitch a.active {
	opacity: 1;
	border-bottom: none;
}

.mu-userchip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--mu-text);
}

.mu-iconlink {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mu-surface);
	border: 1px solid var(--mu-border);
	color: var(--mu-muted);
	border-bottom: none !important;
	transition: background .15s ease, color .15s ease;
}

.mu-iconlink:hover {
	background: var(--mu-primary-soft);
	color: var(--mu-primary);
}

.mu-iconlink svg { width: 16px; height: 16px; }

#logoarea {
	margin: 0;
	order: 1;
	flex: 0 0 auto;
	padding: 10px 0;
}

#logo {
	/* layout.css makes this position:absolute; float:left; z-index:-10, which
	   collapses #logoarea to zero width and can bury the logo under the page
	   background. */
	position: static;
	float: none;
	z-index: auto;
	display: inline-flex;
	border-bottom: none !important;
}

#logo img {
	max-height: 38px;
	width: auto;
	display: block;
}

/* ---------- Nav (inline in the header bar) ---------- */

#nav {
	/* layout.css gives this a fixed 35px dark background bar meant for the old
	   design; neither belongs in the new inline navbar. */
	height: auto;
	background: none;
	order: 2;
	flex: 1 1 auto;
	min-width: 0;
}

#nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
}

#nav li {
	float: none;
	margin: 0;
	padding: 0;
}

#nav li a {
	display: inline-block;
	padding: 9px 14px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--mu-muted);
	border-radius: 999px;
	border-bottom: none;
	transition: color .15s ease, background .15s ease;
}

#nav li a:hover {
	color: var(--mu-primary);
	background: var(--mu-primary-soft);
	border-bottom-color: transparent;
}

#nav li.selectedd a {
	color: var(--mu-primary);
	background: var(--mu-primary-soft);
}

/* ---------- Content shell ---------- */

#content {
	padding: 30px 0 40px;
}

#content:has(.mu-auth) {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(100vh - 300px);
}

#content_main {
	text-align: left;
}

/* ---------- Footer ---------- */

#footer {
	margin-top: 40px;
	padding: 22px 0 34px;
	border-top: 1px solid var(--mu-border);
}

#footer ul {
	list-style: none;
	display: flex;
	justify-content: center;
	gap: 22px;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	font-size: 13px;
	color: var(--mu-muted);
}

#footer ul li a {
	color: var(--mu-muted);
}

#footer ul li a:hover {
	color: var(--mu-primary);
	border-bottom-color: transparent;
}

/* =====================================================================
   Login page (index.php)
   ===================================================================== */

.mu-auth {
	display: grid;
	grid-template-columns: minmax(320px, 420px) 1fr;
	gap: 32px;
	align-items: stretch;
	margin: 10px 0 30px;
}

@media (max-width: 820px) {
	.mu-auth {
		grid-template-columns: 1fr;
	}
}

.mu-auth-card {
	background: var(--mu-surface);
	border: 1px solid var(--mu-border);
	border-radius: var(--mu-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 20px 40px -16px rgba(16, 24, 40, .18);
	padding: 32px 30px;
}

.mu-auth-card h1 {
	font-size: 22px;
	margin: 0 0 22px;
	color: var(--mu-text);
}

.mu-alert {
	border-radius: var(--mu-radius-sm);
	padding: 10px 14px;
	font-size: 13.5px;
	margin-bottom: 18px;
	background: var(--mu-primary-soft);
	color: var(--mu-primary-dark);
	border: 1px solid transparent;
}

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

.mu-field {
	margin-bottom: 16px;
}

.mu-field label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--mu-muted);
	margin-bottom: 6px;
}

.mu-field label svg {
	width: 15px;
	height: 15px;
	color: var(--mu-primary);
	flex-shrink: 0;
}

.mu-auth-card input[type="text"],
.mu-auth-card input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	font-size: 14px;
	font-family: var(--mu-font);
	border: 1px solid var(--mu-border);
	border-radius: var(--mu-radius-sm);
	background: var(--mu-bg);
	color: var(--mu-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.mu-auth-card input[type="text"]:focus,
.mu-auth-card input[type="password"]:focus {
	outline: none;
	border-color: var(--mu-primary);
	box-shadow: 0 0 0 3px var(--mu-primary-soft);
}

.mu-auth-card input[type="submit"] {
	width: 100%;
	margin-top: 6px;
	padding: 12px 16px;
	font-size: 14.5px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, var(--mu-primary), var(--mu-primary-dark));
	border: none;
	border-radius: var(--mu-radius-sm);
	cursor: pointer;
	transition: opacity .15s ease, transform .05s ease;
}

.mu-auth-card input[type="submit"]:hover { opacity: .92; }
.mu-auth-card input[type="submit"]:active { transform: translateY(1px); }

.mu-auth-links {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--mu-border);
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 13px;
	text-align: center;
}

.mu-auth-links a { color: var(--mu-primary); }

.mu-auth-downloads {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--mu-border);
	display: flex;
	gap: 14px;
}

.mu-download {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 10px;
	border: 1px solid var(--mu-border);
	border-radius: var(--mu-radius-sm);
	text-align: center;
	background: var(--mu-bg);
}

.mu-download img {
	max-width: 90px;
	height: auto;
}

.mu-download a.ac1 {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--mu-muted);
}

.mu-download a.ac1:hover { color: var(--mu-primary); }

.mu-auth-hero {
	position: relative;
	overflow: hidden;
	background: linear-gradient(160deg, var(--mu-primary) 0%, var(--mu-primary-dark) 100%);
	border-radius: var(--mu-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 24px 48px -12px rgba(67, 56, 202, .45);
	color: #fff;
	padding: 40px 36px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.mu-auth-hero::before,
.mu-auth-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	filter: blur(2px);
	pointer-events: none;
}

.mu-auth-hero::before {
	width: 260px;
	height: 260px;
	top: -110px;
	right: -80px;
}

.mu-auth-hero::after {
	width: 180px;
	height: 180px;
	bottom: -90px;
	left: -60px;
	background: rgba(255, 255, 255, .1);
}

.mu-auth-hero > * {
	position: relative;
	z-index: 1;
}

.mu-auth-hero h2 {
	font-size: 27px;
	font-weight: 700;
	margin: 0 0 8px;
	line-height: 1.3;
	text-wrap: balance;
}

.mu-auth-hero p.mu-hero-sub {
	font-size: 16px;
	font-weight: 500;
	opacity: .92;
	margin: 0 0 28px;
}

.mu-trust-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 26px;
	flex-wrap: wrap;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--mu-radius-sm);
	padding: 16px 22px;
	margin-bottom: 30px;
	backdrop-filter: blur(6px);
}

.mu-trust-row img { filter: brightness(0) invert(1); opacity: .92; }

.mu-auth-hero img.mu-hero-logo {
	max-width: 300px;
	width: 100%;
	height: auto;
	border-radius: var(--mu-radius-sm);
	background: #fff;
	padding: 14px;
	box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .35);
}

/* =====================================================================
   Dashboard (main.php)
   ===================================================================== */

.mu-dash h1 {
	font-size: 24px;
	margin: 4px 0 18px;
}

.mu-dash-section-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--mu-muted);
	margin: 30px 0 14px;
}

.mu-dash-section-title:first-of-type { margin-top: 6px; }

.mu-stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 14px;
}

.mu-stat-card {
	background: var(--mu-surface);
	border: 1px solid var(--mu-border);
	border-radius: var(--mu-radius);
	box-shadow: var(--mu-shadow);
	padding: 18px 20px;
}

.mu-stat-card .mu-stat-label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--mu-muted);
	margin-bottom: 8px;
}

.mu-stat-card .mu-stat-value {
	font-size: 24px;
	font-weight: 700;
	color: var(--mu-text);
}

.mu-stat-card.mu-stat-accent .mu-stat-value { color: var(--mu-primary); }
