/* ==========================================================================
   dashboard.css — داشبورد مشتری (moobi shop)
   تم طلایی/تیره، RTL، هماهنگ با theme-gold.css
   ========================================================================== */
:root {
  --dash-gold: var(--gold, #f0c33c);
  --dash-gold-2: var(--gold-2, #ffd23f);
  --dash-bg: #090d10;
  --dash-surface: linear-gradient(180deg, #14151c 0%, #0f0f14 55%, #0c0c10 100%);
  --dash-border: rgba(255, 255, 255, .09);
  --dash-text: #e9e6f0;
  --dash-muted: #9a94a6;
}

.dash-main { background: var(--dash-bg); min-height: 100vh; padding: 40px 22px 80px; }
.dash-wrap { max-width: 1180px; margin: 0 auto; direction: rtl; font-family: inherit; }

.dash-head { margin-bottom: 26px; }
.dash-head h1 { margin: 0; color: #fff; font-size: 30px; font-weight: 900; }
.dash-head h1 span { color: var(--dash-gold); }
.dash-head p { margin: 8px 0 0; color: var(--dash-muted); font-size: 15px; }

/* حالت‌های بارگذاری/مهمان */
.dash-gate { text-align: center; color: var(--dash-muted); padding: 80px 20px; font-size: 16px; }
.dash-gate a { color: var(--dash-gold); font-weight: 700; text-decoration: none; }

/* چیدمان: نوار کناری + محتوا */
.dash-layout { display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; }

.dash-nav {
  position: sticky; top: 90px; display: flex; flex-direction: column; gap: 6px;
  background: var(--dash-surface); border: 1px solid var(--dash-border);
  border-radius: 16px; padding: 12px; box-shadow: 0 20px 44px -26px rgba(0,0,0,.9);
}
.dash-nav__btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--dash-text); font-family: inherit;
  font-size: 15px; font-weight: 600; text-align: right; transition: background .2s, color .2s;
}
.dash-nav__btn svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.dash-nav__btn:hover { background: rgba(255,255,255,.05); }
.dash-nav__btn.is-active {
  background: linear-gradient(180deg, rgba(240,195,60,.18), rgba(240,195,60,.06));
  color: var(--dash-gold);
  box-shadow: inset 0 0 0 1px rgba(240,195,60,.35);
}
.dash-nav__btn .dash-nav__badge {
  margin-inline-start: auto; min-width: 22px; text-align: center;
  background: rgba(240,195,60,.2); color: var(--dash-gold);
  border-radius: 20px; padding: 1px 7px; font-size: 12px; font-weight: 800;
}
.dash-nav__logout { margin-top: 6px; color: #ff8a8a; }
.dash-nav__logout:hover { background: rgba(255,80,80,.1); }

/* پنل‌ها */
.dash-panel { display: none; }
.dash-panel.is-active { display: block; animation: dashFade .25s ease; }
@keyframes dashFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.dash-card {
  background: var(--dash-surface); border: 1px solid var(--dash-border);
  border-radius: 16px; padding: 20px; box-shadow: 0 20px 44px -28px rgba(0,0,0,.9);
  margin-bottom: 18px;
}
.dash-card__title { margin: 0 0 14px; color: #fff; font-size: 18px; font-weight: 800; }
.dash-card__title small { color: var(--dash-muted); font-weight: 500; font-size: 13px; margin-inline-start: 8px; }

/* شبکهٔ خلاصه/آمار */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.dash-stat {
  background: rgba(255,255,255,.03); border: 1px solid var(--dash-border);
  border-radius: 13px; padding: 16px;
}
.dash-stat__k { color: var(--dash-muted); font-size: 13px; }
.dash-stat__v { color: #fff; font-size: 22px; font-weight: 900; margin-top: 4px; }
.dash-stat__v span { font-size: 13px; font-weight: 600; color: var(--dash-gold); }

/* ردیف‌های اطلاعات پروفایل */
.dash-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.dash-info__row { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.dash-info__k { color: var(--dash-muted); font-size: 12px; }
.dash-info__v { color: var(--dash-text); font-size: 15px; font-weight: 600; }

/* بَج وضعیت */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.badge--active, .badge--approved, .badge--paid, .badge--success, .badge--open { background: rgba(56,196,120,.16); color: #6fe0a0; box-shadow: inset 0 0 0 1px rgba(56,196,120,.3); }
.badge--pending { background: rgba(240,195,60,.16); color: var(--dash-gold); box-shadow: inset 0 0 0 1px rgba(240,195,60,.3); }
.badge--canceled, .badge--rejected, .badge--failed { background: rgba(255,90,90,.16); color: #ff9a9a; box-shadow: inset 0 0 0 1px rgba(255,90,90,.3); }
.badge--past, .badge--closed { background: rgba(255,255,255,.08); color: var(--dash-muted); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }

/* کارت‌های رزرو اجاره */
.rental-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rental-item {
  position: relative; background: rgba(255,255,255,.03); border: 1px solid var(--dash-border);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.rental-item.is-canceled { opacity: .62; }
/* هایلایتِ کارت وقتی از لینکِ مستقیم (پیامک) باز می‌شود */
.rental-item--focus {
  border-color: rgba(240,195,60,.7);
  box-shadow: 0 0 0 2px rgba(240,195,60,.5), 0 0 34px -6px rgba(240,195,60,.55);
  animation: rentalPulse 1.1s ease-in-out 2;
  scroll-margin-top: 96px;
}
@keyframes rentalPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(240,195,60,.5), 0 0 30px -8px rgba(240,195,60,.5); }
  50%      { box-shadow: 0 0 0 3px rgba(240,195,60,.9), 0 0 48px -4px rgba(240,195,60,.85); }
}
/* احترام به کاربرانی که حرکت کمتر می‌خواهند: هایلایتِ ثابت به‌جای پالس */
@media (prefers-reduced-motion: reduce) {
  .rental-item--focus { animation: none; }
}
.rental-item__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rental-item__title { color: #fff; font-size: 16px; font-weight: 800; }
.rental-item__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.rental-item__cell { display: flex; flex-direction: column; gap: 2px; }
.rental-item__cell b { color: var(--dash-muted); font-size: 12px; font-weight: 500; }
.rental-item__cell span { color: var(--dash-text); font-size: 14px; font-weight: 700; }
.rental-item__cell .price { color: var(--dash-gold); }
.rental-item__policy { font-size: 12.5px; color: var(--dash-muted); background: rgba(255,255,255,.03); border-radius: 9px; padding: 8px 10px; border: 1px dashed rgba(255,255,255,.12); }
.rental-item__btn {
  width: 100%; padding: 11px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800;
  background: linear-gradient(180deg, rgba(255,90,90,.9), rgba(200,50,50,.9)); color: #fff;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.rental-item__btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(255,70,70,.6); }
.rental-item__btn:disabled { background: rgba(255,255,255,.06); color: var(--dash-muted); cursor: not-allowed; }

/* جدول‌ها (تراکنش/سفارش) */
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th { text-align: right; color: var(--dash-muted); font-weight: 600; font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--dash-border); }
.dash-table td { color: var(--dash-text); padding: 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table__wrap { overflow-x: auto; }

/* فرم تیکت */
.dash-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.dash-form label { color: var(--dash-muted); font-size: 13px; margin-bottom: -6px; }
.dash-form input, .dash-form textarea {
  width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--dash-border);
  border-radius: 10px; padding: 12px 14px; color: #fff; font-family: inherit; font-size: 14px;
}
.dash-form input:focus, .dash-form textarea:focus { outline: none; border-color: rgba(240,195,60,.6); }
.dash-form textarea { min-height: 110px; resize: vertical; }
.dash-btn {
  align-self: flex-start; padding: 12px 26px; border: 0; border-radius: 11px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 800; color: #141002;
  background: linear-gradient(180deg, var(--dash-gold-2), var(--dash-gold));
  box-shadow: 0 12px 30px -12px rgba(255,190,0,.5); transition: transform .15s, box-shadow .2s;
}
.dash-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 38px -12px rgba(255,190,0,.65); }
.dash-btn:disabled { opacity: .6; cursor: wait; }

.dash-empty { text-align: center; color: var(--dash-muted); padding: 36px 16px; font-size: 14px; }
.dash-note { color: var(--dash-muted); font-size: 12.5px; margin-top: 10px; line-height: 1.7; }
.dash-link { color: var(--dash-gold); font-weight: 700; text-decoration: none; }
.dash-link:hover { text-decoration: underline; }

/* توست */
.dash-toast {
  position: fixed; inset-inline: 0; bottom: 26px; margin: 0 auto; width: max-content; max-width: 90%;
  background: #14151c; color: #fff; border: 1px solid var(--dash-border);
  border-radius: 12px; padding: 13px 22px; font-size: 14px; font-weight: 600;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.8); z-index: 9999;
  opacity: 0; transform: translateY(14px); transition: opacity .25s, transform .25s;
}
.dash-toast.show { opacity: 1; transform: none; }
.dash-toast.ok { box-shadow: 0 18px 40px -14px rgba(56,196,120,.4), inset 0 0 0 1px rgba(56,196,120,.35); }
.dash-toast.err { box-shadow: 0 18px 40px -14px rgba(255,80,80,.4), inset 0 0 0 1px rgba(255,80,80,.35); }

/* موبایل */
@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-nav {
    position: static; flex-direction: row; overflow-x: auto; gap: 4px; top: 0;
  }
  .dash-nav__btn { white-space: nowrap; padding: 10px 13px; }
  .dash-nav__btn .dash-nav__badge { margin-inline-start: 6px; }
  .dash-nav__logout { margin-top: 0; margin-inline-start: auto; }
}

/* ── اطلاعاتِ ورودِ اکانتِ اجاره (رمز سرِ تایم) ── */
.rental-cred {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.9;
}
.rental-cred--wait {
  background: rgba(255, 255, 255, .04);
  border: 1px dashed var(--dash-border);
  color: var(--dash-muted);
}
.rental-cred--show {
  background: rgba(56, 196, 120, .10);
  border: 1px solid rgba(56, 196, 120, .38);
  color: var(--dash-text);
}
.rental-cred__hd {
  font-weight: 800;
  color: #7fe0a6;
  margin-bottom: 8px;
}
.rental-cred__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  flex-wrap: wrap;
}
.rental-cred__k {
  min-width: 46px;
  font-weight: 700;
  color: var(--dash-muted);
}
.rental-cred__v {
  flex: 1;
  min-width: 140px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--dash-border);
  border-radius: 9px;
  padding: 7px 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  color: #fff;
  letter-spacing: .3px;
  overflow-x: auto;
  white-space: nowrap;
}
.rental-cred__copy {
  border: 0;
  cursor: pointer;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 12.5px;
  color: #10230f;
  background: linear-gradient(135deg, #7fe0a6, #38c478);
  min-width: 54px;
}
.rental-cred__note {
  margin-top: 8px;
  font-size: 12.5px;
  color: #f0c060;
}
.rental-cred__warn {
  margin-top: 8px;
  font-size: 12px;
  color: var(--dash-muted);
}
