/* Modern UI overrides. Loaded after the theme and custom-style. */
:root {
	--c-primary: #2563eb;
	--c-primary-dark: #1d4ed8;
	--c-navy: #0f172a;
	--c-navy-soft: #1e293b;
	--c-bg: #f1f5f9;
	--c-surface: #ffffff;
	--c-border: #e2e8f0;
	--c-text: #1e293b;
	--c-muted: #64748b;
	--radius: 10px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
	--shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 10px 24px -4px rgba(15, 23, 42, .1);
}

/* Base typography */
body {
	font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--c-text);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
	color: var(--c-navy);
	font-weight: 600;
	letter-spacing: -.01em;
}
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }
.text-muted { color: var(--c-muted) !important; }

/* Top bar */
#topbar.navbar {
	background: var(--c-navy) !important;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 2px 8px rgba(15, 23, 42, .25);
	min-height: 56px;
}
#topbar .navbar-brand {
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: lowercase;
}
#topbar .navbar-brand img {
	max-height: 36px;
	margin-right: 6px;
}
#topbar .navbar-brand .brand-text {
	background: linear-gradient(90deg, #d4a017, #ffe082, #ffffff, #ffe082, #d4a017);
	background-size: 200% 100%;
	animation: login-flow 3s linear infinite;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	font-family: "Sora", "Segoe UI", system-ui, sans-serif;
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
	#topbar .navbar-brand .brand-text { animation: none; }
}
#topbar .btn-dark {
	background: transparent;
	border: 0;
}
#topbar .btn-dark:hover { background: rgba(255, 255, 255, .1); }
#topbar .user-menu .nav-link,
#topbar .user-menu .btn-link {
	color: #e2e8f0;
	text-decoration: none;
}

/* Sidebar */
#sidebar {
	background: var(--c-navy) !important;
	min-width: 260px;
	max-width: 260px;
	padding: 16px 12px;
	min-height: calc(100vh - 50px);
}
#sidebar.active { margin-left: -260px; }
#main #main-content { width: calc(100% - 260px); }
#main #main-content.active { width: 100%; }
#sidebar .navbar-nav a.nav-link {
	color: #cbd5e1;
	font-size: 14px;
	font-weight: 500;
	padding: 10px 14px !important;
	border: 0;
	border-radius: 8px;
	margin-bottom: 2px;
	transition: background .15s, color .15s;
}
#sidebar .navbar-nav a.nav-link:hover {
	background: rgba(255, 255, 255, .08);
	color: #fff;
}
#sidebar .navbar-nav a.nav-link.active {
	background: var(--c-primary);
	color: #fff;
	box-shadow: 0 2px 8px rgba(37, 99, 235, .4);
}
#sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }
#sidebar .navbar-nav a.nav-link .fa {
	width: 22px;
	margin-right: 8px;
	text-align: center;
	opacity: .85;
}
#sidebar .navbar-nav a.nav-link.has-active {
	color: #fff;
}
#sidebar .navbar-nav a.dropdown-toggle::after {
	margin-top: 8px;
	transition: transform .2s;
}
#sidebar .navbar-nav a.dropdown-toggle[aria-expanded="true"]::after {
	transform: rotate(180deg);
}
#sidebar .submenu {
	margin: 2px 0 6px 22px;
	padding-left: 18px;
	border-left: 1px solid rgba(255, 255, 255, .12);
}
#sidebar .submenu a.nav-link {
	font-size: 13.5px;
	font-weight: 400;
	padding: 8px 12px !important;
}

@media (max-width: 768px) {
	#sidebar { margin-left: -260px; }
	#sidebar.active { margin-left: 0; }
	#main #main-content { width: 100%; }
	#main #main-content.active { width: calc(100% - 260px); }
}

/* Page header band */
#page-content .bg-light {
	background: var(--c-surface) !important;
	border-bottom: 1px solid var(--c-border);
	padding: 20px 24px !important;
}
#page-content .record-title,
#page-content h4 {
	font-size: 1.35rem;
	margin: 0;
}
#page-content section.page > .container-fluid,
#page-content section.page > .container {
	padding-left: 24px;
	padding-right: 24px;
}

/* Cards */
.card {
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	background: var(--c-surface);
}
.card-header {
	background: transparent;
	border-bottom: 1px solid var(--c-border);
	font-weight: 600;
}

/* Tables */
.table {
	color: var(--c-text);
	background: var(--c-surface);
}
.table-responsive,
.table-responsive-md,
.table-responsive-sm {
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--c-border);
	background: var(--c-surface);
}
.table thead th {
	background: #f8fafc;
	color: var(--c-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	border-top: 0;
	border-bottom: 1px solid var(--c-border);
	padding: 12px 14px;
	white-space: nowrap;
}
.table thead th a { color: inherit; text-decoration: none; }
.table td {
	padding: 12px 14px;
	vertical-align: middle;
	border-top: 1px solid #f1f5f9;
}
.table-striped tbody tr:nth-of-type(odd) { background: #fafbfd; }
.table-hover tbody tr:hover { background: #eff6ff; }

/* Forms */
.form-control,
.custom-select,
.selectize-input {
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: .55rem .8rem;
	height: auto;
	min-height: 40px;
	font-size: 15px;
	color: var(--c-text);
	transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.custom-select:focus {
	border-color: var(--c-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
label,
.control-label {
	font-weight: 500;
	color: var(--c-text);
	margin-bottom: .35rem;
}
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group-append .btn { border-radius: 0 8px 8px 0; }

/* Buttons */
.btn {
	border-radius: 8px;
	font-weight: 500;
	padding: .5rem 1rem;
	transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
	background: var(--c-primary);
	border-color: var(--c-primary);
}
.btn-primary:hover,
.btn-primary:focus {
	background: var(--c-primary-dark);
	border-color: var(--c-primary-dark);
}
.btn-sm { padding: .3rem .7rem; font-size: 13px; }

/* Alerts and flash messages */
.alert {
	border: 0;
	border-left: 4px solid;
	border-radius: 8px;
	box-shadow: var(--shadow-sm);
}
.alert-danger { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.alert-success { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.alert-warning { border-color: #d97706; background: #fffbeb; color: #92400e; }
.alert-info { border-color: #0284c7; background: #f0f9ff; color: #075985; }

/* Pagination, breadcrumb, modal */
.pagination .page-link {
	border: 0;
	border-radius: 6px;
	margin: 0 2px;
	color: var(--c-text);
}
.pagination .page-item.active .page-link { background: var(--c-primary); color: #fff; }
.breadcrumb { background: transparent; }
.modal-content {
	border: 0;
	border-radius: 14px;
	box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
	background: var(--c-surface);
	color: var(--c-muted);
	font-size: 13px;
	padding: 16px 0;
	margin-top: 32px;
}
.footer a { color: var(--c-muted); }
.footer a:hover { color: var(--c-primary); }

/* Login page */
.login-body {
	padding-top: 0;
	background: var(--c-surface);
	overflow: auto;
}
.login-page {
	display: flex;
	min-height: 100vh;
}
.login-aside {
	position: relative;
	overflow: hidden;
	flex: 1 1 50%;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 44px 44px,
		linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 44px 44px,
		linear-gradient(135deg, #060f1f 0%, var(--c-navy) 45%, #1e3a8a 100%);
	color: #e2e8f0;
	padding: 48px;
}
.login-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .55;
	animation: login-float 14s ease-in-out infinite;
}
.orb-1 { width: 340px; height: 340px; top: -90px; left: -80px; background: #2563eb; }
.orb-2 { width: 300px; height: 300px; right: -90px; bottom: -70px; background: #d4a017; opacity: .35; animation-delay: -5s; }
.orb-3 { width: 220px; height: 220px; top: 55%; left: 35%; background: #0ea5e9; opacity: .3; animation-delay: -9s; }
@keyframes login-float {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(40px, -30px) scale(1.12); }
}
.login-aside-inner { position: relative; z-index: 1; max-width: 440px; animation: login-up .8s ease both; }
.login-aside-logo-wrap {
	display: inline-flex;
	padding: 16px;
	margin-bottom: 26px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 22px;
	background: rgba(255, 255, 255, .08);
	backdrop-filter: blur(10px);
	box-shadow: 0 12px 34px rgba(0, 0, 0, .3), 0 0 40px rgba(212, 160, 23, .25);
}
.login-aside-logo { max-height: 72px; display: block; }
.login-aside h1 {
	margin-bottom: 16px;
	font-family: "Sora", "Segoe UI", system-ui, sans-serif;
	font-size: 2.3rem;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	background: linear-gradient(90deg, #d4a017, #ffe082, #ffffff, #ffe082, #d4a017);
	background-size: 200% 100%;
	animation: login-flow 3s linear infinite;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
@keyframes login-flow { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes login-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-aside p {
	font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
	font-size: 1.05rem;
	line-height: 1.7;
	color: #cbd5e1;
}
.login-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.login-chips li {
	padding: 7px 14px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	backdrop-filter: blur(6px);
	font-size: .85rem;
	font-weight: 600;
	color: #f1f5f9;
}
.login-chips li i { margin-right: 6px; color: #ffe082; }
.login-main {
	flex: 1 1 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background:
		radial-gradient(circle at 85% 10%, rgba(37, 99, 235, .12), transparent 45%),
		radial-gradient(circle at 10% 90%, rgba(212, 160, 23, .12), transparent 45%),
		var(--c-bg);
}
.login-card {
	position: relative;
	width: 100%;
	max-width: 420px;
	overflow: hidden;
	background: var(--c-surface);
	border-radius: 20px;
	padding: 44px 36px 36px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
	animation: login-up .7s ease both;
}
.login-card::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 5px;
	background: linear-gradient(90deg, #1e3a8a, #2563eb, #d4a017);
}
.login-card-header { margin-bottom: 28px; }
.login-card-header h2 {
	margin-bottom: 4px;
	font-family: "Sora", "Segoe UI", system-ui, sans-serif;
	font-size: 1.65rem;
	font-weight: 800;
}
.login-mobile-logo {
	max-height: 48px;
	margin-bottom: 16px;
	display: block;
}
.input-icon { position: relative; }
.input-icon > .fa {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	pointer-events: none;
}
.input-icon .form-control { padding-left: 40px; height: 48px; border-radius: 12px; }
.input-icon .form-control:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.input-icon:focus-within > .fa { color: #2563eb; }
.input-icon .toggle-password {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: #94a3b8;
	padding: 8px 12px;
	cursor: pointer;
}
.input-icon .toggle-password:hover { color: var(--c-text); }
.btn-login {
	padding: .75rem 1rem;
	font-size: 16px;
	font-weight: 700;
	margin-top: 8px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, #1e3a8a, #2563eb);
	box-shadow: 0 10px 22px rgba(37, 99, 235, .35);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-login:hover, .btn-login:focus {
	filter: brightness(1.1);
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(37, 99, 235, .45);
}
.btn-login:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
	.login-orb, .login-aside h1, .login-aside-inner, .login-card { animation: none; }
}
.login-footer {
	margin-top: 28px;
	text-align: center;
	font-size: 13px;
	color: var(--c-muted);
}
@media (max-width: 575px) {
	.login-card { padding: 28px 22px; }
}
