/* =====================================================================
   نوبتمه — سیستم طراحی (برگرفته از طراحی اصلی محصول)
   راست‌به‌چپ، فونت وزیرمتن، رنگ اصلی سبز #00BE70
   ===================================================================== */

@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }

:root {
  --bg: #F3F5F8; --card: #FFFFFF; --text: #2A2C32; --text2: #4F5055; --muted: #676A72;
  --border: #D8D6D9; --border2: #CBC9CD; --line: #E9E8EB; --hover: #F5F6F8; --track: #EFF1F4;
  --green: #00BE70; --green-d: #017A45; --green-btn: #05834D; --green-btn-press: #016B3E; --green-soft: #EAF7F1;
  --blue: #2358CE; --orange: #985600; --red: #C10039; --violet: #6A2BC2; --focus: #1A56DB;
  --chip-green-bg: rgba(0,190,112,.12); --chip-green-fg: #0A6B41;
  --chip-orange-bg: rgba(255,141,0,.16); --chip-orange-fg: #985600;
  --chip-red-bg: rgba(236,1,69,.10); --chip-red-fg: #C10039;
  --chip-blue-bg: rgba(48,113,255,.11); --chip-blue-fg: #2358CE;
  --chip-gray-bg: rgba(120,124,132,.14); --chip-gray-fg: #5E616A;
  --chip-violet-bg: rgba(119,48,215,.11); --chip-violet-fg: #6A2BC2;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(20,28,40,.04), 0 10px 30px rgba(20,28,40,.06);
  --shadow-sm: 0 1px 3px rgba(20,28,40,.06);
  --sidebar-w: 268px;
}

/* ---------- پایه ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif; font-size: 15px; line-height: 1.9; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--green-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; color: var(--text); }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16.5px; font-weight: 800; }
p { margin: 0; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ico { flex-shrink: 0; vertical-align: middle; }
.skip { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 100; background: var(--green-btn); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }       /* ویژگی hidden بر کلاس‌های display غلبه کند */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ابزارها ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.ell { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 20px; } .mt-sm { margin-top: 10px; } .mb { margin-bottom: 20px; } .mb-sm { margin-bottom: 10px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.only-mobile { display: none !important; }

/* ---------- پوستهٔ سایت ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-row { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(150deg, #00BE70, #016B3E); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(0,190,112,.28); flex-shrink: 0; }
.brand-name { display: block; font-size: 21px; font-weight: 900; line-height: 1.1; color: var(--green-d); }
.brand-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text2); font-weight: 600; text-decoration: none; }
.site-nav a:hover { background: var(--hover); }
.site-nav a.on { background: var(--green-soft); color: var(--green-d); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.site-main { padding: 28px 0 56px; min-height: calc(100vh - 140px); }
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 18px 0; font-size: 13px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* منوی کاربر (بدون جاوااسکریپت با details) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px; border: 1px solid var(--border2); border-radius: var(--radius-pill); background: var(--card); font-weight: 700; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 8px; z-index: 40; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }
.menu-pop a, .menu-logout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text2); font-weight: 600; text-decoration: none; background: none; border: none; cursor: pointer; text-align: start; }
.menu-pop a:hover, .menu-logout:hover { background: var(--hover); }
.menu-logout { color: var(--red); }
.logout-form { margin: 0; }

/* ---------- پوستهٔ پنل ---------- */
.panel { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--card); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 20px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text2); font-weight: 600; text-decoration: none !important; position: relative; }
.side-item:hover { background: var(--hover); }
.side-item.on { background: var(--green-soft); color: var(--green-d); font-weight: 800; }
.side-item.on::before { content: ''; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--green); }
.side-item .count { margin-inline-start: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.side-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.side-user small { display: block; color: var(--muted); font-size: 12px; }
.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 76px; display: flex; align-items: center; gap: 16px; padding: 12px 28px; }
.page-title { font-size: 21px; font-weight: 800; }
.page-sub { font-size: 13px; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-content { padding: 26px 28px 56px; }

/* ---------- دکمه‌ها ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green-btn); color: #fff; }
.btn.primary:hover { background: var(--green-btn-press); }
.btn.secondary { background: var(--card); color: var(--text2); border-color: var(--border2); }
.btn.secondary:hover { background: var(--hover); }
.btn.ghost { background: transparent; color: var(--green-d); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.soft { background: var(--chip-green-bg); color: var(--green-d); }
.btn.danger { background: var(--card); color: var(--red); border-color: var(--border2); }
.btn.danger:hover { background: var(--chip-red-bg); }
.btn.danger-solid { background: var(--red); color: #fff; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn.lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--text2); cursor: pointer; position: relative; flex-shrink: 0; text-decoration: none !important; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn .dot { position: absolute; top: -6px; inset-inline-start: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }
.link-btn { background: none; border: none; padding: 0; color: var(--green-d); font-weight: 700; cursor: pointer; }
.link-btn.danger { color: var(--red); }
.inline-form { display: inline; margin: 0; }

/* ---------- فرم‌ها ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.field .req { color: var(--red); }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1.5px solid var(--border2); border-radius: var(--radius-sm); background: var(--card); padding: 0 14px; font-size: 15px; font-weight: 500; transition: border-color .15s; }
.textarea { padding: 10px 14px; min-height: 96px; resize: vertical; line-height: 1.9; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23676A72' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-inline-end: 14px; padding-inline-start: 40px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px rgba(0,190,112,.12); }
/* حلقهٔ فوکوس صفحه‌کلید مانند بقیهٔ کنترل‌ها (حاشیهٔ سبز به‌تنهایی کنتراست کافی ندارد) */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input.err, .select.err, .textarea.err { border-color: var(--red); }
.input[readonly] { background: var(--hover); color: var(--muted); }
.input.ltr { text-align: left; }
.hint { font-size: 12.5px; color: var(--muted); }
.field-err { font-size: 12.5px; color: var(--red); font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 50px; }
.input-wrap .pw-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: none; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green-btn); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 13px; background: var(--border2); position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
.switch input:checked + .track { background: var(--green-btn); }
.switch input:checked + .track::after { inset-inline-start: 23px; }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }

/* انتخاب‌گرهای دکمه‌ای (رادیو/چک‌باکس با ظاهر کارت) */
.choice-list { display: grid; gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--border2); background: var(--hover); }
.choice input { width: 20px; height: 20px; accent-color: var(--green-btn); flex-shrink: 0; }
.choice:has(input:checked) { border-color: var(--green-btn); background: var(--green-soft); }
.choice .meta { margin-inline-start: auto; text-align: left; font-size: 13px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1.5px solid var(--border2); background: var(--card); color: var(--text2); font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none !important; }
.chip:has(input:checked), .chip.on { border-color: var(--green-btn); background: var(--chip-green-bg); color: var(--green-d); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- کارت‌ها ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-p { padding: 22px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-hd h2, .card-hd h3 { font-size: 16.5px; }
.card-hd .sub { font-size: 12.5px; color: var(--muted); }
.card-bd { padding: 20px 22px; }
.card-ft { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
/* فرزندان شبکه از محتوای عریض (جدول، نوار روزها) بزرگ‌تر نشوند */
.grid-2 > *, .grid-3 > *, .grid-4 > *, .layout-side > *, .form-grid > * { min-width: 0; }
.sticky { position: sticky; top: 96px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 19px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list.card-bd { padding: 4px 22px; }          /* .list بعد از .card-bd آمده و فاصلهٔ داخلی کارت را صفر می‌کرد */
.list > li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: none; }

/* ---------- برچسب، آواتار، امتیاز ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 7px; white-space: nowrap; line-height: 1.8; }
.badge.green { background: var(--chip-green-bg); color: var(--chip-green-fg); }
.badge.orange { background: var(--chip-orange-bg); color: var(--chip-orange-fg); }
.badge.red { background: var(--chip-red-bg); color: var(--chip-red-fg); }
.badge.blue { background: var(--chip-blue-bg); color: var(--chip-blue-fg); }
.badge.gray { background: var(--chip-gray-bg); color: var(--chip-gray-fg); }
.badge.violet { background: var(--chip-violet-bg); color: var(--chip-violet-fg); }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(150deg, #02864F, #015C37); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.avatar.sm { width: 30px; height: 30px; border-radius: 50%; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.avatar.violet { background: linear-gradient(150deg, #8B4BE0, #5B21B6); }
.avatar.blue { background: linear-gradient(150deg, #3071FF, #1E4FCC); }
.avatar.orange { background: linear-gradient(150deg, #FF9F2E, #D46F00); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; }
.rating .ico { color: #F5A400; fill: #F5A400; }
.rating.muted .ico { fill: none; color: var(--muted); }

/* ---------- پیام‌ها ---------- */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--radius-md); font-weight: 600; margin-bottom: 18px; border: 1px solid transparent; }
.flash.success { background: var(--chip-green-bg); color: var(--chip-green-fg); border-color: rgba(0,190,112,.25); }
.flash.error { background: var(--chip-red-bg); color: var(--chip-red-fg); border-color: rgba(236,1,69,.22); }
.flash.warning { background: var(--chip-orange-bg); color: var(--chip-orange-fg); border-color: rgba(255,141,0,.3); }
.flash.info { background: var(--chip-blue-bg); color: var(--chip-blue-fg); border-color: rgba(48,113,255,.22); }
.flash span { flex: 1; }
.flash-x { background: none; border: none; color: inherit; cursor: pointer; opacity: .7; padding: 2px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--chip-blue-bg); color: var(--chip-blue-fg); border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.note.warn { background: var(--chip-orange-bg); color: var(--chip-orange-fg); }
.note.ok { background: var(--chip-green-bg); color: var(--chip-green-fg); }
.code-box { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 28px; font-weight: 800; letter-spacing: 6px; text-align: center; padding: 14px; background: var(--green-soft); border: 2px dashed var(--green); border-radius: var(--radius-md); color: var(--green-d); }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; position: relative; contain: paint; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--hover); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td .ltr { white-space: nowrap; }       /* موبایل، IP و کد پیگیری وسط عدد شکسته نشوند */
/* نامی با یک کلمهٔ بسیار طولانی و بدون فاصله، ستون را بی‌اندازه پهن نکند و جدول از کادر بیرون نزند:
   پیوندها و نام کاربر حداکثر 14em پهنا دارند و فقط کلمهٔ بلندتر از آن شکسته می‌شود؛ متن عادی مثل قبل
   فقط در فاصله‌ها می‌شکند (overflow-wrap: anywhere همهٔ ستون‌ها را در صفحهٔ باریک حرف‌به‌حرف می‌شکست) */
.table td a:not(.btn):not(.icon-btn) { display: inline-block; max-width: 14em; overflow-wrap: break-word; }
.table .cell-user > div { max-width: 14em; overflow-wrap: break-word; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FAFBFC; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user b { display: block; }
.cell-user small { color: var(--muted); }

/* ---------- زبانه‌ها و فیلترها ---------- */
.tabs { display: inline-flex; background: var(--track); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; padding: 7px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; text-decoration: none !important; }
.tabs .on { background: var(--card); color: var(--green-d); box-shadow: var(--shadow-sm); }
.tabs .n { font-size: 11.5px; background: var(--chip-gray-bg); border-radius: 6px; padding: 0 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.toolbar .search .ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .input { padding-inline-start: 40px; min-height: 44px; }

/* ---------- حالت خالی ---------- */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 10px; }
.state-ico { width: 80px; height: 80px; border-radius: 24px; background: var(--green-soft); color: var(--green-d); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.state p { color: var(--muted); max-width: 420px; }
.state .btn { margin-top: 8px; }

/* ---------- صفحه‌بندی ---------- */
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a { min-width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border2); display: inline-flex; align-items: center; justify-content: center; color: var(--text2); font-weight: 700; text-decoration: none; }
.pager a.on { background: var(--green-btn); border-color: var(--green-btn); color: #fff; }

/* ---------- کارت آماری ---------- */
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico.green { background: var(--chip-green-bg); color: var(--chip-green-fg); }
.stat-ico.blue { background: var(--chip-blue-bg); color: var(--chip-blue-fg); }
.stat-ico.orange { background: var(--chip-orange-bg); color: var(--chip-orange-fg); }
.stat-ico.violet { background: var(--chip-violet-bg); color: var(--chip-violet-fg); }
.stat-ico.red { background: var(--chip-red-bg); color: var(--chip-red-fg); }
.stat-val { font-size: 22px; font-weight: 900; line-height: 1.3; }
.stat-lab { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-hint { font-size: 12px; color: var(--green-d); font-weight: 700; }

/* نمودار میله‌ای ساده */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; min-width: 6px; background: linear-gradient(180deg, #34D399, var(--green-btn)); border-radius: 6px 6px 2px 2px; position: relative; }
.bars .bar:hover { filter: brightness(1.08); }
.bar-labels { display: flex; gap: 6px; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; }
.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* ---------- صفحات ورود و ثبت‌نام ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); background: var(--card); }
.auth-form .brand { margin-bottom: 34px; }
.auth-form h1 { font-size: 26px; font-weight: 900; }
.auth-form .lead { color: var(--muted); margin: 6px 0 26px; }
.auth-box { width: 100%; max-width: 460px; }
.auth-hero { background: radial-gradient(1200px 500px at 110% -10%, rgba(255,255,255,.18), transparent 60%), linear-gradient(155deg, #02A45F, #015C37); color: #fff; padding: 56px clamp(28px, 5vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 26px; position: relative; overflow: hidden; }
.auth-hero h2 { color: #fff; font-size: 30px; font-weight: 900; line-height: 1.6; }
.auth-hero p { opacity: .9; font-size: 15.5px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-hero li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-hero li .ico { background: rgba(255,255,255,.18); border-radius: 10px; padding: 7px; width: 36px; height: 36px; }
.auth-hero .hero-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.auth-hero .hero-stats div { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 14px; padding: 12px 18px; }
.auth-hero .hero-stats b { display: block; font-size: 22px; font-weight: 900; }
.auth-hero .hero-stats span { font-size: 12.5px; opacity: .85; }
.auth-switch { margin-top: 22px; color: var(--muted); }
.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.role-tab { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); cursor: pointer; font-weight: 700; color: var(--text2); text-decoration: none !important; }
.role-tab small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.role-tab.on { border-color: var(--green-btn); background: var(--green-soft); color: var(--green-d); }
.demo-box { margin-top: 26px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--hover); border: 1px dashed var(--border2); font-size: 13px; }
.demo-box b { color: var(--text); }
.demo-box .ltr { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- صفحهٔ اصلی و سالن‌ها ---------- */
.hero { border-radius: 24px; padding: 40px clamp(22px, 4vw, 48px); background: radial-gradient(900px 400px at 0% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(150deg, #02A45F, #016B3E); color: #fff; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 30px; }
.hero h1 { color: #fff; font-size: clamp(24px, 3vw, 34px); font-weight: 900; line-height: 1.6; }
.hero p { opacity: .92; margin-top: 8px; }
.hero-search { background: var(--card); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 40px rgba(0,40,20,.25); color: var(--text); }
.salon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.salon-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.salon-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.salon-cover { height: 130px; background: linear-gradient(150deg, #02A45F, #016B3E); position: relative; display: flex; align-items: flex-end; padding: 14px; }
.salon-cover.c1 { background: linear-gradient(150deg, #8B4BE0, #5B21B6); }
.salon-cover.c2 { background: linear-gradient(150deg, #3071FF, #1E4FCC); }
.salon-cover.c3 { background: linear-gradient(150deg, #FF9F2E, #D46F00); }
.salon-cover.c4 { background: linear-gradient(150deg, #EC4899, #BE185D); }
.salon-cover.c5 { background: linear-gradient(150deg, #0EA5E9, #0369A1); }
.salon-cover .initial { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 24px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.salon-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.salon-card h3 { font-size: 16.5px; }
.salon-card .meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.salon-card .foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.salon-head { border-radius: 22px; overflow: hidden; margin-bottom: 24px; }
.salon-head .cover { height: 220px; background-size: cover; background-position: center; position: relative; }
.salon-head .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 60%); }
.salon-head .info { background: var(--card); padding: 20px 24px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-top: none; border-radius: 0 0 22px 22px; }
.service-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: none; }
.service-row .price { font-weight: 800; white-space: nowrap; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours-table td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.hours-table tr.today td { color: var(--green-d); font-weight: 800; }
.hours-table td:last-child { text-align: left; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: none; }

/* ---------- رزرو: روزها و ساعت‌ها ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.steps b { width: 26px; height: 26px; border-radius: 50%; background: var(--track); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; }
.steps .on { color: var(--green-d); }
.steps .on b { background: var(--green-btn); color: #fff; }
.week { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.day { flex-shrink: 0; width: 70px; min-height: 78px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none !important; position: relative; }
.day .wd { font-size: 12px; font-weight: 600; color: var(--muted); }
.day .dn { font-size: 20px; font-weight: 800; line-height: 1.2; }
.day .mn { font-size: 11px; color: var(--muted); }
.day:hover { border-color: var(--border2); }
.day.on, .day:has(input:checked) { background: var(--green-btn); border-color: var(--green-btn); color: #fff; }
.day.on .wd, .day.on .mn, .day:has(input:checked) .wd, .day:has(input:checked) .mn { color: rgba(255,255,255,.85); }
.day.closed { opacity: .5; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day .count-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--chip-green-bg); color: var(--chip-green-fg); font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.day.on .count-dot { background: rgba(255,255,255,.25); color: #fff; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { position: relative; height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--border2); background: var(--card); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot:has(input:checked) { border-color: var(--green-btn); background: var(--chip-green-bg); color: var(--green-d); }
.slot.taken { background: var(--hover); color: var(--muted); border-color: var(--line); cursor: not-allowed; text-decoration: line-through; font-weight: 600; }
.slot:has(input:focus-visible), .day:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary-row:last-child { border-bottom: none; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; font-weight: 800; font-size: 17px; }
.ticket-ref { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 1px; }
.success-ico { width: 84px; height: 84px; border-radius: 50%; background: var(--chip-green-bg); color: var(--green-d); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }

/* ---------- تقویم و فهرست نوبت‌ها ---------- */
.appt { display: flex; gap: 16px; align-items: stretch; padding: 16px 18px; border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: var(--radius-md); background: var(--card); color: var(--text); text-decoration: none !important; transition: box-shadow .15s; }
.appt:hover { box-shadow: var(--shadow); }
.appt.completed { border-inline-start-color: #9CA3AF; }
.appt.no_show { border-inline-start-color: var(--orange); }
.appt.pending { border-inline-start-color: var(--orange); border-style: dashed; border-inline-start-style: solid; }
.appt.cancelled { border-inline-start-color: var(--red); opacity: .75; }
.appt .time { min-width: 76px; text-align: center; display: flex; flex-direction: column; justify-content: center; border-inline-end: 1px solid var(--line); padding-inline-end: 14px; }
.appt .time b { font-size: 18px; font-weight: 900; }
.appt .time small { color: var(--muted); font-size: 12px; }
.appt .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.appt .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.appt-list { display: flex; flex-direction: column; gap: 12px; }

/* ---------- پیام‌ها (تیکت) ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); }
.msg.me { align-self: flex-start; background: var(--green-soft); border-color: rgba(0,190,112,.25); }
.msg.them { align-self: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; display: flex; gap: 8px; }
.msg p { white-space: pre-line; }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 1080px) {
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex !important; }
  /* منوی بسته با visibility پنهان می‌شود تا پیوندهایش در ترتیب Tab و صفحه‌خوان نباشند؛
     پنهان شدن پس از پایان حرکت (۰٫۲ ثانیه) اعمال می‌شود */
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; transform: translateX(110%); visibility: hidden; transition: transform .2s, visibility 0s linear .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; visibility: visible; transition: transform .2s; }
  .sidebar.open + .panel-main::before { content: ''; position: fixed; inset: 0; z-index: 55; background: rgba(20,28,40,.38); }
  .topbar { padding: 12px 18px; }
  .panel-content { padding: 20px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .hero { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  /* برچسب پیوندها فقط از دید پنهان می‌شود و نام دسترس‌پذیر پیوند باقی می‌ماند */
  .site-nav a span, .hide-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-nav a { min-width: 44px; min-height: 44px; justify-content: center; }
  .header-row { gap: 10px; }
  .brand-sub { display: none; }
  .form-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  /* نوار بالای پنل با دکمه‌های چندردیفه بلند می‌شود؛ ثابت ماندنش بخش بزرگی از صفحه را می‌پوشاند */
  .topbar { flex-wrap: wrap; position: static; background: var(--card); backdrop-filter: none; }
  .topbar-actions { flex-basis: 100%; }
  /* اهداف لمسی حداقل ۴۴ پیکسل */
  .btn.sm { min-height: 44px; }
  .icon-btn.sm { width: 44px; height: 44px; }
  .tabs a, .tabs button, .chip { min-height: 44px; }
  .pager a { min-width: 44px; height: 44px; }
  .input-wrap .pw-toggle { width: 44px; height: 44px; }
  /* زبانه‌ها در یک ردیف می‌مانند و در صورت نیاز افقی پیمایش می‌شوند */
  .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
  .tabs a, .tabs button { white-space: nowrap; flex-shrink: 0; }
  .appt { flex-direction: column; }
  .appt .time { flex-direction: row; gap: 8px; border: none; padding: 0; justify-content: flex-start; text-align: start; }
  .appt .side { flex-direction: row; align-items: center; }
  .msg { max-width: 92%; }
}
@media (max-width: 440px) {
  .container { padding: 0 14px; }
  .header-row { gap: 6px; }
  .header-row > * { min-width: 0; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 9px; }
  /* فقط در نوار بالای سایت جا تنگ است؛ نام برند پنهان می‌شود ولی نشان آن (پیوند صفحهٔ اصلی) می‌ماند */
  .site-header .brand > span:not(.brand-mark) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-header .brand { flex-shrink: 0; }
  .user-chip { padding: 0 6px; gap: 4px; }
  .user-chip > .ico { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
