/* Brand overrides — keep the trading dashboard visually consistent with the
   public site (black background, brand red accent, Lato type). Loaded after
   css/style.default.css so these rules win on selectors of equal specificity. */

:root {
	--brand-red: rgb(196, 0, 0);
	--brand-red-dark: #7a0000;
	--brand-red-light: #e23b3b;
	--brand-black: #000;
	--brand-panel: #0d0d0d;
	--brand-border: #2a2a2a;
}

body {
	font-family: 'Lato', sans-serif;
	background-color: var(--brand-black);
}

a {
	color: var(--brand-red);
}
a:hover,
a:focus {
	color: var(--brand-red-light);
}

.text-primary {
	color: var(--brand-red) !important;
}

/* Top navbar */
nav.navbar {
	background: var(--brand-black);
	border-bottom: 1px solid var(--brand-border);
}
nav.navbar .navbar-brand .brand-logo {
	height: 30px;
	width: auto;
}
@media (max-width: 575px) {
	nav.navbar .navbar-brand .brand-logo {
		height: 24px;
	}
}
nav.navbar .navbar-brand .brand-logo-icon {
	height: 32px;
	width: auto;
}
nav.navbar {
	min-height: 70px;
}
nav.navbar .navbar-header {
	display: flex;
	align-items: center;
	gap: 18px;
}
nav.navbar .sidebar-toggle {
	background: var(--brand-panel);
	border: 1px solid var(--brand-border);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9a9a9a;
	transition:
		border-color 0.2s ease,
		color 0.2s ease;
}
nav.navbar .sidebar-toggle:hover {
	border-color: var(--brand-red);
	color: #fff;
}
nav.navbar .right-menu {
	display: flex;
	align-items: center;
	gap: 18px;
}
nav.navbar .right-menu .logout .nav-link {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #9a9a9a;
}
nav.navbar .right-menu .logout .nav-link:hover {
	color: var(--brand-red);
}

/* Sidebar */
nav#sidebar {
	background: var(--brand-black);
	border-right: 1px solid var(--brand-border);
}
nav#sidebar a[aria-expanded='true'] {
	background: var(--brand-panel);
}
nav#sidebar li a:hover {
	background: var(--brand-panel);
}
nav#sidebar li a:hover i,
nav#sidebar li li a:hover i {
	color: var(--brand-red);
}
nav#sidebar li li a {
	background: var(--brand-black);
}
nav#sidebar li li a:hover {
	background: var(--brand-panel);
}
nav#sidebar li.active::before {
	background: var(--brand-red);
}
nav#sidebar li.active > a {
	background: var(--brand-panel);
	color: #fff;
}
nav#sidebar li.active i,
nav#sidebar li li.active i {
	color: var(--brand-red);
}
nav#sidebar li li.active > a {
	background: var(--brand-panel);
}
nav#sidebar .avatar {
	border-color: var(--brand-panel);
}

/* Mobile sidebar: turn the icon-only collapsed rail into a full slide-in
   drawer anchored to the right edge (toggled via the existing .shrinked
   class from js/front.js), with a bold pill-style active state.
   Note: .shrinked means something different at each breakpoint — on desktop
   it collapses the sidebar to an 80px icon rail (style.default.css, base
   rules, unscoped by media query), but here it means "drawer is open." Its
   selectors carry higher specificity (ID + class) than a plain nav#sidebar
   rule, so every override below re-declares the .shrinked variant too. */
@media (max-width: 991px) {
	/* Keep the header (and its toggle button) above the backdrop below so
	   it stays clickable to close the drawer once it's open — nav.navbar
	   has no position set elsewhere, so its z-index normally has no effect
	   and the fixed backdrop paints over it. */
	nav.navbar {
		position: relative;
		z-index: 1060;
	}
	nav#sidebar,
	nav#sidebar.shrinked {
		position: fixed;
		top: 0;
		left: 0;
		right: auto;
		width: 280px;
		max-width: 84vw;
		height: 100vh;
		margin-left: 0;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 1050;
		box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5);
		overflow-y: auto;
	}
	nav#sidebar.shrinked {
		transform: translateX(0);
	}
	body:has(nav#sidebar.shrinked)::after {
		content: '';
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.6);
		z-index: 1040;
	}
	.page-content.active {
		width: 100%;
	}
	nav#sidebar .sidebar-header,
	nav#sidebar.shrinked .sidebar-header {
		padding: 24px 20px;
	}
	nav#sidebar.shrinked .sidebar-header .title {
		display: block;
	}
	nav#sidebar span.heading,
	nav#sidebar.shrinked span.heading {
		margin-left: 20px;
		text-align: left;
		display: block;
		font-size: 1.1rem;
	}
	nav#sidebar ul a,
	nav#sidebar.shrinked ul a {
		padding: 14px 20px;
		display: flex;
		align-items: center;
		text-align: left;
		font-size: 0.95rem;
		word-break: normal;
	}
	nav#sidebar ul i,
	nav#sidebar.shrinked ul i {
		display: inline-block !important;
		width: auto !important;
		text-align: left !important;
		font-size: 1.1rem;
		margin-right: 14px !important;
		padding-right: 0 !important;
		border-right: none !important;
	}
	nav#sidebar li a,
	nav#sidebar.shrinked li a {
		margin: 2px 12px;
		border-radius: 10px;
	}
	nav#sidebar li::before {
		display: none;
	}
	nav#sidebar li.active > a,
	nav#sidebar.shrinked li.active > a {
		background: var(--brand-red);
		color: #fff;
	}
	nav#sidebar li.active i,
	nav#sidebar.shrinked li.active i {
		color: #fff;
	}
	nav#sidebar li li a,
	nav#sidebar.shrinked li li a {
		margin: 2px 12px 2px 24px;
		border-radius: 10px;
	}
}

/* Page background / cards */
.page-content {
	background:
		radial-gradient(
			900px 500px at 15% -10%,
			rgba(196, 0, 0, 0.16),
			transparent 60%
		),
		var(--brand-black);
}
.page-header {
	background: transparent;
	border-bottom: 1px solid var(--brand-border);
	padding: 28px 15px 22px;
	margin-bottom: 36px;
}
.page-header h2 {
	color: #fff;
	font-size: 1.5rem;
	font-weight: 700;
}
.block,
.card,
.stats-2-block,
.statistic-block,
.dropdown-menu {
	background: var(--brand-panel) !important;
	border: 1px solid var(--brand-border);
}
.footer,
.footer__block {
	background: var(--brand-black);
	border-top: 1px solid var(--brand-border);
}

/* Stat widgets */
.dashtext-1,
.dashtext-3 {
	color: var(--brand-red) !important;
}
.dashtext-2,
.dashtext-4 {
	color: var(--brand-red-light) !important;
}
.dashbg-1,
.dashbg-3 {
	background: var(--brand-red);
}
.dashbg-2,
.dashbg-4 {
	background: var(--brand-red-dark);
}

/* Buttons */
.btn-primary {
	color: #fff;
	background-color: var(--brand-red);
	border-color: var(--brand-red);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
	background-color: var(--brand-red-dark);
	border-color: var(--brand-red-dark);
	box-shadow: 0 0 0 0.2rem rgba(196, 0, 0, 0.4);
}
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
	background-color: var(--brand-red-dark);
	border-color: var(--brand-red-dark);
}

/* Login / Register pages */
.login-page::before {
	background: var(--brand-black);
}
.login-page .form-holder .info {
	background: linear-gradient(135deg, var(--brand-red), var(--brand-black));
	color: #fff;
}
.login-page .form-holder .form {
	background: var(--brand-panel);
}
.login-page .form-holder .form a.forgot-pass,
.login-page .form-holder .form a.signup {
	color: var(--brand-red);
}
.login-page .form-holder .form #login,
.login-page .form-holder .form #register {
	color: #fff;
}
.login-page .login-logo {
	display: inline-block;
	font-size: 1.8rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 24px;
	text-decoration: none;
}
.login-page .login-logo strong {
	color: var(--brand-red);
}

/* ============================================================
   Dashboard overhaul — KPI cards, sidebar polish, tables, charts
   ============================================================ */

.block,
.card,
.stats-2-block,
.statistic-block {
	border-radius: 14px !important;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* KPI stat cards */
.statistic-block {
	padding: 26px 24px 22px;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}
.statistic-block:hover {
	transform: translateY(-3px);
	border-color: rgba(196, 0, 0, 0.45);
	box-shadow: 0 10px 30px rgba(196, 0, 0, 0.15);
}
.statistic-block .progress-details {
	flex-direction: column;
	align-items: flex-start !important;
	gap: 16px;
}
.statistic-block .title {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
}
.statistic-block .title strong {
	color: #9a9a9a;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.statistic-block .title .icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
	color: #fff;
	font-size: 1.05rem;
	box-shadow: 0 6px 16px rgba(196, 0, 0, 0.35);
}
.statistic-block .number {
	font-size: 2rem;
	font-weight: 800;
	color: #fff !important;
	letter-spacing: -0.01em;
}
/* The old progress bar implied a fake percentage with no real data behind
   it — replace with a plain decorative accent so the card keeps its visual
   anchor without claiming a number that isn't real. */
.statistic-block .progress-template {
	height: 4px;
	border-radius: 4px;
	background: var(--brand-border);
	margin-top: 16px;
	overflow: hidden;
}
.statistic-block .progress-bar-template {
	border-radius: 4px;
}

/* Trade panel + chart card chrome */
.stats-2-block {
	padding: 20px;
}
.stats-2-block .form-control {
	background: var(--brand-black);
	border: 1px solid var(--brand-border);
	color: #fff;
	border-radius: 8px;
}
.stats-2-block .form-control:focus {
	border-color: var(--brand-red);
	box-shadow: 0 0 0 0.2rem rgba(196, 0, 0, 0.25);
	background: var(--brand-black);
	color: #fff;
}
.stats-2-block label {
	color: #9a9a9a;
	font-size: 0.82rem;
	font-weight: 600;
}

/* BUY/SELL trade buttons — pill shape, semantic colors kept distinct from brand red */
.btn-success,
.btn-danger {
	border-radius: 50px !important;
	font-weight: 700;
	letter-spacing: 0.03em;
	border: none !important;
}
.btn-success {
	background: #1a7d4f !important;
}
.btn-success:hover,
.btn-success:focus {
	background: #155f3c !important;
}
.btn-danger {
	background: #b42330 !important;
}
.btn-danger:hover,
.btn-danger:focus {
	background: #8e1c26 !important;
}
.btn-primary.btn-block,
.btn.btn-primary {
	border-radius: 10px;
	font-weight: 600;
}

/* Alerts — Bootstrap's default light backgrounds clash with the dark theme */
.alert {
	border-radius: 10px;
	border: 1px solid transparent;
}
.alert-danger {
	background: rgba(180, 35, 48, 0.15);
	border-color: rgba(180, 35, 48, 0.4);
	color: #ff8a93;
}
.alert-success {
	background: rgba(26, 125, 79, 0.15);
	border-color: rgba(26, 125, 79, 0.4);
	color: #5fd99a;
}

/* Trading history table */
.table-dark {
	background: transparent;
}
.table-dark th {
	color: #9a9a9a;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--brand-border);
	background: transparent;
}
.table-dark td {
	border-color: var(--brand-border);
	vertical-align: middle;
}
.table-dark tr:hover td {
	background: rgba(255, 255, 255, 0.02);
}

/* Avatar fallback — source.unsplash.com/random was shut down, so the old
   <img> avatars were dead links. Use initials/an icon instead of a photo. */
.avatar-fallback {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
	color: #fff;
	font-weight: 700;
}
nav.navbar .dropdown-item.message .profile .avatar-fallback {
	font-size: 1.25rem;
}
nav#sidebar .avatar .avatar-fallback {
	font-size: 1.3rem;
}
.avatar-fallback--admin {
	background: linear-gradient(135deg, #3a3a3a, #000);
	font-size: 1.1rem !important;
}

/* Sidebar active-page indicator (class added server-side in header.php) */
nav#sidebar li a {
	border-radius: 0 20px 20px 0;
	margin-right: 12px;
}

/* ============================================================
   Auth pages (login / register) — split-screen redesign
   ============================================================ */

.login-page .form-holder .info {
	position: relative;
	overflow: hidden;
	padding: 48px 40px;
}
.auth-visual {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: flex-start;
	gap: 10px;
}
.auth-visual__chart {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 38%;
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 0 4px;
	opacity: 0.35;
	z-index: 0;
}
.auth-visual__chart span {
	flex: 1;
	height: var(--h);
	background: rgba(255, 255, 255, 0.5);
	border-radius: 3px 3px 0 0;
	animation: auth-bar-pulse 3.2s ease-in-out infinite;
	animation-delay: var(--d, 0s);
}
@keyframes auth-bar-pulse {
	0%,
	100% {
		opacity: 0.55;
	}
	50% {
		opacity: 0.9;
	}
}
@media (prefers-reduced-motion: reduce) {
	.auth-visual__chart span {
		animation: none;
	}
}
.auth-visual__line {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 38%;
	z-index: 0;
	width: 100%;
}
.auth-visual__badge {
	position: relative;
	z-index: 1;
	align-self: flex-end;
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	padding: 10px 14px;
	backdrop-filter: blur(4px);
}
.auth-visual__badge i {
	color: #ffd166;
	font-size: 1.1rem;
}
.auth-visual__badge strong {
	display: block;
	font-size: 0.82rem;
}
.auth-visual__badge span {
	display: block;
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 0.7);
}
.auth-visual__content {
	position: relative;
	z-index: 1;
}
.auth-visual__content img {
	max-width: 100%;
	height: auto;
}
.info .auth-visual__content h1 {
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 18px 0 12px;
}
.auth-visual__content p {
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.95rem;
	max-width: 320px;
}

/* Static label-above fields (replaces the old floating-label underline style
   for these two pages — no JS dependency, matches the boxed-input reference) */
.auth-field {
	margin-bottom: 20px;
}
.auth-field label {
	display: block;
	color: #b5b5b5;
	font-size: 0.82rem;
	font-weight: 600;
	margin-bottom: 8px;
}
.auth-input {
	width: 100%;
	background: var(--brand-black);
	border: 1px solid var(--brand-border);
	border-radius: 10px;
	padding: 13px 16px;
	color: #fff;
	font-size: 0.95rem;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}
.auth-input::placeholder {
	color: #6a6a6a;
}
.auth-input:focus {
	outline: none;
	border-color: var(--brand-red);
	box-shadow: 0 0 0 0.2rem rgba(196, 0, 0, 0.25);
}
.auth-input.is-invalid {
	border-color: #bb414d;
}
.auth-password-wrap {
	position: relative;
}
.auth-password-wrap .auth-input {
	padding-right: 46px;
}
.auth-password-toggle {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #8a8d93;
	padding: 4px;
	cursor: pointer;
}
.auth-password-toggle:hover {
	color: #fff;
}
.auth-submit {
	border-radius: 50px !important;
	padding: 13px 0;
	font-weight: 700;
	letter-spacing: 0.02em;
}
.auth-switch {
	margin-top: 18px;
	color: #9a9a9a;
	font-size: 0.9rem;
}
.auth-switch a {
	font-weight: 700;
}
