/* My Account: dashboard ("میزکار", .dsh-*) and the address cards of "اطلاعات حساب کاربری" (.acc-*).
   Plain CSS (not Tailwind) so it needs no rebuild. Colour tokens match src/input.css. */

.dsh {
	--dsh-border: var(--color-gray3, #E0E5EB);
	--dsh-soft: var(--color-gray4, #EEF1F6);
	--dsh-text: var(--color-black3, #303232);
	--dsh-muted: var(--color-gray8, #6C727F);
	--dsh-blue: var(--color-blue1, #2F6ED5);
	--dsh-green: var(--color-green1, #33B36B);
	--dsh-orange: var(--color-orange1, #FC9231);
	--dsh-red: var(--color-red1, #FF3B30);
	--dsh-card: rgba(255, 255, 255, .65);
	display: flex;
	flex-direction: column;
	gap: 20px;
	color: var(--dsh-text);
}
.dsh *, .dsh *::before, .dsh *::after { box-sizing: border-box; }
.dsh a { text-decoration: none; }

/* ---- Breadcrumb above the sidebar + content (woocommerce/myaccount/my-account.php) ---- */
.account-breadcrumb { margin: 0 0 20px; }
.account-breadcrumb .breadcrumb { padding: 0; list-style: none; }
.account-breadcrumb .breadcrumb-item { display: inline-flex; align-items: center; }
.account-breadcrumb .breadcrumb-item a { display: inline-flex; align-items: center; color: #303232; transition: color .15s; }
.account-breadcrumb .breadcrumb-item a:hover { color: #000; text-decoration: underline; }

/* ---- Welcome ---- */
.dsh-hero {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 20px 24px;
	border: 1px solid var(--dsh-border);
	border-radius: 24px;
	background: linear-gradient(135deg, rgba(47, 110, 213, .10), rgba(255, 255, 255, .6) 60%);
}
.dsh-hero__text { flex: 1 1 220px; min-width: 0; }
.dsh-hero__title { margin: 0 0 6px; font-size: 20px; line-height: 1.5; color: var(--dsh-text); }
.dsh-hero__sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--dsh-muted); }
.dsh-badge {
	display: inline-flex;
	align-items: center;
	height: 24px;
	padding: 0 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	color: var(--dsh-text);
	background: var(--dsh-soft);
}
.dsh-badge.is-partner { color: #fff; background: var(--dsh-green); }
.dsh-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Buttons ---- */
.dsh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 16px;
	border: 1px solid var(--dsh-border);
	border-radius: 12px;
	background: #fff;
	font-size: 13px;
	font-weight: 700;
	color: var(--dsh-text) !important;
	transition: background .15s, border-color .15s, color .15s;
	white-space: nowrap;
}
.dsh-btn:hover { border-color: var(--dsh-text); }
.dsh-btn--primary { color: #fff !important; background: var(--dsh-text); border-color: var(--dsh-text); }
.dsh-btn--primary:hover { background: #000; }
.dsh-btn--warn { color: #fff !important; background: #d9731a; border-color: #d9731a; }
.dsh-btn--warn:hover { background: #bd6213; border-color: #bd6213; }
.dsh-btn--ghost { height: 36px; font-size: 12px; }

/* ---- Unpaid-order notice ---- */
.dsh-alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	flex-wrap: wrap;
	padding: 14px 18px;
	border: 1px solid #f5c38f;
	border-radius: 16px;
	background: #fff5e9;
	font-size: 13px;
	line-height: 1.8;
}
.dsh-alert > div { display: flex; flex-direction: column; gap: 2px; }
.dsh-alert strong { color: #9a4f0a; }

/* ---- Key numbers ---- */
.dsh-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}
/* an odd number of tiles: the last one spans the full row */
.dsh-stats > .dsh-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.dsh-stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
	border: 1px solid var(--dsh-border);
	border-radius: 20px;
	background: var(--dsh-card);
	color: var(--dsh-text);
	transition: border-color .15s, box-shadow .15s;
}
a.dsh-stat:hover { border-color: var(--dsh-text); box-shadow: 0 6px 18px rgba(48, 50, 50, .10); }
.dsh-stat__icon {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	margin-bottom: 6px;
	border-radius: 12px;
	color: var(--dsh-text);
	background: rgba(48, 50, 50, .08);
}
.dsh-stat__label { font-size: 13px; color: var(--dsh-muted); }
.dsh-stat__value { font-size: 20px; line-height: 1.5; color: var(--dsh-text); overflow-wrap: anywhere; }
.dsh-stat__value .woocommerce-Price-amount { font-weight: 700; }
.dsh-stat__hint { margin-top: 2px; font-size: 12px; color: var(--dsh-muted); }
.dsh-stat--wallet { color: #fff; border-color: transparent; background: linear-gradient(135deg, #303232 0%, #4a4f4f 100%); box-shadow: 0 12px 28px rgba(48, 50, 50, .18); }
.dsh-stat--wallet .dsh-stat__icon { color: #fff; background: rgba(255, 255, 255, .18); }
.dsh-stat--wallet .dsh-stat__label,
.dsh-stat--wallet .dsh-stat__hint { color: rgba(255, 255, 255, .8); }
.dsh-stat--wallet .dsh-stat__value,
.dsh-stat--wallet .dsh-stat__value * { color: #fff; }
a.dsh-stat--wallet:hover { border-color: transparent; box-shadow: 0 14px 30px rgba(48, 50, 50, .28); }
.dsh-stat.is-attention { border-color: #f5c38f; background: #fff5e9; }
.dsh-stat.is-attention .dsh-stat__icon { color: #d9731a; background: rgba(252, 146, 49, .18); }
.dsh-stat.is-attention .dsh-stat__hint { color: #9a4f0a; font-weight: 700; }

/* ---- Cards ---- */
.dsh-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.dsh-card {
	padding: 18px 20px;
	border: 1px solid var(--dsh-border);
	border-radius: 24px;
	background: var(--dsh-card);
	min-width: 0;
}
.dsh-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dsh-card__head h3 { margin: 0; font-size: 16px; line-height: 1.6; color: var(--dsh-text); }
.dsh-card__head a { font-size: 13px; color: var(--dsh-blue); }
.dsh-card__head a:hover { text-decoration: underline; }
.dsh-card__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---- Orders by status ---- */
.dsh-bar { display: flex; gap: 3px; height: 10px; margin-bottom: 14px; border-radius: 6px; overflow: hidden; background: var(--dsh-soft); }
.dsh-bar__seg { min-width: 6px; }
.dsh-bar__seg.is-pending, .dsh-dot.is-pending { background: var(--dsh-orange); }
.dsh-bar__seg.is-processing, .dsh-dot.is-processing { background: var(--dsh-green); }
.dsh-bar__seg.is-completed, .dsh-dot.is-completed { background: var(--dsh-blue); }
.dsh-bar__seg.is-cancelled, .dsh-dot.is-cancelled { background: var(--dsh-red); }
.dsh-bar__seg.is-other, .dsh-dot.is-other { background: var(--color-gray7, #CAD0D9); }
.dsh-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dsh-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; background: var(--dsh-soft); }
.dsh-legend__label { font-size: 12px; line-height: 1.6; color: var(--dsh-muted); }
.dsh-legend strong { grid-column: 1 / -1; font-size: 18px; line-height: 1.4; color: var(--dsh-text); }
.dsh-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 640px) { .dsh-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Lists (orders / transactions) ---- */
.dsh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dsh-list li + li { border-top: 1px solid var(--dsh-soft); }
.dsh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; color: var(--dsh-text); }
a.dsh-row:hover .dsh-row__main strong { color: var(--dsh-blue); }
.dsh-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dsh-row__main strong { font-size: 14px; }
.dsh-row__desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-row__sub { font-size: 12px; color: var(--dsh-muted); }
.dsh-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dsh-row__amount { font-size: 13px; font-weight: 700; }
.dsh-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11px; font-weight: 700; color: var(--dsh-text); background: var(--dsh-soft); }
.dsh-chip.is-completed { color: #1f4fa3; background: #e3ecfb; }
.dsh-chip.is-processing { color: #1b7a45; background: #e4f5ec; }
.dsh-chip.is-pending { color: #9a4f0a; background: #fdeedd; }
.dsh-chip.is-cancelled { color: #b3261e; background: #feeef0; }
.dsh-amount { font-size: 13px; font-weight: 700; direction: ltr; }
.dsh-amount.is-in { color: #1b7a45; }
.dsh-amount.is-out { color: #b3261e; }

.dsh-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0 4px; font-size: 13px; color: var(--dsh-muted); }
.dsh-empty p { margin: 0; }

/* ---- Empty state: centered icon + text (inc/empty-state.php) ---- */
.mc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 320px;
	padding: 40px 20px;
	text-align: center;
	color: var(--color-gray8, #6C727F);
	border: 1px dashed var(--color-gray3, #E0E5EB);
	border-radius: 24px;
	background: rgba(255, 255, 255, .55);
}
.mc-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	margin-bottom: 6px;
	border-radius: 50%;
	background: var(--color-gray4, #EEF1F6);
	color: var(--color-gray8, #6C727F);
}
.mc-empty__icon svg { width: 46px; height: 46px; }
.mc-empty__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--color-black3, #303232); }
.mc-empty__text { margin: 0; max-width: 360px; font-size: 13px; line-height: 1.9; }
.mc-empty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	margin-top: 8px;
	padding: 0 22px;
	border-radius: 12px;
	background: var(--color-black3, #303232);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s;
}
.mc-empty__btn:hover { background: #000; }
.mc-empty--compact { min-height: 0; padding: 22px 12px; border: 0; background: transparent; gap: 8px; }
.mc-empty--compact .mc-empty__icon { width: 64px; height: 64px; }
.mc-empty--compact .mc-empty__icon svg { width: 30px; height: 30px; }
.mc-empty--compact .mc-empty__title { font-size: 14px; }

/* ---- Account details ---- */
.dsh-dl { margin: 0; display: flex; flex-direction: column; }
.dsh-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 13px; }
.dsh-dl > div + div { border-top: 1px solid var(--dsh-soft); }
.dsh-dl dt { color: var(--dsh-muted); }
.dsh-dl dd { margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }

/* ---- Addresses (dashboard) ---- */
.dsh-addresses { display: flex; flex-direction: column; gap: 12px; }
.dsh-address { padding: 12px 14px; border: 1px solid var(--dsh-soft); border-radius: 16px; background: rgba(255, 255, 255, .6); }
.dsh-address h4 { margin: 0 0 4px; font-size: 13px; color: var(--dsh-muted); font-weight: 400; }
.dsh-address p { margin: 0 0 8px; font-size: 13px; line-height: 1.9; }
.dsh-address p.is-empty { color: var(--dsh-muted); }
.dsh-address a { font-size: 13px; color: var(--dsh-blue); }

/* ---- "اطلاعات حساب کاربری": address cards under the form ---- */
.acc-addresses { margin-top: 28px; }
.acc-addresses__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.acc-address-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--color-gray3, #E0E5EB); border-radius: 24px; background: rgba(255, 255, 255, .5); }
.acc-address-card h4 { margin: 0; font-size: 14px; color: var(--color-black3, #303232); }
.acc-address-card p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--color-gray2, #6C727F); }
.acc-address-card p.is-empty { color: var(--color-gray8, #9CA3AF); }
.acc-address-card__edit { align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--color-gray3, #E0E5EB); border-radius: 12px; font-size: 13px; color: var(--color-black3, #303232); background: #fff; text-decoration: none; }
.acc-address-card__edit:hover { color: var(--color-red1, #FF3B30); border-color: var(--color-red1, #FF3B30); }

/* ---- Small screens ---- */
@media (max-width: 900px) {
	.dsh-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
	.dsh-hero { padding: 16px; }
	.dsh-hero__actions { width: 100%; }
	.dsh-hero__actions .dsh-btn { flex: 1 1 140px; }
	.dsh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.dsh-stat { padding: 14px; }
	.dsh-stat__value { font-size: 17px; }
	.dsh-card { padding: 16px; border-radius: 20px; }
}


/* ---- Orders list (woocommerce/myaccount/orders.php, .ord-*) ---- */
.ord-list {
	--ord-border: var(--color-gray3, #E0E5EB);
	--ord-text: var(--color-black3, #303232);
	--ord-muted: var(--color-gray8, #6C727F);
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 32px;
}
.ord-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
	align-items: center;
	gap: 12px 20px;
	padding: 14px 18px;
	border: 1px solid var(--ord-border);
	border-radius: 16px;
	background: rgba(255, 255, 255, .65);
	box-shadow: 0 2px 8px rgba(48, 50, 50, .04);
}
.ord-card__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ord-card__num { margin: 0; font-size: 15px; line-height: 1.6; font-weight: 700; color: var(--ord-text); direction: ltr; unicode-bidi: isolate; }
.ord-card__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.7; color: var(--ord-muted); }
.ord-card__total { color: var(--ord-text); }
.ord-card__total em { font-style: normal; color: var(--ord-muted); }
.ord-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }

.ord-badge {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 11px;
	border-radius: 13px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--ord-text);
	background: var(--color-gray4, #EEF1F6);
}
.ord-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ord-badge.is-completed  { color: #1f4fa3; background: #e3ecfb; }
.ord-badge.is-processing { color: #1b7a45; background: #e4f5ec; }
.ord-badge.is-pending    { color: #9a4f0a; background: #fdeedd; }
.ord-badge.is-cancelled  { color: #b3261e; background: #feeef0; }

.ord-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--ord-text);
	border-radius: 12px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--ord-text);
	background: #fff;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.ord-btn:hover { color: #fff; background: var(--ord-text); }
.ord-btn--primary { order: -1; color: #fff; background: var(--ord-text); }
.ord-btn--primary:hover { background: #000; }

@media (max-width: 767px) {
	.ord-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
	.ord-card__head { justify-content: space-between; }
	.ord-card__actions { gap: 8px; }
	.ord-card__actions .ord-btn { flex: 1 1 0; padding: 0 10px; }
	.ord-card__actions .ord-btn--primary { flex-grow: 1.4; }
}

/* ---- Orders list (phones): "مشاهده" opens the receipt in a bottom sheet (woocommerce/myaccount/orders.php) ---- */
.ord-sheet { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: flex-end; direction: rtl; opacity: 0; transition: opacity .22s ease; }
.ord-sheet[hidden] { display: none; }
.ord-sheet.is-in { opacity: 1; }
.ord-sheet__backdrop { position: absolute; inset: 0; background: rgba(15, 18, 28, .55); }
.ord-sheet__box {
	position: relative; width: 100%; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column;
	padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: #fff; border-radius: 24px 24px 0 0;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, .2); outline: 0; transform: translateY(40px); transition: transform .26s ease;
}
.ord-sheet.is-in .ord-sheet__box { transform: none; }
.ord-sheet__grip { align-self: center; width: 44px; height: 4px; margin-bottom: 10px; border-radius: 4px; background: #D5DAE1; }
.ord-sheet__head { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; }
.ord-sheet__head h4 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.6; color: #303232; }
.ord-sheet__head h4 span { font-weight: 500; color: #6C727F; }
.ord-sheet__x { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: #303232; cursor: pointer; }
.ord-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ord-sheet__loading { margin: 0; padding: 36px 0; text-align: center; font-size: 14px; color: #6C727F; }
/* the receipt inside the sheet: no card frame, no own title (the sheet header has it) */
.ord-sheet .inv { display: block; padding: 0; border: 0; border-radius: 0; background: none; }
.ord-sheet .inv__title { display: none; }
.ord-sheet__more {
	flex: none; display: flex; align-items: center; justify-content: center; height: 52px; margin-top: 14px;
	border-radius: 14px; background: #303232; color: #fff !important; font-size: 15px; font-weight: 700; text-decoration: none;
}
.ord-sheet__more:hover { background: #000; }
@media (min-width: 768px) { .ord-sheet { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ord-sheet, .ord-sheet__box { transition: none; } }
