/* ═══════════════════════════════════════════════════════════════════════
   /user/css/dashboard.css

   Job #1 — re-skin the SAME `.fw-hdr__dropdown` markup that already lives
   in /includes/common/header.php as a persistent LEFT RAIL on the dashboard.
   That keeps the menu HTML in exactly ONE file. Two presentations:

     • Public pages (no .fw-user-body)
         .fw-hdr__user-btn = visible avatar pill
         .fw-hdr__dropdown = absolute popover (toggled by JS) / bottom sheet

     • Dashboard page (.fw-user-body) — DESKTOP (≥ 901px)
         .fw-hdr__user-btn = hidden
         .fw-hdr__dropdown = full-height fixed LEFT RAIL, always visible

     • Dashboard page (.fw-user-body) — MOBILE (≤ 900px)
         INHERITS the existing public bottom-sheet behaviour. Zero overrides.

   Job #2 — chrome + content layout shared by the dashboard:
         body bg, container padding, main column shifts right to clear the rail.

   ALL other dashboard content styles (stats cards, list items, activity feed)
   live further down — they only style what's INSIDE the main column.
   ═══════════════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────────────
   1. PAGE-BODY BACKGROUND
   Override the homepage's plain-white background with a softer gray so
   white content cards visually pop.
   ──────────────────────────────────────────────────────────────────────── */
.fw-user-body {
	background: var(--g0, #F8FAFC);
}


/* ──────────────────────────────────────────────────────────────────────
   1a. RAIL VS. MEGA-MENU — hide the rail momentarily when the main-nav
   mega-menu is open, then bring it back.

   Why this trick: the rail is a descendant of `.fw-hdr` (z-index 1000)
   and the mega-menu (`.fw-nav__sub`) is a descendant of `.fw-nav`
   (z-index 999). The rail's container wins the stacking war, so any
   z-index tweak on the rail alone can't fix it. Shifting the mega-menu's
   `left` doesn't look great either — the menu feels cramped against the
   rail edge.

   Cleanest UX: when the user hovers a main-nav item, the rail fades out
   so the mega-menu has the whole viewport to itself. When they leave
   the menu, the rail fades back in. Pure CSS via `:has()`, no JS, no
   global z-index changes — the homepage stacking is untouched.
   ──────────────────────────────────────────────────────────────────────── */
.fw-user-body:has(.fw-nav__item.open) .fw-hdr__dropdown {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}


/* ══════════════════════════════════════════════════════════════════════
   2. DESKTOP-ONLY OVERRIDES (≥ 901px) — dropdown → left rail
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {

	/* Hide the avatar-pill button + the bottom-sheet chrome on the dashboard.
	   The rail itself is now the menu — the toggle button is dead weight. */
	.fw-user-body .fw-hdr__user-btn,
	.fw-user-body .fw-hdr__dd-overlay,
	.fw-user-body .fw-hdr__dd-handle {
		display: none !important;
	}

	/* Hide the duplicate Login icon-pill in the header (user is in their
	   logged-in dashboard — no need for a Login link at the top right too). */
	.fw-user-body .fw-hdr__login {
		display: none !important;
	}

	/* Make .fw-hdr__user a plain wrapper (it's currently `position:relative`
	   to anchor the dropdown's `position:absolute`). The rail is fixed, so
	   the relative anchor is no longer needed. */
	.fw-user-body .fw-hdr__user {
		position: static !important;
	}

	/* Transform .fw-hdr__dropdown into a persistent LEFT RAIL.
	   `!important` is used on the visibility/position properties so that
	   even if core.js toggles the parent's `.open` class, the rail stays put. */
	.fw-user-body .fw-hdr__dropdown {
		position: fixed !important;
		top: 116px !important;                /* below 72px header + 44px sticky menu */
		left: 0 !important;
		right: auto !important;
		bottom: 0 !important;
		width: 280px !important;
		max-width: none !important;
		z-index: 90 !important;
		display: flex !important;
		flex-direction: column;
		gap: 1px;
		padding: 14px 12px !important;
		margin: 0 !important;
		background: var(--wh, #FFF) !important;
		border: 0 !important;
		border-right: 1px solid var(--g2, #E2E8F0) !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		transform: none !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
		overflow: hidden auto;
		scrollbar-width: thin;
		scrollbar-color: var(--g3, #CBD5E1) transparent;
		/* Smooth fade in/out for the `:has(.fw-nav__item.open)` rule above
		   so the rail vanishes/returns gracefully when the mega-menu opens. */
		transition: opacity .22s ease, visibility .22s ease !important;
	}
	.fw-user-body .fw-hdr__dropdown::-webkit-scrollbar { width: 6px; }
	.fw-user-body .fw-hdr__dropdown::-webkit-scrollbar-thumb {
		background: var(--g3, #CBD5E1);
		border-radius: 999px;
	}

	/* User block at the top of the rail — same `.fw-hdr__dropdown-top`
	   markup, just slightly nicer padding for the rail context. */
	.fw-user-body .fw-hdr__dropdown-top {
		padding: 10px 10px 16px !important;
		margin: -2px -2px 8px !important;
		background: transparent !important;
		border-bottom: 1px solid var(--g1, #F1F5F9) !important;
	}

	/* ── Side-rail menu links — glass-morphism premium feel ──
	   • Pink gradient pill on hover/active
	   • Subtle white sheen sweeps left→right on hover (1 shot, 600ms)
	   • Icon nudges right by 2px
	   • Translucent pink "halo" via box-shadow
	   • Inset 1-px highlight at the top + bottom edge mimics polished glass */
	.fw-user-body .fw-hdr__dropdown a {
		position: relative;
		overflow: hidden;                                     /* clips the sheen pseudo */
		padding: 11px 14px !important;
		border-radius: 12px;
		font-size: 13.5px !important;
		font-weight: 500;
		gap: 12px !important;
		isolation: isolate;                                   /* keep pseudo-z below content */
		transition: background .35s cubic-bezier(.22,1,.36,1),
		            color .25s ease,
		            transform .35s cubic-bezier(.22,1,.36,1),
		            box-shadow .35s ease !important;
	}
	.fw-user-body .fw-hdr__dropdown a i {
		font-size: 17px !important;
		width: 22px !important;
		text-align: center;
		color: var(--g5, #64748B) !important;
		transition: color .25s ease, transform .35s cubic-bezier(.22,1,.36,1);
		position: relative;
		z-index: 1;
	}
	.fw-user-body .fw-hdr__dropdown a span,
	.fw-user-body .fw-hdr__dropdown a {
		position: relative;
	}

	/* Sheen — translucent white diagonal swipe that sweeps across on hover.
	   Sits behind the icon/text via z-index (isolation creates the context). */
	.fw-user-body .fw-hdr__dropdown a::before {
		content: '';
		position: absolute;
		top: 0; left: -120%;
		width: 70%; height: 100%;
		background: linear-gradient(115deg,
			transparent 0%,
			rgba(255,255,255,.0) 35%,
			rgba(255,255,255,.45) 50%,
			rgba(255,255,255,.0) 65%,
			transparent 100%);
		transform: skewX(-20deg);
		transition: left .65s cubic-bezier(.22,1,.36,1);
		pointer-events: none;
		z-index: 0;
	}

	/* HOVER — pink gradient + glass halo + sheen runs once */
	.fw-user-body .fw-hdr__dropdown a:hover {
		background: linear-gradient(135deg, var(--pk, #E9348A), var(--pk-d, #D12A7D)) !important;
		color: var(--wh, #FFFFFF) !important;
		box-shadow:
			0 6px 18px -4px rgba(233,52,138,.45),
			inset 0 1px 0 rgba(255,255,255,.22),
			inset 0 -1px 0 rgba(0,0,0,.06);
		transform: translateX(2px);
	}
	.fw-user-body .fw-hdr__dropdown a:hover i {
		color: var(--wh, #FFFFFF) !important;
		transform: translateX(2px);
	}
	.fw-user-body .fw-hdr__dropdown a:hover::before {
		left: 150%;        /* sweep all the way across */
	}

	/* ACTIVE — same glass pill but PERSISTENT, plus a soft pulsing glow.
	   Matched against current page slug (Dashboard for now). */
	.fw-user-body .fw-hdr__dropdown a[href$="/dashboard"] {
		background: linear-gradient(135deg, var(--pk, #E9348A), var(--pk-d, #D12A7D)) !important;
		color: var(--wh, #FFFFFF) !important;
		font-weight: 600;
		box-shadow:
			0 6px 18px -4px rgba(233,52,138,.45),
			inset 0 1px 0 rgba(255,255,255,.22),
			inset 0 -1px 0 rgba(0,0,0,.06);
		animation: fw-rail-active-glow 3.2s ease-in-out infinite;
	}
	.fw-user-body .fw-hdr__dropdown a[href$="/dashboard"] i {
		color: var(--wh, #FFFFFF) !important;
	}
	/* Soft halo pulse on the active link — keeps the rail feeling alive. */
	@keyframes fw-rail-active-glow {
		0%, 100% { box-shadow: 0 6px 18px -4px rgba(233,52,138,.42),
		                       inset 0 1px 0 rgba(255,255,255,.22),
		                       inset 0 -1px 0 rgba(0,0,0,.06); }
		50%      { box-shadow: 0 8px 24px -2px rgba(233,52,138,.62),
		                       inset 0 1px 0 rgba(255,255,255,.30),
		                       inset 0 -1px 0 rgba(0,0,0,.06); }
	}

	/* Respect reduced-motion users — disable the sheen sweep + pulse. */
	@media (prefers-reduced-motion: reduce) {
		.fw-user-body .fw-hdr__dropdown a,
		.fw-user-body .fw-hdr__dropdown a i,
		.fw-user-body .fw-hdr__dropdown a::before {
			transition: none !important;
			animation: none !important;
		}
		.fw-user-body .fw-hdr__dropdown a:hover::before { left: -120%; }
	}

	/* Logout sits at the bottom of the rail. */
	.fw-user-body .fw-hdr__dropdown a.out {
		margin-top: auto;
		padding-top: 14px !important;
		padding-bottom: 14px !important;
		border-top: 1px solid var(--g1, #F1F5F9);
		border-radius: 0;
	}

	/* The dropdown's "Login" link is irrelevant in the rail (user is in their
	   dashboard, already signed in). Hide it on the dashboard, ONE rule. */
	.fw-user-body .fw-hdr__dropdown a[href$="/auth"]:not(.out),
	.fw-user-body .fw-hdr__dropdown a[href$="/login"]:not(.out) {
		display: none !important;
	}

	/* ── Push the main column right to clear the 280-px rail ── */
	.fw-user-body .fw-ud {
		margin-left: 280px;
	}
}


/* ══════════════════════════════════════════════════════════════════════
   3. MAIN COLUMN — content area to the right of the rail
   ══════════════════════════════════════════════════════════════════════ */
.fw-ud {
	padding: 28px 0;
	min-height: calc(100vh - 116px);
}
.fw-ud__wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 28px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}


/* ── Page head ── */
.fw-ud__page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.fw-ud__eyebrow {
	display: inline-block;
	font-size: 11px; font-weight: 600;
	color: var(--pk, #E9348A);
	text-transform: uppercase;
	letter-spacing: 2px;
	margin-bottom: 6px;
}
.fw-ud__h1 {
	font-family: var(--ff, 'Outfit', sans-serif);
	font-size: 28px; font-weight: 700;
	color: var(--dk, #0F172A);
	letter-spacing: -.4px;
	line-height: 1.2;
}
.fw-ud__h2 {
	font-family: var(--ff, 'Outfit', sans-serif);
	font-size: 16px; font-weight: 700;
	color: var(--dk, #0F172A);
	letter-spacing: -.2px;
}
.fw-ud__sub {
	margin-top: 4px;
	font-size: 14px;
	color: var(--g5, #64748B);
}


.fw-ud__btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 10px 18px;
	border-radius: 10px;
	font-size: 13.5px; font-weight: 600;
	background: var(--pk, #E9348A); color: var(--wh, #FFF);
	box-shadow: 0 2px 8px rgba(233,52,138,.22);
	transition: background .2s, transform .2s, box-shadow .2s;
}
.fw-ud__btn:hover {
	background: var(--pk-d, #D12A7D);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(233,52,138,.32);
}
.fw-ud__btn i { font-size: 14px; }


/* ── Stat cards (4-up) ── */
.fw-ud__stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}
.fw-ud__stat {
	display: flex; align-items: center; gap: 14px;
	padding: 18px;
	border-radius: 14px;
	background: var(--wh, #FFF);
	border: 1px solid var(--g2, #E2E8F0);
	transition: transform .25s, box-shadow .25s, border-color .25s;
}
.fw-ud__stat:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(15,23,42,.06);
	border-color: var(--g3, #CBD5E1);
}
.fw-ud__stat-ic {
	width: 46px; height: 46px;
	border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 20px; flex-shrink: 0;
}
.fw-ud__stat-ic--pk { background: var(--pk-bg, rgba(233,52,138,.07)); color: var(--pk, #E9348A); }
.fw-ud__stat-ic--bl { background: var(--bl-bg, rgba(20,120,200,.06)); color: var(--bl, #1478C8); }
.fw-ud__stat-ic--mt { background: var(--mt-l, #E6F9F2); color: var(--mt-d, #38B58E); }
.fw-ud__stat-ic--go { background: var(--go-l, #FDF5E6); color: var(--go-d, #C9912C); }
.fw-ud__stat b {
	font-size: 22px; font-weight: 700;
	color: var(--dk, #0F172A);
	letter-spacing: -.3px;
	line-height: 1;
}
.fw-ud__stat span {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--g5, #64748B);
	font-weight: 500;
}


/* ── Two-column grid + card shell ── */
.fw-ud__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 18px;
}
.fw-ud__card {
	background: var(--wh, #FFF);
	border: 1px solid var(--g2, #E2E8F0);
	border-radius: 14px;
	padding: 20px 20px 8px;
	display: flex; flex-direction: column;
}
.fw-ud__card-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding-bottom: 14px; margin-bottom: 6px;
	border-bottom: 1px solid var(--g1, #F1F5F9);
}
.fw-ud__see-all {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 12px; font-weight: 600;
	color: var(--bl, #1478C8);
	transition: gap .2s, color .2s;
}
.fw-ud__see-all:hover { color: var(--bl-d, #1068B0); gap: 8px; }


/* ── Upcoming-appointments list ── */
.fw-ud__list { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0; }
.fw-ud__list-item {
	display: flex; align-items: center; gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--g1, #F1F5F9);
}
.fw-ud__list-item:last-child { border-bottom: none; }
.fw-ud__list-date {
	width: 48px; padding: 6px 0;
	background: var(--pk-bg, rgba(233,52,138,.07)); color: var(--pk-d, #D12A7D);
	border-radius: 10px;
	text-align: center;
	flex-shrink: 0;
}
.fw-ud__list-date b { display: block; font-size: 18px; font-weight: 700; line-height: 1; }
.fw-ud__list-date span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.fw-ud__list-body { flex: 1; min-width: 0; }
.fw-ud__list-body h4 {
	font-size: 14px; font-weight: 600;
	color: var(--dk, #0F172A);
	margin: 0 0 3px;
	letter-spacing: -.1px;
}
.fw-ud__list-body p {
	font-size: 12px; color: var(--g5, #64748B); line-height: 1.4;
	margin: 0;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fw-ud__list-body p i { font-size: 11px; margin-right: 2px; }

.fw-ud__tag {
	display: inline-flex; align-items: center;
	padding: 4px 10px; border-radius: 100px;
	font-size: 10.5px; font-weight: 700;
	letter-spacing: .3px; white-space: nowrap;
	flex-shrink: 0;
}
.fw-ud__tag--pk { background: var(--pk-bg, rgba(233,52,138,.07)); color: var(--pk-d, #D12A7D); }
.fw-ud__tag--bl { background: var(--bl-bg, rgba(20,120,200,.06)); color: var(--bl-d, #1068B0); }
.fw-ud__tag--mt { background: var(--mt-l, #E6F9F2); color: var(--mt-d, #38B58E); }


/* ── Recent-activity (right card) ── */
.fw-ud__activity { list-style: none; padding: 0; margin: 0; }
.fw-ud__activity li {
	display: flex; align-items: flex-start; gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--g1, #F1F5F9);
}
.fw-ud__activity li:last-child { border-bottom: none; }
.fw-ud__activity i {
	font-size: 14px; color: var(--pk, #E9348A);
	background: var(--pk-bg, rgba(233,52,138,.07));
	width: 32px; height: 32px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.fw-ud__activity b { font-size: 13px; font-weight: 600; color: var(--dk, #0F172A); display: block; }
.fw-ud__activity span { font-size: 11.5px; color: var(--g5, #64748B); line-height: 1.4; }


/* ══════════════════════════════════════════════════════════════════════
   4. RESPONSIVE — below 900px the rail collapses, content goes full-width
   (the existing mobile bottom-sheet behaviour of .fw-hdr__dropdown still
   works because we DIDN'T override it inside the media query above).
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
	.fw-ud__grid { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
	.fw-ud__stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
	.fw-ud { padding: 18px 0; }
	.fw-ud__wrap { padding: 0 16px; gap: 18px; }
	.fw-ud__h1 { font-size: 24px; }
	.fw-ud__btn { padding: 9px 14px; font-size: 12.5px; }
}
@media (max-width: 600px) {
	.fw-ud__stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.fw-ud__stat { padding: 14px; }
	.fw-ud__stat-ic { width: 40px; height: 40px; font-size: 18px; }
	.fw-ud__stat b { font-size: 18px; }
	.fw-ud__h1 { font-size: 22px; }
	.fw-ud__card { padding: 16px 16px 4px; }
}
@media (max-width: 420px) {
	.fw-ud__stats { grid-template-columns: 1fr; }
}
