/* =====================================================================
   RichUps — Account Dashboard + Sidebar Styles (Phase 5B.1)
===================================================================== */

:root {
	--rp-green-900: #1d3a23;
	--rp-green-700: #2c5a36;
	--rp-green-500: #4a8f57;
	--rp-green-300: #9bc4a0;
	--rp-green-100: #d8e7da;
	--rp-green-50:  #e7f1e9;
	--rp-earth:     #b08a5c;
	--rp-cream:     #faf7f1;
	--rp-ink:       #1f2b22;
	--rp-mute:      #6c7c70;
	--rp-line:      #dde6df;
}


/* ─── Page wrapper ─────────────────────────────────────────── */
.rp-account-body {
	background: var(--rp-cream);
	min-height: 100vh;
}

.rp-account-main {
	padding: 40px 0 80px;
	min-height: calc(100vh - 200px);
}

.rp-account-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 28px;
	align-items: flex-start;
}


/* =====================================================================
   SIDEBAR
===================================================================== */

.rp-sidebar-toggle {
	display: none;          /* desktop hidden */
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	background: #fff;
	border: 1px solid var(--rp-line);
	border-radius: 12px;
	color: var(--rp-ink);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	margin-bottom: 16px;
	font-family: inherit;
}

.rp-sidebar-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 998;
	opacity: 0;
	transition: opacity .25s ease;
}
.rp-sidebar-backdrop.is-visible {
	display: block;
	opacity: 1;
}

.rp-sidebar-close {
	display: none;
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 999px;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

.rp-account-sidebar {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(28, 60, 35, 0.06);
	border: 1px solid var(--rp-line);
	overflow: hidden;
	position: sticky;
	top: 100px;
}


/* ─── Profile card in sidebar ─────────────────────────────── */
.rp-sidebar-profile {
	padding: 28px 24px 24px;
	background: linear-gradient(135deg, var(--rp-green-700) 0%, var(--rp-green-900) 100%);
	color: #fff;
	text-align: center;
	position: relative;
}

.rp-sidebar-avatar {
	width: 100px;
	height: 100px;
	margin: 0 auto 14px;
	border-radius: 50%;
	overflow: hidden;
	border: 3px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	background: var(--rp-green-500);
}
.rp-sidebar-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.rp-sidebar-avatar-initials {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 1px;
	font-family: 'Segoe UI', sans-serif;
}

.rp-sidebar-name {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 6px;
	line-height: 1.3;
}

.rp-sidebar-ref {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
}
.rp-sidebar-ref i {
	font-size: 10px;
}

.rp-sidebar-email {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
	margin: 0 auto;
}


/* ─── Nav ─────────────────────────────────────────────────── */
.rp-sidebar-nav {
	padding: 12px 12px 16px;
	display: flex;
	flex-direction: column;
}

.rp-sidebar-link {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 12px 16px;
	border-radius: 10px;
	color: var(--rp-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: all .15s;
}
.rp-sidebar-link:hover {
	background: var(--rp-green-50);
	color: var(--rp-green-700);
}
.rp-sidebar-link.is-active {
	background: var(--rp-green-700);
	color: #fff;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(28, 60, 35, 0.2);
}
.rp-sidebar-link i {
	width: 18px;
	text-align: center;
	font-size: 14px;
}

.rp-sidebar-sep {
	height: 1px;
	background: var(--rp-line);
	margin: 8px 4px;
}

.rp-sidebar-admin {
	color: var(--rp-earth);
}
.rp-sidebar-admin:hover {
	background: rgba(176, 138, 92, 0.1);
	color: var(--rp-earth);
}

.rp-sidebar-logout {
	color: #dc2626;
}
.rp-sidebar-logout:hover {
	background: #fef2f2;
	color: #dc2626;
}


/* =====================================================================
   DASHBOARD CONTENT
===================================================================== */

.rp-account-content {
	min-width: 0;       /* allow grid item to shrink */
}


/* ─── Alerts ──────────────────────────────────────────────── */
.rp-acc-alert {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-radius: 12px;
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.5;
}
.rp-acc-alert i { font-size: 18px; flex-shrink: 0; }
.rp-acc-alert-success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}
.rp-acc-alert-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}


/* ─── Welcome banner ──────────────────────────────────────── */
.rp-dash-welcome {
	background: linear-gradient(135deg, var(--rp-green-500) 0%, var(--rp-green-700) 100%);
	color: #fff;
	border-radius: 16px;
	padding: 28px 32px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	box-shadow: 0 8px 24px rgba(28, 60, 35, 0.15);
	position: relative;
	overflow: hidden;
}
.rp-dash-welcome::before {
	content: '';
	position: absolute;
	right: -40px;
	top: -40px;
	width: 200px;
	height: 200px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 50%;
}
.rp-dash-welcome-text { position: relative; z-index: 1; }
.rp-dash-welcome h1 {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #fff;
}
.rp-dash-welcome p {
	font-size: 14px;
	margin: 0;
	opacity: 0.9;
}
.rp-dash-welcome-deco {
	flex-shrink: 0;
	opacity: 0.9;
}


/* ─── Widgets grid ────────────────────────────────────────── */
.rp-dash-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 28px;
}

.rp-dash-widget {
	background: #fff;
	border-radius: 14px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	border: 1px solid var(--rp-line);
	text-decoration: none;
	color: inherit;
	transition: all .2s;
	position: relative;
}
.rp-dash-widget:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(28, 60, 35, 0.1);
	border-color: var(--rp-green-300);
	color: inherit;
}

.rp-widget-icon {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	flex-shrink: 0;
}
.rp-widget-orders .rp-widget-icon {
	background: #dbeafe;
	color: #1d4ed8;
}
.rp-widget-referrals .rp-widget-icon {
	background: var(--rp-green-50);
	color: var(--rp-green-700);
}
.rp-widget-earnings .rp-widget-icon {
	background: #fef3c7;
	color: #b45309;
}

.rp-widget-body { flex: 1; min-width: 0; }
.rp-widget-label {
	font-size: 12px;
	color: var(--rp-mute);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}
.rp-widget-value {
	font-size: 24px;
	font-weight: 700;
	color: var(--rp-ink);
	line-height: 1.2;
}
.rp-widget-meta {
	font-size: 12px;
	color: var(--rp-mute);
	margin-top: 4px;
}

.rp-widget-arrow {
	color: var(--rp-mute);
	font-size: 12px;
	opacity: 0;
	transition: all .2s;
	flex-shrink: 0;
}
.rp-dash-widget:hover .rp-widget-arrow {
	opacity: 1;
	transform: translateX(4px);
}


/* ─── Dashboard cards ─────────────────────────────────────── */
.rp-dash-card {
	background: #fff;
	border-radius: 14px;
	border: 1px solid var(--rp-line);
	margin-bottom: 20px;
	overflow: hidden;
}

.rp-dash-card-head {
	padding: 18px 24px;
	border-bottom: 1px solid var(--rp-line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.rp-dash-card-head h2 {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	color: var(--rp-ink);
	display: flex;
	align-items: center;
	gap: 10px;
}
.rp-dash-card-head h2 i {
	color: var(--rp-green-700);
	font-size: 16px;
}

.rp-dash-link {
	color: var(--rp-green-700);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.rp-dash-link:hover {
	color: var(--rp-green-900);
}
.rp-dash-link i { font-size: 11px; }

.rp-dash-card-body {
	padding: 20px 24px;
}


/* ─── Empty state ─────────────────────────────────────────── */
.rp-dash-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--rp-mute);
}
.rp-dash-empty i {
	font-size: 48px;
	color: var(--rp-green-300);
	margin-bottom: 14px;
}
.rp-dash-empty p {
	margin: 0 0 18px;
	font-size: 14px;
}

.rp-dash-btn {
	display: inline-block;
	padding: 10px 24px;
	background: var(--rp-green-700);
	color: #fff;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all .15s;
}
.rp-dash-btn:hover {
	background: var(--rp-green-900);
	color: #fff;
	transform: translateY(-1px);
}


/* ─── Recent orders list ──────────────────────────────────── */
.rp-dash-orders {
	display: flex;
	flex-direction: column;
}

.rp-dash-order {
	display: grid;
	grid-template-columns: 1fr auto auto auto;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--rp-line);
	text-decoration: none;
	color: inherit;
	align-items: center;
	transition: background .15s;
}
.rp-dash-order:hover {
	background: var(--rp-cream);
	margin: 0 -12px;
	padding-left: 12px;
	padding-right: 12px;
	border-radius: 8px;
	color: inherit;
}
.rp-dash-order:last-child { border-bottom: none; }

.rp-dash-order-num {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--rp-ink);
	font-size: 14px;
}
.rp-dash-order-num i { color: var(--rp-mute); font-size: 13px; }

.rp-dash-order-date {
	font-size: 13px;
	color: var(--rp-mute);
}

.rp-dash-order-total {
	font-weight: 700;
	color: var(--rp-green-700);
	font-size: 14px;
}

.rp-status-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}


/* ─── Account info ────────────────────────────────────────── */
.rp-dash-info {
	display: flex;
	flex-direction: column;
}
.rp-dash-info-row {
	display: flex;
	padding: 12px 0;
	border-bottom: 1px solid var(--rp-line);
	gap: 16px;
}
.rp-dash-info-row:last-child { border-bottom: none; }

.rp-dash-info-label {
	font-size: 13px;
	color: var(--rp-mute);
	min-width: 140px;
	flex-shrink: 0;
}
.rp-dash-info-value {
	font-size: 14px;
	color: var(--rp-ink);
	font-weight: 500;
	flex: 1;
	word-break: break-word;
}


/* ─── Referral share section ──────────────────────────────── */
.rp-dash-referral {
	background: linear-gradient(135deg, #fff 0%, var(--rp-green-50) 100%);
}

.rp-dash-referral p {
	margin: 0 0 18px;
	font-size: 14px;
	color: var(--rp-mute);
}

.rp-ref-box {
	display: grid;
	gap: 16px;
}

.rp-ref-code label,
.rp-ref-link label {
	display: block;
	font-size: 12px;
	color: var(--rp-mute);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.rp-ref-code-wrap,
.rp-ref-link-wrap {
	display: flex;
	gap: 8px;
	background: #fff;
	border: 1.5px solid var(--rp-line);
	border-radius: 10px;
	padding: 4px 4px 4px 14px;
	align-items: center;
}

.rp-ref-code-wrap code {
	flex: 1;
	font-size: 20px;
	font-weight: 700;
	color: var(--rp-green-700);
	font-family: 'Segoe UI Mono', 'Courier New', monospace;
	letter-spacing: 1px;
}

.rp-ref-link-wrap input {
	flex: 1;
	border: none;
	background: transparent;
	color: var(--rp-ink);
	font-size: 13px;
	padding: 8px 0;
	font-family: inherit;
	outline: none;
}

.rp-ref-copy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	background: var(--rp-green-700);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
	font-family: inherit;
	white-space: nowrap;
	flex-shrink: 0;
}
.rp-ref-copy:hover {
	background: var(--rp-green-900);
}
.rp-ref-copy.is-copied {
	background: #15803d;
}


/* =====================================================================
   MOBILE — sidebar slide-in (< 992px)
===================================================================== */

@media (max-width: 991px) {
	.rp-account-container {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.rp-sidebar-toggle {
		display: flex;
	}

	.rp-account-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 300px;
		max-width: 85vw;
		border-radius: 0;
		transform: translateX(-100%);
		transition: transform .3s ease;
		z-index: 999;
		overflow-y: auto;
	}
	.rp-account-sidebar.is-open {
		transform: translateX(0);
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
	}

	.rp-sidebar-close {
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

@media (max-width: 640px) {
	.rp-account-main { padding: 24px 0 60px; }
	.rp-account-container { padding: 0 14px; }

	.rp-dash-welcome {
		padding: 22px 20px;
	}
	.rp-dash-welcome h1 { font-size: 22px; }
	.rp-dash-welcome-deco { display: none; }

	.rp-dash-widgets {
		grid-template-columns: 1fr;
	}

	.rp-widget-value { font-size: 22px; }

	.rp-dash-card-head { padding: 14px 18px; }
	.rp-dash-card-body { padding: 16px 18px; }

	.rp-dash-card-head h2 { font-size: 15px; }

	.rp-dash-order {
		grid-template-columns: 1fr auto;
		gap: 6px;
	}
	.rp-dash-order-date,
	.rp-dash-order-status {
		grid-column: 1 / -1;
	}
	.rp-dash-order-status { justify-self: start; }

	.rp-dash-info-row {
		flex-direction: column;
		gap: 4px;
	}
	.rp-dash-info-label { min-width: 0; }

	.rp-ref-code-wrap,
	.rp-ref-link-wrap {
		flex-direction: column;
		align-items: stretch;
		padding: 8px;
	}
	.rp-ref-code-wrap code,
	.rp-ref-link-wrap input {
		padding: 8px 6px;
	}
	.rp-ref-copy {
		justify-content: center;
	}
}
