/* ===== نوان — سیستم طراحی ===== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root{
  --bg: #F7F2EA;
  --bg-soft: #F0E8DA;
  --card: #FFFFFF;
  --ink: #2A2420;
  --ink-soft: #8A8175;
  --line: #EAE0CE;
  --brand: #DA7756;
  --brand-dark: #C25F3F;
  --brand-tint: #FBEAE2;
  --green: #1F9D55;
  --green-tint: #E4F6EA;
  --red: #D63A3A;
  --red-tint: #FBEAEA;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 10px;
  --shadow: 0 6px 18px rgba(218,119,86,0.14);
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none; }
html,body{ height:100%; overscroll-behavior:none; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Vazirmatn', sans-serif;
  direction: rtl;
  overscroll-behavior-y: none;
  -webkit-font-smoothing:antialiased;
  -webkit-user-select:none;
  user-select:none;
  touch-action: pan-x pan-y;
}
input, textarea{
  -webkit-user-select:text; user-select:text; font-size:16px;
}
a{ text-decoration:none; color:inherit; }
button{ font-family:inherit; }
input{ font-family:inherit; }

.app{
  max-width:480px;
  margin:0 auto;
  height:100vh;
  height:100dvh;
  position:relative;
  background:var(--bg);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  padding-bottom: 24px;
  display:flex;
  flex-direction:column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app::-webkit-scrollbar{ display:none; }
.scroll-area{
  max-height: 52vh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-area::-webkit-scrollbar{ display:none; }
.hscroll-clean{
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hscroll-clean::-webkit-scrollbar{ display:none; }

/* ===== انتقال بین صفحات (شبیه اپلیکیشن) ===== */
#view{ position:relative; }
.page-slide-in-fwd{ animation: slideInFwd .26s cubic-bezier(.22,.9,.32,1) both; }
.page-slide-in-back{ animation: slideInBack .26s cubic-bezier(.22,.9,.32,1) both; }
@keyframes slideInFwd{
  from{ transform: translateX(28px); opacity:0; }
  to{ transform: translateX(0); opacity:1; }
}
@keyframes slideInBack{
  from{ transform: translateX(-28px); opacity:0; }
  to{ transform: translateX(0); opacity:1; }
}

/* ===== باتم‌شیت ===== */
.sheet-overlay{
  position:fixed; inset:0; background:rgba(20,16,12,0.45);
  opacity:0; pointer-events:none; transition:opacity .22s ease; z-index:80;
}
.sheet-overlay.open{ opacity:1; pointer-events:auto; }
.bottom-sheet{
  position:fixed; left:0; right:0; bottom:0; max-width:480px; margin:0 auto;
  background:var(--bg); border-radius:24px 24px 0 0;
  transform:translateY(100%); transition:transform .28s cubic-bezier(.22,.9,.32,1);
  z-index:90; max-height:70vh; display:flex; flex-direction:column;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
}
.bottom-sheet.open{ transform:translateY(0); }
.sheet-handle{ width:40px; height:4px; background:var(--line); border-radius:99px; margin:10px auto 6px; }
.sheet-body{ padding: 6px 16px 20px; overflow-y:auto; }

/* ===== ستاره امتیازدهی ===== */
.star-row{ display:flex; gap:6px; justify-content:center; margin: 6px 0 4px; }
.star-btn{ color:var(--line); }
.star-btn.active{ color:#F4B740; }

/* ===== نظرات ===== */
.reviews-section{ padding: 24px 14px 10px; }
.section-title{ font-size:15.5px; font-weight:800; margin-bottom:12px; }
.review-item{ background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:14px; margin-bottom:10px; }
.review-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.review-user{ font-size:13.5px; font-weight:700; }
.review-stars{ display:flex; gap:2px; color:#F4B740; }
.review-body{ font-size:13.5px; color:var(--ink); line-height:1.9; }
.review-date{ font-size:11px; color:var(--ink-soft); margin-top:6px; }
.review-reply{ margin-right:18px; margin-top:8px; padding-right:12px; border-right:2px solid var(--line); }
.review-reply-btn{ font-size:12px; color:var(--brand); font-weight:700; margin-top:8px; display:inline-block; }

/* ===== تیکت ===== */
.ticket-badge{ font-size:11px; font-weight:700; padding:3px 10px; border-radius:var(--radius-pill); }
.ticket-open{ background:var(--green-tint); color:var(--green); }
.ticket-closed{ background:var(--red-tint); color:var(--red); }
.chat-wrap{ display:flex; flex-direction:column; gap:10px; padding: 10px 14px; }
.chat-bubble{ max-width:78%; padding:11px 14px; border-radius:16px; font-size:13.5px; line-height:1.8; }
.chat-user{ align-self:flex-start; background:#fff; border:1.5px solid var(--line); border-bottom-left-radius:4px; }
.chat-admin{ align-self:flex-end; background:var(--brand); color:#fff; border-bottom-right-radius:4px; }
.chat-time{ font-size:10px; color:var(--ink-soft); margin-top:4px; }

/* ===== نصب روی صفحه اصلی ===== */
.install-sheet-icon{ width:56px; height:56px; border-radius:16px; margin:0 auto 12px; }


/* ===== دکمه‌های اپلیکیشنی (پیل، عریض) ===== */
.btn{
  display:flex; align-items:center; justify-content:center;
  width:100%;
  padding:16px 20px;
  border-radius: var(--radius-pill);
  font-size:16px;
  font-weight:700;
  border:2px solid transparent;
  cursor:pointer;
  transition: transform .1s ease, opacity .1s ease;
  user-select:none;
}
.btn:active{ transform: scale(0.97); opacity:.9; }
.btn-primary{ background:var(--brand); color:#fff; }
.btn-outline{ background:#fff; color:var(--brand); border-color:var(--brand); }
.btn-disabled{ background:#E7DFD1; color:#A99F8F; pointer-events:none; }
.btn-sm{ padding:12px 16px; font-size:14px; }

/* ===== هدر داخلی صفحات (دکمه بازگشت) ===== */
.topbar{
  display:flex; align-items:center; gap:10px;
  padding: 16px 14px 6px;
  position:sticky; top:0; z-index:20;
  background:var(--bg);
  flex-shrink:0;
}
.back-btn{
  width:38px; height:38px; border-radius:50%;
  background:transparent; display:flex; align-items:center; justify-content:center;
  color:var(--ink);
  flex-shrink:0;
}
.back-btn:active{ background:rgba(0,0,0,0.06); }
.topbar-title{ font-size:17px; font-weight:700; }

/* ===== صفحه ورود/ثبت‌نام ===== */
.auth-wrap{
  min-height:100vh;
  display:flex; flex-direction:column; justify-content:center;
  padding: 32px 14px;
}
.auth-logo{
  width:88px; height:88px; border-radius:24px;
  background:var(--brand);
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto 22px;
  box-shadow: var(--shadow);
}
.auth-logo img{ width:52px; height:52px; object-fit:contain; }
.auth-title{ text-align:center; font-size:22px; font-weight:800; margin-bottom:6px; }
.auth-sub{ text-align:center; color:var(--ink-soft); font-size:14px; margin-bottom:30px; }

.field{
  background:#fff; border:1.5px solid var(--line); border-radius:16px;
  padding:14px 16px; margin-bottom:12px;
}
.field label{ display:block; font-size:12px; color:var(--ink-soft); margin-bottom:4px; }
.field input{
  width:100%; border:none; outline:none; background:transparent;
  font-size:16px; color:var(--ink);
}

.auth-tabs{ display:flex; gap:10px; margin: 8px 0 26px; }
.tab-btn{
  flex:1; text-align:center; padding:14px 0; border-radius:var(--radius-pill);
  font-weight:700; font-size:15px; background:#fff; color:var(--ink-soft);
  border:2px solid var(--line);
}
.tab-btn.active{ background:var(--brand); color:#fff; border-color:var(--brand); }

.form-stack{ display:flex; flex-direction:column; gap:0; }
.stack-gap{ height:14px; }

.error-box{
  background:var(--red-tint); color:var(--red); border-radius:14px;
  padding:12px 14px; font-size:13px; margin-bottom:14px; text-align:center;
}
.success-box{
  background:var(--green-tint); color:var(--green); border-radius:14px;
  padding:12px 14px; font-size:13px; margin-bottom:14px; text-align:center;
}

/* ===== داشبورد ===== */
.home-header{ padding: 18px 14px 4px; display:flex; align-items:center; justify-content:space-between; }
.hello{ font-size:15px; color:var(--ink-soft); }
.hello b{ color:var(--ink); }
.avatar{
  width:42px; height:42px; border-radius:50%;
  background:var(--brand-tint); color:var(--brand);
  display:flex; align-items:center; justify-content:center; font-weight:800;
}

.balance-card{
  margin: 12px 14px 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color:#fff;
  position:relative;
  overflow:hidden;
}
.balance-card::after{
  content:''; position:absolute; inset:0;
  background: radial-gradient(120px 120px at 90% -10%, rgba(255,255,255,0.18), transparent);
}
.balance-label{ font-size:13px; opacity:.85; margin-bottom:6px; }
.balance-amount{ font-size:28px; font-weight:800; letter-spacing:.5px; transition: transform .14s ease; }
.balance-amount.balance-flip{ transform: scaleY(0.05); }
.balance-amount.hidden-balance{ letter-spacing:3px; }

.grid{
  display:grid; grid-template-columns: repeat(3,1fr); gap:10px;
  padding: 0 14px;
}
.grid-item{
  background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:16px 8px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.grid-item:active{ background:var(--bg-soft); }
.grid-icon{
  width:34px; height:34px; color:var(--brand);
  display:flex; align-items:center; justify-content:center;
}
.grid-label{ font-size:12.5px; font-weight:600; text-align:center; line-height:1.4; }

.empty-note{
  margin: 18px 14px 0; text-align:center; color:var(--ink-soft);
  font-size:13px; background:#fff; border-radius:18px; padding:16px;
  border:1.5px dashed var(--line);
}

/* ===== صفحه ساده / بزودی ===== */
.center-page{
  min-height: 70vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center; padding: 0 30px;
}
.center-icon{
  width:72px; height:72px; color:var(--brand);
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
}
.center-title{ font-size:18px; font-weight:800; margin-bottom:8px; }
.center-sub{ font-size:14px; color:var(--ink-soft); }

/* ===== گزارشات ===== */
.list{ padding: 6px 14px; display:flex; flex-direction:column; gap:8px; }
.list-row{
  background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:13px 14px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.list-row-right{ display:flex; align-items:center; gap:12px; }
.list-dot{
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.dot-green{ color:var(--green); }
.dot-red{ color:var(--red); }
.list-title{ font-size:14px; font-weight:700; }
.list-date{ font-size:11.5px; color:var(--ink-soft); margin-top:2px; }
.list-amount{ font-size:14px; font-weight:800; }
.amount-green{ color:var(--green); }
.amount-red{ color:var(--red); }
.pill-status{
  font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:var(--radius-pill);
  margin-top:4px; display:inline-block;
}

/* ===== شارژ کیف پول ===== */
.topup-body{ padding: 4px 14px 20px; }
.copy-row{
  background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:15px; margin-bottom:10px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.copy-row .lbl{ font-size:12px; color:var(--ink-soft); margin-bottom:4px; }
.copy-row .val{ font-size:15px; font-weight:700; direction:ltr; text-align:right; unicode-bidi:plaintext; }
.copy-icon{
  width:28px; height:28px; color:var(--brand);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.toast{
  position:fixed; bottom:110px; left:50%; transform:translateX(-50%);
  background:#262220; color:#fff; padding:10px 18px; border-radius:var(--radius-pill);
  font-size:13px; opacity:0; pointer-events:none; transition:opacity .2s ease, bottom .2s ease;
  z-index:999; white-space:nowrap;
}
.toast.show{ opacity:1; bottom:130px; }

.upload-box{
  border:2px dashed var(--line); border-radius:20px; background:#fff;
  min-height:150px; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; cursor:pointer; overflow:hidden; position:relative; margin-bottom:16px;
}
.upload-box img{ width:100%; height:100%; object-fit:cover; filter:grayscale(100%); opacity:.55; transition:filter .2s, opacity .2s; }
.upload-box.filled img{ filter:grayscale(0%); opacity:1; }
.upload-box .up-icon{ color:var(--brand); }
.upload-box .up-text{ font-size:13px; color:var(--ink-soft); }

/* ===== هدیه / معرفی ===== */
.gift-icon-big{
  width:76px; height:76px; margin: 26px auto 16px;
  color: var(--brand);
  display:flex; align-items:center; justify-content:center;
}
.gift-title{ text-align:center; font-size:19px; font-weight:800; margin-bottom:6px; }
.gift-sub{ text-align:center; color:var(--ink-soft); font-size:13.5px; padding:0 30px; }
.spacer-grow{ flex:1; }

.invite-count{
  text-align:center; margin-top:24px;
}
.invite-count .num{ font-size:34px; font-weight:800; color:var(--brand); }
.invite-count .lbl{ font-size:13px; color:var(--ink-soft); margin-top:4px; }

/* ===== کانفیگ ===== */
.config-icon-big{
  width:70px; height:70px; margin: 22px auto 14px;
  color: var(--brand);
  display:flex; align-items:center; justify-content:center;
}
.config-box{
  background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:16px; margin: 0 14px 10px;
}
.config-box .lbl{ font-size:12px; color:var(--ink-soft); margin-bottom:8px; }
.config-box .code{
  font-family: monospace; font-size:12.5px; word-break: break-all; direction:ltr; text-align:left;
  background:var(--bg-soft); border-radius:12px; padding:10px; line-height:1.6;
}

.fixed-bottom{
  position:sticky; bottom:0; margin-top:auto; flex-shrink:0;
  padding: 12px 14px calc(20px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(244,237,227,0), var(--bg) 30%);
}

.page-pad{ padding: 4px 14px 10px; }
.mt-6{ margin-top:6px; } .mt-10{ margin-top:10px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; }

/* ===== پنل مدیریت ===== */
.admin-body{ max-width: 900px; margin:0 auto; padding: 24px 18px 60px; }
.admin-topbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:22px; flex-wrap:wrap; gap:10px;
}
.admin-brand{ font-size:18px; font-weight:800; display:flex; align-items:center; gap:10px; }
.admin-nav{ display:flex; gap:8px; flex-wrap:wrap; }
.admin-nav a{
  padding:9px 16px; border-radius:var(--radius-pill); background:#fff; font-size:13.5px; font-weight:600;
  border:1.5px solid var(--line); color:var(--ink);
}
.admin-nav a.active{ background:var(--brand); color:#fff; border-color:var(--brand); }
.admin-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:26px; }
.admin-card{ background:#fff; border-radius:18px; padding:18px; box-shadow:0 4px 14px rgba(38,34,32,0.05); }
.admin-card .num{ font-size:24px; font-weight:800; color:var(--brand); }
.admin-card .lbl{ font-size:12.5px; color:var(--ink-soft); margin-top:4px; }
.admin-table{ width:100%; border-collapse:collapse; background:#fff; border-radius:16px; overflow:hidden; box-shadow:0 4px 14px rgba(38,34,32,0.05); }
.admin-table th, .admin-table td{ padding:12px 14px; text-align:right; font-size:13.5px; border-bottom:1px solid var(--line); }
.admin-table th{ background:var(--bg-soft); font-weight:700; color:var(--ink-soft); font-size:12.5px; }
.admin-table tr:last-child td{ border-bottom:none; }
.badge{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:var(--radius-pill); display:inline-block; }
.badge-pending{ background:#FBF3DC; color:#B8860B; }
.badge-approved{ background:var(--green-tint); color:var(--green); }
.badge-rejected{ background:var(--red-tint); color:var(--red); }
.admin-btn{ display:inline-block; padding:7px 14px; border-radius:var(--radius-pill); font-size:12.5px; font-weight:700; border:none; cursor:pointer; }
.admin-btn-approve{ background:var(--green); color:#fff; }
.admin-btn-reject{ background:var(--red); color:#fff; }
.receipt-thumb{ width:60px; height:60px; border-radius:10px; object-fit:cover; }
.admin-login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.admin-login-card{ background:#fff; border-radius:24px; padding:34px 26px; width:100%; max-width:360px; box-shadow:var(--shadow); }
