/* ===========================================================================
   نِی‌باکس — پوستهٔ «استودیو»
   گالری‌وار و آرام: سفیدهای گرم، قاب‌های نازک، فاصله‌گذاری سخاوتمندانه.
   + پالت‌های رنگی و حالت تیره/روشن (نسخهٔ ۱٫۱٫۰)
   =========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ── پایه: گرم / روشن (پیش‌فرض) ──────────────────────────────────────────── */
:root,
[data-theme="warm"][data-mode="light"],
[data-theme="warm"][data-mode="auto"] {
  --bg:          #F8FAFC;
  --bg-tint:     #F1F5F9;
  --surface:     #FFFFFF;
  --surface-2:   #F1F5F9;
  --ink:         #0F172A;
  --ink-2:       #334155;
  --muted:       #64748B;
  --muted-2:     #94A3B8;
  --line:        #E2E8F0;
  --line-2:      #CBD5E1;
  --accent:      #2563EB;
  --accent-ink:  #1D4ED8;
  --accent-soft: #EFF6FF;
  --ok:          #10B981;
  --ok-soft:     #ECFDF5;
  --warn:        #F59E0B;
  --warn-soft:   #FFFBEB;
  --danger:      #EF4444;
  --danger-soft: #FEF2F2;
  --attention:      #F59E0B;
  --attention-ink:  #B45309;
  --attention-soft: #FEF3C7;
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --shadow-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:      0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md:   0 6px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg:   0 14px 34px -6px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --topbar-bg:   rgba(255, 255, 255, 0.88);
  --font:        'Vazirmatn', 'IRANSansX', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:        'SFMono-Regular', 'Menlo', 'Consolas', monospace;
}

/* ── پالت: مریم‌گلی (Sage) ─────────────────────────────────────────────── */
[data-theme="sage"][data-mode="light"],
[data-theme="sage"][data-mode="auto"] {
  --bg:          #F2F3F0;
  --bg-tint:     #E8ECE7;
  --surface:     #FEFDFB;
  --surface-2:   #EEF1EB;
  --ink:         #1E201B;
  --ink-2:       #3D443A;
  --muted:       #6E7870;
  --muted-2:     #8E9891;
  --line:        #D9DDD7;
  --line-2:      #C5CBC3;
  --accent:      #6B806B;
  --accent-ink:  #4C614B;
  --accent-soft: #EBF0E9;
  --topbar-bg:   rgba(242, 243, 240, .92);
}

/* ── پالت: اسلیت (Slate) ────────────────────────────────────────────────── */
[data-theme="slate"][data-mode="light"],
[data-theme="slate"][data-mode="auto"] {
  --bg:          #F2F3F5;
  --bg-tint:     #E6E8EC;
  --surface:     #FEFEFF;
  --surface-2:   #EDEEF1;
  --ink:         #1A1E24;
  --ink-2:       #3A434F;
  --muted:       #6B7683;
  --muted-2:     #8C96A2;
  --line:        #D8DDE2;
  --line-2:      #C1C8D1;
  --accent:      #657389;
  --accent-ink:  #4B5669;
  --accent-soft: #EAEFF5;
  --topbar-bg:   rgba(242, 243, 245, .92);
}

/* ── پالت: سفالی (Terracotta) ───────────────────────────────────────────── */
[data-theme="terracotta"][data-mode="light"],
[data-theme="terracotta"][data-mode="auto"] {
  --bg:          #F9F4F0;
  --bg-tint:     #F1E8DE;
  --surface:     #FFFDFA;
  --surface-2:   #F5EDE5;
  --ink:         #221A14;
  --ink-2:       #4A3D33;
  --muted:       #7A6E62;
  --muted-2:     #9A8B7E;
  --line:        #E7DDD2;
  --line-2:      #D6C7B7;
  --accent:      #A66B4A;
  --accent-ink:  #7E4E34;
  --accent-soft: #F9E8DA;
  --topbar-bg:   rgba(249, 244, 240, .92);
}

/* ── حالت تیره: گرم ─────────────────────────────────────────────────────── */
[data-theme="warm"][data-mode="dark"] {
  --bg:          #181610;
  --bg-tint:     #23201C;
  --surface:     #25231F;
  --surface-2:   #2E2C27;
  --ink:         #F1EDE6;
  --ink-2:       #D4CFC5;
  --muted:       #9A9184;
  --muted-2:     #7D7568;
  --line:        #2F2C27;
  --line-2:      #3E3B35;
  --accent:      #C9A27B;
  --accent-ink:  #E6C5A0;
  --accent-soft: #2E2417;
  --ok:          #7FA67F;
  --ok-soft:     #213021;
  --warn:        #D1B16A;
  --warn-soft:   #2E2612;
  --danger:      #E07A6A;
  --danger-soft: #2E1B18;
  --shadow:      0 1px 8px rgba(0, 0, 0, .35);
  --topbar-bg:   rgba(24, 22, 16, .88);
}

/* ── حالت تیره: مریم‌گلی ────────────────────────────────────────────────── */
[data-theme="sage"][data-mode="dark"] {
  --bg:          #171A17;
  --bg-tint:     #1F2420;
  --surface:     #232825;
  --surface-2:   #2C322E;
  --ink:         #EAF0E9;
  --ink-2:       #C9D1C6;
  --muted:       #9AA69B;
  --muted-2:     #7A857C;
  --line:        #2D332E;
  --line-2:      #3D4440;
  --accent:      #9AB79A;
  --accent-ink:  #C4DCC3;
  --accent-soft: #1E2A1E;
  --topbar-bg:   rgba(23, 26, 23, .88);
}

/* ── حالت تیره: اسلیت ───────────────────────────────────────────────────── */
[data-theme="slate"][data-mode="dark"] {
  --bg:          #15181D;
  --bg-tint:     #1E232A;
  --surface:     #22272F;
  --surface-2:   #2B323C;
  --ink:         #EAF0F6;
  --ink-2:       #C9D0DA;
  --muted:       #8C96A3;
  --muted-2:     #6B7683;
  --line:        #2A323C;
  --line-2:      #3A4450;
  --accent:      #8FA0BD;
  --accent-ink:  #B9CCEA;
  --accent-soft: #1E252F;
  --topbar-bg:   rgba(21, 24, 29, .88);
}

/* ── حالت تیره: سفالی ───────────────────────────────────────────────────── */
[data-theme="terracotta"][data-mode="dark"] {
  --bg:          #1C1511;
  --bg-tint:     #261E16;
  --surface:     #2A211C;
  --surface-2:   #332A22;
  --ink:         #F6EEE6;
  --ink-2:       #D9CDC0;
  --muted:       #9A8B7E;
  --muted-2:     #7D6F61;
  --line:        #332A22;
  --line-2:      #46392C;
  --accent:      #D49A74;
  --accent-ink:  #EAC0A3;
  --accent-soft: #2E2116;
  --topbar-bg:   rgba(28, 21, 17, .88);
}

/* ── خودکار: تبعیت از سیستم (prefers-color-scheme) ──────────────────────── */
@media (prefers-color-scheme: dark) {
  [data-mode="auto"][data-theme="warm"] {
    --bg: #181610; --bg-tint: #23201C; --surface: #25231F; --surface-2: #2E2C27;
    --ink: #F1EDE6; --ink-2: #D4CFC5; --muted: #9A9184; --muted-2: #7D7568;
    --line: #2F2C27; --line-2: #3E3B35; --accent: #C9A27B; --accent-ink: #E6C5A0; --accent-soft: #2E2417;
    --topbar-bg: rgba(24, 22, 16, .88); --shadow: 0 1px 8px rgba(0, 0, 0, .35);
  }
  [data-mode="auto"][data-theme="sage"] {
    --bg: #171A17; --bg-tint: #1F2420; --surface: #232825; --surface-2: #2C322E;
    --ink: #EAF0E9; --ink-2: #C9D1C6; --muted: #9AA69B; --line: #2D332E; --line-2: #3D4440;
    --accent: #9AB79A; --accent-ink: #C4DCC3; --accent-soft: #1E2A1E; --topbar-bg: rgba(23, 26, 23, .88);
  }
  [data-mode="auto"][data-theme="slate"] {
    --bg: #15181D; --bg-tint: #1E232A; --surface: #22272F; --surface-2: #2B323C;
    --ink: #EAF0F6; --ink-2: #C9D0DA; --muted: #8C96A3; --line: #2A323C; --line-2: #3A4450;
    --accent: #8FA0BD; --accent-ink: #B9CCEA; --accent-soft: #1E252F; --topbar-bg: rgba(21, 24, 29, .88);
  }
  [data-mode="auto"][data-theme="terracotta"] {
    --bg: #1C1511; --bg-tint: #261E16; --surface: #2A211C; --surface-2: #332A22;
    --ink: #F6EEE6; --ink-2: #D9CDC0; --muted: #9A8B7E; --line: #332A22; --line-2: #46392C;
    --accent: #D49A74; --accent-ink: #EAC0A3; --accent-soft: #2E2116; --topbar-bg: rgba(28, 21, 17, .88);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.9;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.5; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }

p { margin: 0; }

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hide-sm { display: inline; }

.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 30px; height: 30px; }

/* ---------------------------------------------------------------- چیدمان -- */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  flex: 1;
}

/* --------------------------------------------------------------- سربرگ --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-ink);
}

.brand-mark-lg { width: 56px; height: 56px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 15px; font-weight: 600; }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-link:hover { background: var(--surface-2); color: var(--ink); }

.nav-link.is-active {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.userbox { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.userbox-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.userbox-link:hover { border-color: var(--line-2); background: var(--surface); }
.userbox-name { font-size: 13.5px; }

/* دکمهٔ تیره/روشن در سربرگ */
/* دکمهٔ نصب برنامه روی ویندوز — با رنگ آیکن برنامه؛ فقط وقتی مرورگر امکان نصب بدهد دیده می‌شود */
.install-btn {
  color: #5303DB;
  border-color: rgba(83, 3, 219, .26);
  background: rgba(83, 3, 219, .06);
}

.install-btn:hover {
  color: #4302B0;
  border-color: rgba(83, 3, 219, .45);
  background: rgba(83, 3, 219, .12);
}

[data-mode="dark"] .install-btn {
  color: #C6B2FF;
  border-color: rgba(198, 178, 255, .28);
  background: rgba(83, 3, 219, .28);
}

[data-mode="dark"] .install-btn:hover {
  color: #DDD2FF;
  border-color: rgba(198, 178, 255, .5);
  background: rgba(83, 3, 219, .42);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.theme-toggle:active { transform: scale(.96); }

.foot {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------- دکمه‌ها و کنترل‌ها --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-ink) 0%, var(--accent-ink) 100%);
  border-color: var(--accent-ink);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}
.btn-primary .ic { color: #FFFFFF; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFF6F4; }
.btn-danger:hover { background: #8E3930; border-color: #8E3930; color: #fff; }

.btn-danger-ghost { border-color: var(--line-2); color: var(--danger); background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.inline { display: inline; }

.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

textarea.input { resize: vertical; min-height: 90px; line-height: 2; }

/* استایل پایه برای select */
select.input { appearance: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.9; }
.field-inline { min-width: 150px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.check-block { display: flex; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.check-block:hover { border-color: var(--line-2); }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
}
.search .ic { position: absolute; inset-inline-start: 12px; color: var(--muted-2); pointer-events: none; }
.search .input { padding-inline-start: 38px; }
.search-compact { min-width: 0; }

.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 5px; }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* ------------------------------------------------------------ سرصفحه ---- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.page-head-text h1 { font-size: 24px; letter-spacing: -.2px; }
.page-head-text p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.crumbs { margin-bottom: 14px; font-size: 13px; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }

/* --------------------------------------------------------------- کارت --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card-plain { box-shadow: var(--shadow); }
.card-accent { background: var(--accent-soft); border-color: var(--line); }
.card-danger { border-color: var(--line); background: var(--danger-soft); }

.card + .card, .card + .stack, .stack + .card { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.card-head .ic { color: var(--muted); }
.card-head-note { font-size: 12px; color: var(--muted); }
.card-head-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--accent-ink); }

.card-body { padding: 18px; }
.card-body.stack { gap: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.grid-tight { gap: 12px; }
.grid-detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.detail-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── انتخاب تم (پروفایل و پنل کاربر) ──────────────────────────────────── */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.palette {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.palette:hover { border-color: var(--line-2); background: var(--surface-2); }
.palette.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.palette input { position: absolute; opacity: 0; pointer-events: none; }
.palette-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
  flex: 0 0 auto;
}
.palette-text { display: flex; flex-direction: column; line-height: 1.6; }
.palette-text strong { font-size: 13px; font-weight: 600; }
.palette-text small { font-size: 11.5px; color: var(--muted); }
.palette-check { margin-inline-start: auto; color: var(--accent); opacity: 0; transition: opacity .15s ease; }
.palette.is-active .palette-check { opacity: 1; }

.theme-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.theme-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.theme-mode-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.theme-mode-btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.theme-mode-btn .ic { color: inherit; }

/* ---------------------------------------------------------- آمار و سهمیه */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-wide { grid-column: span 2; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 600; line-height: 1.5; }
.stat-hint { font-size: 12px; color: var(--muted-2); }

.meter {
  display: block;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--bg-tint);
  overflow: hidden;
}
.meter-sm { height: 4px; margin-top: 6px; max-width: 160px; }
.meter-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter-fill.is-danger { background: var(--danger); }

/* ------------------------------------------------------------- نوار ابزار */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.toolbar-wrap { align-items: flex-end; }
.toolbar-actions { display: flex; gap: 8px; }

/* --------------------------------------------------------- فهرست پیام‌ها */

.entry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.entry {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.entry:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.entry.is-unread { border-inline-start: 3px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.entry-avatar { padding-top: 2px; }
.entry-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.entry-actions { display: flex; align-items: center; gap: 8px; }

.entry-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-title { font-size: 15px; font-weight: 600; }
.entry-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.entry-sender { color: var(--ink-2); font-weight: 500; }
.entry-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.entry-note {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  background: var(--bg-tint);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.entry-recipients { font-size: 12.5px; color: var(--muted); }

.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); display: inline-block; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
}
.chip .ic { width: 13px; height: 13px; }
.chip-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--line); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge-new { background: var(--accent); border-color: var(--accent); color: #FBF7F1; }
[data-mode="dark"] .badge-new { color: var(--bg); }
.badge-ok { background: var(--ok-soft); border-color: var(--line); color: var(--ok); }
.badge-muted { background: var(--surface-2); }
.badge-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.badge-danger { background: var(--danger-soft); border-color: var(--line); color: var(--danger); }

/* ------------------------------------------------------------ جزئیات ---- */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.detail-title h1 { font-size: 23px; }
.detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- فایل‌ها */

.file-list { list-style: none; margin: 0; padding: 0; }

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.file-row:hover {
  background: var(--surface-2);
}
.file-row:last-child { border-bottom: 0; }

.file-ext {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 5px 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; word-break: break-all; }
.file-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.file-actions { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ بارگذاری --- */

.upload-form { display: flex; flex-direction: column; gap: 16px; }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-tint);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon { color: var(--accent); }
.dropzone strong { font-size: 14px; font-weight: 500; }

.upload-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.upload-item .ui-name { flex: 1; min-width: 0; word-break: break-all; }
.upload-item .ui-size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.upload-bar { height: 4px; width: 90px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.upload-item.is-done .ui-state { color: var(--ok); }
.upload-item.is-error .ui-state { color: var(--danger); }
.ui-state { font-size: 12px; }

/* --------------------------------------------------------------- کاربران */

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background .15s ease, border-color .15s ease;
}
.person:hover { background: var(--surface-2); border-color: var(--line-2); }
.person-text { display: flex; flex-direction: column; line-height: 1.6; flex: 1; min-width: 0; }
.person-text strong { font-size: 13.5px; font-weight: 500; }
.person-text small { color: var(--muted); font-size: 11.5px; }
.person-action { color: var(--muted); }
.person-action:hover { color: var(--accent-ink); }

.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: var(--surface-2); }
.avatar-letter { color: var(--accent-ink); font-weight: 600; }
.avatar-lg { border-radius: 18px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-inline-start: -10px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }

.recipient-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter { font-size: 12px; color: var(--muted); }

.recipient-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipient-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid transparent;
  height: 42px;
}
.recipient-label:hover { border-color: var(--line-2); }
.recipient-label input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.recipient-text { display: flex; flex-direction: column; line-height: 1.6; flex: 1; min-width: 0; }
.recipient-text strong { font-size: 13.5px; font-weight: 500; }
.recipient-text small { color: var(--muted); font-size: 11.5px; }
.ic-check {
    color: #0f8313;
    opacity: 0;
    transition: opacity .12s ease;
    width: 33px; }
.recipient-label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.recipient-label:has(input:checked) .ic-check { opacity: 1; }

/* ------------------------------------------------------------- جدول‌ها */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-actions { width: 1%; }
.table .col-message { max-width: 280px; color: var(--ink-2); }
.row-muted { opacity: .62; }
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.cell-user { display: inline-flex; align-items: center; gap: 9px; }
.cell-user-text { display: flex; flex-direction: column; line-height: 1.5; }
.cell-user-text strong { font-size: 13.5px; font-weight: 500; }
.cell-user-text small { color: var(--muted); font-size: 11.5px; }

.details summary { cursor: pointer; color: var(--accent-ink); font-size: 12px; }
.json {
  margin: 8px 0 0;
  padding: 10px;
  max-width: 380px;
  max-height: 260px;
  overflow: auto;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11px;
  direction: ltr;
  text-align: left;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ لاگ */

.log-list { list-style: none; margin: 0; padding: 0; }
.log-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }
.log-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log-action { font-family: var(--mono); font-size: 11.5px; color: var(--accent-ink); }
.log-message { font-size: 13px; }
.log-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; }

.log-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
  height: fit-content;
}
.log-info { background: var(--surface-2); }
.log-warning { background: var(--warn-soft); border-color: var(--line); color: var(--warn); }
.log-error { background: var(--danger-soft); border-color: var(--line); color: var(--danger); }

/* ----------------------------------------------------------- پیام‌ها --- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.9;
}
.alert .ic { margin-top: 4px; }
.alert-success { background: var(--ok-soft); border-color: var(--line); color: var(--ink); }
.alert-error { background: var(--danger-soft); border-color: var(--line); color: var(--danger); }
.alert-warning { background: var(--warn-soft); border-color: var(--line); color: var(--warn); }
.alert-info { background: var(--surface-2); }

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 2;
}
.notice-soft { background: var(--bg-tint); color: var(--muted); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .ic-xl { color: var(--muted-2); margin-bottom: 6px; }
.empty-title { font-size: 15px; color: var(--ink); font-weight: 500; }
.empty-hint { font-size: 13px; max-width: 420px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; padding: 0 24px 28px; }

.kv { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }

.profile-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.note-text { font-size: 13.5px; line-height: 2.1; color: var(--ink-2); white-space: pre-wrap; }

/* ── پشتیبان‌گیری ──────────────────────────────────────────────────────── */
.backup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.backup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.backup-item:last-child { border-bottom: 0; }
.backup-icon {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  flex: 0 0 auto;
}
.backup-info { flex: 1; min-width: 0; }
.backup-name { font-size: 13.5px; font-weight: 500; word-break: break-all; }
.backup-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.backup-actions { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ صفحه‌بندی */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.pagination-links { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 32px;
  padding: 5px 9px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
}
.page-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.page-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.page-gap { color: var(--muted-2); padding: 0 2px; }

/* ------------------------------------------------------------ ورود/نصب */

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

.auth-panel {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 24px rgba(29, 26, 22, .05);
}

.auth-aside { background: var(--bg-tint); border-inline-end: 1px solid var(--line); }
.auth-aside-inner { padding: 52px 44px; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.auth-aside h1 { font-size: 30px; margin-top: 10px; }
.auth-lead { color: var(--muted); font-size: 14.5px; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.auth-points .ic { color: var(--accent); }

.auth-form { padding: 52px 44px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.auth-title { font-size: 19px; }
.auth-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.auth-copyright { text-align: center; color: var(--muted-2); font-size: 12px; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }

.install { width: 100%; max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.install-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 6px; }
.install-head h1 { font-size: 26px; }
.install-head p { color: var(--muted); font-size: 13.5px; max-width: 560px; }

.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.req { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req-text { display: flex; flex-direction: column; flex: 1; line-height: 1.7; }
.req-text strong { font-size: 13.5px; font-weight: 500; }
.req-text small { color: var(--muted); font-size: 11.5px; }
.req-value { font-size: 12px; color: var(--muted); }
.req.is-ok .ic { color: var(--ok); }
.req.is-bad .ic { color: var(--danger); }
.req.is-warn .ic { color: var(--warn); }

/* ------------------------------------------------------------ واکنش‌گرا */

@media (max-width: 1000px) {
  .grid-detail { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-wide { grid-column: span 1; }
  .palette-grid { grid-template-columns: 1fr; }
  .theme-mode-row { grid-template-columns: 1fr; }
}

/* ------------------------------------------------ ایموجی گفتگوی خصوصی -- */

.emoji-wrap { position: relative; display: flex; }

.emoji-panel {  /* probe */
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 30;
  width: min(340px, 88vw);
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(29, 26, 22, .14);
}

.emoji-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.emoji-tab {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.emoji-tab:hover { color: var(--ink); }

/* ----------------------- فهرست کاربران چت — افکت هاور روشن (از ۱٫۳٫۴) ------ */

.thread-list { max-height: 62vh; overflow-y: auto; }
.thread-list .thread-item { list-style: none; }

.thread-list .thread-item .thread {
  cursor: pointer;
  border-inline-start: 3px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.thread-list .thread-item .thread:hover {
  background: var(--accent-soft);
  border-inline-start-color: var(--accent);
}
.thread-list .thread-item .thread:hover .thread-top strong { color: var(--accent-ink); }
.thread-list .thread-item .thread:hover .avatar { border-color: var(--accent); }
.thread-list .thread-item .thread:active { transform: translateY(1px); }
.thread-list .thread-item .thread.is-active {
  background: var(--accent-soft);
  border-inline-start-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.thread-list .thread-item .thread .thread-start { color: var(--accent-ink); }
.thread-list .thread-item .thread.is-new .thread-preview { color: var(--muted); }

.thread-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.thread-search .search { min-width: 0; }

.thread-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px dashed var(--line-2);
  border-radius: 50%;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}
.thread-go .ic { width: 14px; height: 14px; }
.thread-list .thread-item .thread:hover .thread-go {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (max-width: 900px) {
  .thread-list { max-height: 46vh; }
}
.emoji-tab.is-active { background: var(--accent-soft); border-color: #E5D7C6; color: var(--accent-ink); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 2px;
  max-height: 168px;
  overflow-y: auto;
}
.emoji-item {
  padding: 4px 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 19px;
  line-height: 1.4;
  cursor: pointer;
}
.emoji-item:hover { background: var(--surface-2); }

/* ----------------------------------------- اشتراک‌گذاری در شبکه‌های اجتماعی -- */

.social-share { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.social-btn:hover { background: var(--surface-2); border-color: var(--muted-2); color: var(--ink); }
.social-btn:active { transform: translateY(1px); }

.social-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #FBF9F6;
  font-size: 11.5px;
  font-weight: 600;
  flex: 0 0 auto;
}

.social-telegram .social-mark { background: #229ED9; }
.social-whatsapp .social-mark { background: #25D366; }
.social-bale .social-mark { background: #12A19A; }
.social-eitaa .social-mark { background: #E07B39; }
.social-rubika .social-mark { background: #7A4BD0; }
.social-native { border-style: dashed; }
.social-native .social-mark { background: var(--muted); }

/* پنل بازشو (details) برای اشتراک‌گذاری هر لینک */

.pop { position: relative; display: inline-block; }
.pop > summary {
  list-style: none;
  cursor: pointer;
}
.pop > summary::-webkit-details-marker { display: none; }
.pop[open] > summary { background: var(--surface-2); border-color: var(--muted-2); }
.pop-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  width: min(320px, 84vw);
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(29, 26, 22, .16);
  text-align: start;
}
.pop-title { margin-bottom: 9px; color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------- منوی کناری همبرگری (موبایل) -- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-toggle:hover { background: var(--surface-2); color: var(--ink); }
.nav-toggle .ic { width: 20px; height: 20px; }

.drawer,
.drawer-scrim { display: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-user:hover { background: var(--surface-2); }
.drawer-user-text { display: flex; flex-direction: column; line-height: 1.6; min-width: 0; }
.drawer-user-text strong { font-size: 14px; font-weight: 600; }
.drawer-user-text small { color: var(--muted); font-size: 11.5px; }

.drawer-nav { display: flex; flex-direction: column; gap: 3px; padding: 10px; }

.drawer-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  border: 1px solid transparent;
}
.drawer-link:hover { background: var(--surface-2); color: var(--ink); }
.drawer-link.is-active { background: var(--accent-soft); border-color: #E5D7C6; color: var(--accent-ink); }

.drawer-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.drawer-version { color: var(--muted-2); font-size: 11.5px; text-align: center; margin-top: 2px; }

body.drawer-open { overflow: hidden; }

/* ------------------------------------------------------ نمایشگر پیش‌نمایش -- */

.viewer-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.viewer-title h1 { font-size: 19px; word-break: break-all; }
.viewer-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-tint);
}
.viewer-image {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.viewer-zoom { display: block; line-height: 0; }
.viewer-media { width: 100%; max-height: 76vh; border-radius: var(--radius-sm); background: #000; }
.viewer-frame { width: 100%; height: 76vh; border: 0; border-radius: var(--radius-sm); background: var(--surface); }
.viewer-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  padding: 26px 0;
  color: var(--accent);
}
.viewer-audio .viewer-media { background: transparent; }
.viewer-hint { margin-top: 10px; }
.viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ---------------------------------------------------- بندانگشتی فایل --- */

.file-thumb {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color .15s ease;
}
.file-thumb:hover { border-color: var(--accent); }
.file-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.file-thumb-icon { display: inline-flex; color: var(--accent-ink); }

@media (max-width: 820px) {
  .topbar { gap: 8px; padding: 10px 16px; }
  .nav { display: none; } /* منوی افقی جای خود را به منوی کناری همبرگری می‌دهد */
  .nav-toggle { display: inline-flex; }
  .main { padding: 20px 16px 44px; }
  .auth-panel { grid-template-columns: 1fr; max-width: 520px; }
  .auth-aside { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .auth-aside-inner, .auth-form { padding: 30px 24px; }
  .userbox-name { display: none; }
  .userbox { margin-inline-start: auto; gap: 8px; }
  .brand-text small { display: none; }
  .hide-sm { display: none; }
  .hide-mobile { display: none !important; }

  /* منوی کناری */
  .drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(29, 26, 22, .42);
    backdrop-filter: blur(2px);
  }
  .drawer-scrim[hidden] { display: none; }

  .drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(86vw, 330px);
    z-index: 61;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 26px rgba(29, 26, 22, .14);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .22s ease;
    will-change: transform;
  }
  .drawer[hidden] { display: none; }
  .drawer.is-open { transform: translateX(0); }

  .viewer { padding: 10px; min-height: 180px; }
  .viewer-frame { height: 62vh; }
  .viewer-image { max-height: 60vh; }
  .viewer-actions { width: 100%; }

  .page-head-text h1 { font-size: 20px; }
  .entry { flex-wrap: wrap; }
  .entry-actions { width: 100%; justify-content: flex-end; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .backup-item { flex-wrap: wrap; }
  .backup-actions { width: 100%; justify-content: flex-end; }
}

@media print {
  .topbar, .foot, .page-head-actions, .entry-actions, .file-actions { display: none; }
}

/* ===========================================================================
   نسخهٔ ۱٫۲٫۰ — اعلان‌ها، اشتراک‌گذاری، پیش‌نمایش، ZIP، انقضا و چت
   =========================================================================== */

/* ----------------------------------------------- نشان اعلان در ناوبری --- */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-inline-start: 2px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 600;
}

/* ------------------------------------------------------ زنگ اعلان سربرگ --- */

.bell { position: relative; }
.bell > summary { list-style: none; }
.bell > summary::-webkit-details-marker { display: none; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }

.icon-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFF6F4;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}
.icon-badge.is-pulse { animation: badgePulse 1.2s ease 2; }

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

.bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 40;
  width: 330px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(29, 26, 22, .14);
}

.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.bell-head a { color: var(--accent-ink); }

.bell-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.bell-item:last-of-type { border-bottom: 0; }
.bell-item:hover { background: var(--surface-2); }
.bell-item .ic { margin-top: 3px; color: var(--muted); }
.bell-item span { display: flex; flex-direction: column; line-height: 1.7; min-width: 0; }
.bell-item strong { font-size: 12.5px; font-weight: 500; }
.bell-item small { color: var(--muted); font-size: 11px; }

.bell-empty { padding: 14px 8px; text-align: center; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------ هشدار انقضای فایل --- */

.file-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.expiry-badge .ic { width: 12px; height: 12px; }

.expiry-badge.is-warn {
  background: var(--warn-soft);
  border-color: var(--line);
  color: var(--warn);
}

.expiry-badge.is-soon,
.expiry-badge.is-gone {
  background: var(--danger-soft);
  border-color: var(--line);
  color: var(--danger);
  font-weight: 500;
}

.chip-danger {
  background: var(--danger-soft);
  border-color: var(--line);
  color: var(--danger);
  font-weight: 500;
}

.file-select {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.chunk-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  max-width: 460px;
  color: var(--muted-2);
}
.chunk-hint .ic { width: 13px; height: 13px; }

/* ------------------------------------------------------- مرکز اعلان --- */

.notice-list { list-style: none; margin: 0; padding: 0; }

.notice-item {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.notice-item:last-child { border-bottom: 0; }
.notice-item.is-unread { border-inline-start: 3px solid var(--accent); background: var(--surface-2); }

.notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-ink);
}

.notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notice-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-title { font-size: 13.5px; font-weight: 500; }
.notice-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.notice-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }

/* --------------------------------------------------------------- چت --- */

.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chat-side { min-width: 0; }
.chat-main { min-width: 0; }

.thread-list { list-style: none; margin: 0; padding: 0; }

.thread {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.thread:hover { background: var(--surface-2); }
.thread.is-active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

.thread-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.thread-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-top strong { font-size: 13px; font-weight: 500; }
.thread-top small { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }
.thread-preview {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  height: 560px;
  max-height: 560px;
  min-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-tint);
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}
.chat-thread::-webkit-scrollbar { display: none; width: 0; height: 0; }

.chat-empty { text-align: center; padding: 28px 12px; }

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 78%;
}
.bubble-row.is-mine { margin-inline-start: auto; flex-direction: row-reverse; }

.bubble {
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.bubble-theirs { border-start-start-radius: 4px; }
.bubble-mine {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #FFFFFF;
  border-color: transparent;
  border-start-end-radius: 4px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.22);
}
.bubble-mine .bubble-meta { color: rgba(255, 255, 255, 0.85); }

.bubble-text { font-size: 13.5px; line-height: 2; white-space: pre-wrap; word-break: break-word; }
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  font-size: 10.5px;
  opacity: .75;
}
.bubble-mine .bubble-meta { color: var(--bg); }

.tick { letter-spacing: -1px; }
.tick.is-read { color: var(--accent-ink); opacity: 1; }

.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat-compose textarea { min-height: 60px; }
.chat-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .bubble-row { max-width: 88%; }
  .chat-thread { height: 420px; max-height: 420px; min-height: 420px; }
}

/* ── اسکرول‌بار مدرن و باریک ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--muted-2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ===========================================================================
   بخش اختصاصی کامپوننت‌های داشبورد دابنگ (Dabang Design System & Widgets)
   =========================================================================== */

/* کارت اصلی خلاصه وضعیت (Dabang Summary Paper) */
.dabang-summary-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  box-shadow: 0px 4px 20px 0px rgba(220, 226, 238, 0.45);
  margin-bottom: 22px;
}
[data-mode="dark"] .dabang-summary-card {
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.25);
}

.dabang-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.dabang-summary-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px 0;
}
.dabang-summary-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.dabang-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* گرید ۴ تایی کارت‌های رنگی دابنگ (SaleCard) */
.dabang-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) {
  .dabang-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .dabang-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .dabang-kpi-card {
    padding: 14px 12px;
    border-radius: 14px;
    min-height: 0;
  }
  .dabang-kpi-top { margin-bottom: 8px; }
  .dabang-kpi-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .dabang-kpi-badge { font-size: 10px; padding: 2px 7px; }
  .dabang-kpi-val { font-size: 22px; margin-bottom: 2px; }
  .dabang-kpi-lbl { font-size: 12px; }
  .dabang-kpi-hint { font-size: 10.5px; }
}

.dabang-kpi-card {
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}
.dabang-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.dabang-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dabang-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.dabang-kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.dabang-kpi-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.dabang-kpi-lbl {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.dabang-kpi-hint {
  font-size: 11.5px;
  opacity: 0.85;
}

/* ۱) رنگ صورتی/رز دابنگ */
.dabang-kpi-rose {
  background: #FFE2E5;
  color: #151D48;
}
.dabang-kpi-rose .dabang-kpi-icon { background: #FA5A7D; color: #fff; }
.dabang-kpi-rose .dabang-kpi-badge { background: #FA5A7D; color: #fff; }
.dabang-kpi-rose .dabang-kpi-lbl { color: #425166; }
.dabang-kpi-rose .dabang-kpi-hint { color: #737791; }

/* ۲) رنگ زرد/طلایی دابنگ */
.dabang-kpi-amber {
  background: #FFF4DE;
  color: #151D48;
}
.dabang-kpi-amber .dabang-kpi-icon { background: #FF947A; color: #fff; }
.dabang-kpi-amber .dabang-kpi-badge { background: #FFA412; color: #fff; }
.dabang-kpi-amber .dabang-kpi-lbl { color: #425166; }
.dabang-kpi-amber .dabang-kpi-hint { color: #737791; }

/* ۳) رنگ سبز زمردی دابنگ */
.dabang-kpi-emerald {
  background: #DCFCE7;
  color: #151D48;
}
.dabang-kpi-emerald .dabang-kpi-icon { background: #00E096; color: #fff; }
.dabang-kpi-emerald .dabang-kpi-badge { background: #0BB783; color: #fff; }
.dabang-kpi-emerald .dabang-kpi-badge.is-urgent { background: #DC2626; color: #fff; }
.dabang-kpi-emerald .dabang-kpi-lbl { color: #425166; }
.dabang-kpi-emerald .dabang-kpi-hint { color: #737791; }

/* ۴) رنگ اسطوخودوس/نیلی دابنگ */
.dabang-kpi-indigo {
  background: #F3E8FF;
  color: #151D48;
}
.dabang-kpi-indigo .dabang-kpi-icon { background: #5D5FEF; color: #fff; }
.dabang-kpi-indigo .dabang-kpi-badge { background: #8950FC; color: #fff; }
.dabang-kpi-indigo .dabang-kpi-lbl { color: #425166; }
.dabang-kpi-indigo .dabang-kpi-hint { color: #737791; }

/* دارک‌مود برای کارت‌های دابنگ */
[data-mode="dark"] .dabang-kpi-rose { background: rgba(250, 90, 125, 0.12); color: #fff; }
[data-mode="dark"] .dabang-kpi-rose .dabang-kpi-lbl { color: #CBD5E1; }
[data-mode="dark"] .dabang-kpi-rose .dabang-kpi-hint { color: #94A3B8; }

[data-mode="dark"] .dabang-kpi-amber { background: rgba(255, 164, 18, 0.12); color: #fff; }
[data-mode="dark"] .dabang-kpi-amber .dabang-kpi-lbl { color: #CBD5E1; }
[data-mode="dark"] .dabang-kpi-amber .dabang-kpi-hint { color: #94A3B8; }

[data-mode="dark"] .dabang-kpi-emerald { background: rgba(0, 224, 150, 0.12); color: #fff; }
[data-mode="dark"] .dabang-kpi-emerald .dabang-kpi-lbl { color: #CBD5E1; }
[data-mode="dark"] .dabang-kpi-emerald .dabang-kpi-hint { color: #94A3B8; }

[data-mode="dark"] .dabang-kpi-indigo { background: rgba(93, 95, 239, 0.14); color: #fff; }
[data-mode="dark"] .dabang-kpi-indigo .dabang-kpi-lbl { color: #CBD5E1; }
[data-mode="dark"] .dabang-kpi-indigo .dabang-kpi-hint { color: #94A3B8; }

/* ویجت سهمیه فضای ابری دابنگ */
.dabang-quota-widget {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0px 4px 20px 0px rgba(220, 226, 238, 0.40);
  margin-bottom: 22px;
}
[data-mode="dark"] .dabang-quota-widget {
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.22);
}
.dabang-quota-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  flex-wrap: wrap;
  gap: 14px;
}
.dabang-quota-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dabang-quota-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.dabang-quota-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px 0;
}
.dabang-quota-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}
.dabang-quota-meter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}
.dabang-quota-meter-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.dabang-quota-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5D5FEF 0%, #00E096 100%);
  transition: width 0.4s ease;
}
.dabang-quota-meter-fill.is-danger {
  background: #FA5A7D;
}
.dabang-quota-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  min-width: 34px;
}

/* کارت تبلیغاتی / وضعیت ابری دابنگ در سایدبار (Dabang Pro NavCard) */
.side-navcard {
  margin-top: 14px;
  margin-bottom: 12px;
  padding: 18px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #151D48 0%, #2A3368 100%);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(21, 29, 72, 0.18);
  position: relative;
  overflow: hidden;
}
.side-navcard::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(93, 95, 239, 0.35);
  filter: blur(14px);
}
.side-navcard-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: #FFFFFF;
  margin-bottom: 2px;
}
.side-navcard strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}
.side-navcard p {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}
.side-navcard-btn {
  margin-top: 6px;
  width: 100%;
  background: #FFFFFF !important;
  color: #5D5FEF !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 7px 12px !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.side-navcard-btn:hover {
  background: #F1F4FA !important;
  transform: translateY(-1px);
}

/* ===========================================================================
   منوی راست‌کلیک شناور پیام‌های چت و توست کپی (Chat Context Menu & Toast)
   =========================================================================== */

.bubble-ctx {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  min-width: 175px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 6px;
  gap: 3px;
  direction: rtl;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: bubbleCtxPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bubbleCtxPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.bubble-ctx button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s ease;
  font-family: inherit;
}

.bubble-ctx button:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.bubble-ctx button.is-delete {
  color: var(--danger);
}
.bubble-ctx button.is-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* توست شناور کپی پیام در چت */
.chat-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.90);
  color: #FFFFFF;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* تضمین آزادی کامل انتخاب متن پیام‌ها در چت */
.chat-thread,
.bubble-row,
.bubble,
.bubble-text {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* ===========================================================================
   نشانگرهای دسته‌بندی ماهیت و فرمت فایل‌ها در سرتاسر سیستم
   =========================================================================== */
.nature-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nature-badge .nature-emoji { font-size: 13px; line-height: 1; }
.nature-badge .nature-text { font-size: 11px; }

.nature-design    { background: #F3E8FF; color: #7C3AED; border-color: #E9D5FF; }
.nature-image     { background: #E0F2FE; color: #0284C7; border-color: #BAE6FD; }
.nature-sheet     { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }
.nature-doc       { background: #EFF6FF; color: #2563EB; border-color: #DBEAFE; }
.nature-pres      { background: #FFEDD5; color: #C2410C; border-color: #FED7AA; }
.nature-audio     { background: #FCE7F3; color: #BE185D; border-color: #FBCFE8; }
.nature-video     { background: #FFE4E6; color: #E11D48; border-color: #FECDD3; }
.nature-archive   { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.nature-code      { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.nature-other     { background: #F8FAFC; color: #64748B; border-color: #E2E8F0; }

.archive-format-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.ext-cdr  { background: #FAF5FF; color: #6B21A8; border-color: #D8B4FE; }
.ext-ai   { background: #FFF7ED; color: #C2410C; border-color: #FFEDD5; }
.ext-eps  { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.ext-tiff, .ext-tif { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }
.ext-xlsx, .ext-xls, .ext-csv { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.ext-docx, .ext-doc { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.ext-pdf  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.ext-zip, .ext-rar { background: #FEFCE8; color: #854D0E; border-color: #FEF08A; }

/* ===========================================================================
   استایل‌های اختصاصی صفحه آرشیو عمومی (Public Archive)
   =========================================================================== */
.archive-header-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.archive-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4F46E5;
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  animation: pulseDot 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulseDot {
  to { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}

.archive-toolbar-card {
  padding: 16px 20px;
  margin-bottom: 22px;
}
.archive-filter-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.archive-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.archive-search-box .search-ic {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.archive-search-input {
  padding-right: 38px !important;
  width: 100%;
}
.clear-search-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
}
.archive-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.archive-sort-select {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-view-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.view-btn.is-active {
  background: var(--accent);
  color: #FFFFFF;
}

.archive-nature-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  scrollbar-width: thin;
}
.nature-tab-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.nature-tab-chip:hover {
  background: var(--surface-3, rgba(0,0,0,0.06));
  transform: translateY(-1px);
}
.nature-tab-chip.is-active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(93, 95, 239, 0.35);
}

.archive-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.archive-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 18px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.archive-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.archive-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.archive-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.4;
}
.archive-card-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.archive-card-title a:hover {
  color: var(--accent);
}
.archive-card-filename {
  font-size: 11.5px;
  word-break: break-all;
  margin-bottom: 10px;
}
.archive-card-desc {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.archive-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}
.archive-card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-download-badge {
  color: var(--accent);
  font-weight: 700;
}
.archive-card-uploader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.uploader-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.archive-permanent-badge {
  margin-right: auto;
  font-size: 10.5px;
  color: #10B981;
  font-weight: 700;
}
.archive-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.archive-card-actions .btn {
  flex: 1;
  justify-content: center;
}

.table-dl-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.archive-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.archive-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.archive-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
}
.archive-dropzone {
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.archive-dropzone:hover {
  background: rgba(93, 95, 239, 0.12);
}
.dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone-text { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.archive-modal-notice {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.archive-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ===========================================================================
   موتور پیش‌نمایش تعاملی Excel و Word در مرورگر
   =========================================================================== */
.specialized-badge-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 16px;
}
.viewer-special-box {
  width: 100%;
}

.sheet-viewer-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.sheet-search-wrap { flex: 1; max-width: 320px; }
.sheet-tabs-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.sheet-tab-btn {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.sheet-tab-btn.is-active {
  background: #107C41;
  color: #FFFFFF;
  border-color: #107C41;
}
.sheet-table-scroll {
  max-height: 580px;
  overflow: auto;
}
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  direction: rtl;
}
.sheet-col-letters th {
  background: #F1F5F9;
  color: #64748B;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid #CBD5E1;
  font-size: 11px;
  text-align: center;
}
.sheet-row-num-th, .sheet-row-num-td {
  width: 45px;
  background: #F1F5F9;
  color: #64748B;
  text-align: center;
  font-weight: 700;
  border: 1px solid #CBD5E1;
  font-size: 11px;
}
.sheet-header-labels th {
  background: #E2E8F0;
  color: #1E293B;
  font-weight: 800;
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  text-align: right;
}
.sheet-table td {
  padding: 7px 12px;
  border: 1px solid #E2E8F0;
  text-align: right;
}
.sheet-table tr:hover td {
  background: rgba(93, 95, 239, 0.04);
}
.num-cell {
  direction: ltr;
  text-align: left;
  font-family: monospace, inherit;
}
.sheet-pane-footer {
  padding: 8px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.docx-paper-sheet {
  max-width: 820px;
  margin: 0 auto;
  background: #FFFFFF;
  color: #1E293B;
  padding: 45px 55px;
  border-radius: 8px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.10);
  border: 1px solid #E2E8F0;
  font-family: 'Vazir', 'Tahoma', system-ui, sans-serif;
  line-height: 1.8;
  position: relative;
}
.docx-watermark-corner {
  position: absolute;
  top: 14px;
  left: 20px;
  font-size: 11px;
  color: #94A3B8;
  font-weight: 600;
}
.docx-heading {
  color: #0F172A;
  margin: 22px 0 10px 0;
  font-weight: 800;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 6px;
}
.docx-p {
  margin: 0 0 12px 0;
  text-align: justify;
}
.docx-empty-line { min-height: 1.2em; }
.docx-list-item {
  margin: 4px 18px 4px 0;
}
.docx-bullet {
  color: var(--accent, #4F46E5);
  font-weight: 800;
}
.docx-table-wrap {
  margin: 16px 0;
  overflow-x: auto;
}
.docx-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}
.docx-table th {
  background: #F8FAFC;
  font-weight: 700;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}
.docx-table td {
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
}

/* ===========================================================================
   سیستم فوق‌العاده مدرن و اختصاصی لیست‌های بازشونده (Modern Select System)
   خداحافظی با ظاهر قدیمی و ویندوز ۹۸ مرورگرها و تبدیل به کامپوننت شیک دابنگ
   =========================================================================== */
select,
.select,
select.input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  width: auto;
  min-width: 150px;
  height: 40px;
  line-height: 38px;
  padding: 0 16px 0 38px !important; /* فضای کافی برای فلش آیکون در سمت چپ */
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  background-color: var(--surface) !important;
  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='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 12px center !important;
  background-size: 14px 14px !important;
  border: 1.5px solid var(--line, #E2E8F0) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  vertical-align: middle;
}

select:hover,
.select:hover,
select.input:hover {
  border-color: var(--accent, #5D5FEF) !important;
  box-shadow: 0 2px 8px rgba(93, 95, 239, 0.12) !important;
  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='%235D5FEF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

select:focus,
.select:focus,
select.input:focus {
  border-color: var(--accent, #5D5FEF) !important;
  box-shadow: 0 0 0 3.5px rgba(93, 95, 239, 0.20), 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  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='%235D5FEF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

/* اندازه کوچک (select-sm) */
select.select-sm,
.select.select-sm {
  height: 36px !important;
  line-height: 34px !important;
  padding: 0 12px 0 32px !important;
  font-size: 12.5px !important;
  border-radius: 10px !important;
  min-width: 130px !important;
  background-position: left 10px center !important;
  background-size: 13px 13px !important;
}

/* اندازه بزرگ (select-lg) */
select.select-lg,
.select.select-lg {
  height: 46px !important;
  line-height: 44px !important;
  padding: 0 18px 0 42px !important;
  font-size: 14.5px !important;
  border-radius: 14px !important;
  background-position: left 14px center !important;
  background-size: 16px 16px !important;
}

/* آیتم‌های لیست */
select option,
.select option {
  background-color: var(--surface, #FFFFFF);
  color: var(--ink, #0F172A);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* هماهنگی با تم تیره */
[data-theme-mode="dark"] select,
[data-theme-mode="dark"] .select,
[data-theme-mode="dark"] select.input {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  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='%2394A3B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}
[data-theme-mode="dark"] select:hover,
[data-theme-mode="dark"] .select:hover,
[data-theme-mode="dark"] select.input:hover {
  border-color: var(--accent) !important;
  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='%23A5B4FC' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}
[data-theme-mode="dark"] select option,
[data-theme-mode="dark"] .select option {
  background-color: #1E293B;
  color: #F8FAFC;
}

/* ===========================================================================
   استایل‌های بازطراحی‌شدهٔ سربرگ، نوار ابزار و دسته‌بندی‌های آرشیو عمومی
   =========================================================================== */
.archive-page-head {
  margin-bottom: 22px;
}
.archive-title-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.archive-title-badge-wrap h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.archive-head-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #BBF7D0;
}

.archive-kpi-grid {
  margin-bottom: 22px;
}

.archive-toolbar-box {
  padding: 18px 22px;
  margin-bottom: 24px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.archive-toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.archive-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}
.archive-search-wrap .search-ic {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}
.archive-search-input {
  width: 100%;
  height: 42px !important;
  padding-right: 42px !important;
  border-radius: 12px !important;
  font-size: 13.5px !important;
}

.archive-controls-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.archive-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-sort-wrap .sort-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.archive-view-toggle {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  padding: 2px;
  gap: 2px;
}
.view-toggle-btn {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  text-decoration: none;
}
.view-toggle-btn.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.archive-category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  scrollbar-width: thin;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}
.cat-pill:hover {
  background: var(--surface-3, rgba(0,0,0,0.06));
  transform: translateY(-1px);
}
.cat-pill.is-active {
  background: var(--accent);
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(93, 95, 239, 0.35);
}

/* ===========================================================================
   استایل‌های بنر و اعلان‌های وب‌پوش (Web Push UI Components)
   =========================================================================== */
.frs-push-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  max-width: 580px;
  margin: 0 auto;
  z-index: 9999;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(93, 95, 239, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
  animation: frsPushSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

@keyframes frsPushSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.frs-push-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.frs-push-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(93, 95, 239, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frs-push-banner-content {
  flex: 1;
  min-width: 0;
}

.frs-push-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}

.frs-push-banner-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.frs-push-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .frs-push-banner { bottom: 12px; right: 12px; left: 12px; padding: 14px; }
  .frs-push-banner-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .frs-push-banner-actions { width: 100%; justify-content: flex-end; }
}

/* نشانگر تست و اعلان شناور (Push Toast) */
.frs-push-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.frs-push-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.frs-push-toast.is-success {
  background: #059669;
}

.frs-push-toast.is-warning {
  background: #D97706;
}

/* مدال راهنمای iOS */
.frs-ios-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  direction: rtl;
}

.frs-ios-modal.is-open {
  display: flex;
}

.frs-ios-modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.frs-ios-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.frs-ios-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.frs-ios-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.frs-ios-modal-body ol {
  padding-right: 20px;
  margin: 14px 0;
  line-height: 1.8;
  font-size: 13.5px;
}

.frs-ios-modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

/* پنجرهٔ پرامپت فعال‌سازی پوش وب هنگام ورود به پنل */
.frs-push-prompt-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  z-index: 99998;
  align-items: center;
  justify-content: center;
  padding: 20px;
  direction: rtl;
  animation: frsFadeIn 0.25s ease;
}

.frs-push-prompt-modal.is-open {
  display: flex;
}

.frs-push-prompt-card {
  background: var(--surface, #FFFFFF);
  border: 1.5px solid var(--accent, #5D5FEF);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(93, 95, 239, 0.35), 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: frsScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.frs-push-prompt-icon-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(93, 95, 239, 0.12);
  color: var(--accent, #5D5FEF);
  display: flex;
  align-items: center;
  justify-content: center;
}

.frs-push-prompt-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #0F172A);
  margin: 0 0 10px;
}

.frs-push-prompt-card p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted, #64748B);
  margin: 0 0 22px;
}

.frs-push-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.frs-push-btn-pulse {
  background: var(--accent, #5D5FEF) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(93, 95, 239, 0.4);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.frs-push-btn-pulse:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(93, 95, 239, 0.5);
}

/* ===========================================================================
   استایل‌های بازطراحی مدرن و تک‌صفحه‌ای ارسال فایل (Single-Page Send Portal)
   =========================================================================== */
.send-page-head {
  margin-bottom: 22px;
}
.send-layout-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1024px) {
  .send-layout-grid {
    grid-template-columns: 1fr;
  }
}

.send-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

/* ناحیهٔ دراپ‌زون مدرن */
.send-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 38px 24px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.send-dropzone:hover,
.send-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(93, 95, 239, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(93, 95, 239, 0.12);
}
.send-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}
.send-dropzone-icon-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(93, 95, 239, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}
.send-dropzone:hover .send-dropzone-icon-ring {
  transform: scale(1.1);
}
.send-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.send-dropzone-subtitle {
  font-size: 12.5px;
  color: var(--muted);
}
.send-chunk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 6px;
}

/* صف فایل‌های انتخابی */
.send-queue-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.send-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.send-queue-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.send-queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
}
.send-queue-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.send-queue-card:hover {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.send-file-badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.send-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.send-file-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.send-file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.send-file-size {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.send-file-progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  display: none;
}
.send-file-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.15s ease;
}
.send-file-state {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.send-file-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.send-file-remove-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.send-queue-card.is-uploading .send-file-progress-track {
  display: block;
}
.send-queue-card.is-uploading .send-file-state {
  color: var(--accent);
}
.send-queue-card.is-done {
  border-color: #10B981;
  background: #F0FDF4;
}
.send-queue-card.is-done .send-file-state {
  color: #059669;
}
.send-queue-card.is-error {
  border-color: #EF4444;
  background: #FEF2F2;
}
.send-queue-card.is-error .send-file-state {
  color: #DC2626;
}

/* انتخاب گیرندگان مدرن */
.send-recipients-card {
  position: sticky;
  top: 85px;
}
.send-recipient-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.send-recipient-search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 16px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}
.send-recipient-search-wrap input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.15);
}
.send-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.send-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.send-selected-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.send-chip-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(93, 95, 239, 0.1);
  color: var(--accent);
  border: 1px solid rgba(93, 95, 239, 0.25);
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.send-chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  padding: 0;
  line-height: 1;
}

.send-recipients-scroll {
  list-style: none;
  margin: 0;
  padding: 2px;
  max-height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}
.send-recipient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.send-recipient-row:hover {
  background: var(--surface);
  border-color: var(--line);
  transform: translateX(-2px);
}
.send-recipient-row.is-selected {
  background: rgba(93, 95, 239, 0.08);
  border-color: var(--accent);
}
.send-recipient-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
}
.send-recipient-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}
.send-recipient-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.send-recipient-role {
  font-size: 11px;
  color: var(--muted);
}

/* نوار اقدام پایانی و دکمه ارسال */
.send-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 20px rgba(93, 95, 239, 0.12);
}
.send-summary-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.send-summary-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.send-summary-hint {
  font-size: 12px;
  color: var(--muted);
}
.send-main-cta {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(93, 95, 239, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.send-main-cta:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(93, 95, 239, 0.45);
}
.send-main-cta:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================================
 * نِی‌باکس — استایل‌های بهبود چت واتساپی (فاز ۱ و ۲)
 * ========================================================================== */

/* تیک سه‌حالته */
.tick.is-delivered { color: #8696a0; opacity: 1; }
.tick.is-read { color: #53bdeb; opacity: 1; }

/* نشانگر تایپ */
.typing-indicator {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  animation: typingPulse 1.2s ease-in-out infinite;
}
@keyframes typingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* فایل پیوست در حباب */
.bubble-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0,0,0,0.08);
}
.bubble-mine .bubble-file { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); }
.bubble-file:hover { background: rgba(0,0,0,0.1); }
.bubble-file-name { font-weight: 600; font-size: 13px; word-break: break-all; }
.bubble-file-size { opacity: 0.7; font-size: 11px; }

/* پیش‌نمایش فایل در فرم */
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2, #f0f2f5);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.file-preview[hidden] { display: none; }
.file-preview-body { display: flex; align-items: center; gap: 8px; }
.file-preview-close { background: none; border: none; cursor: pointer; opacity: 0.6; }
.file-preview-close:hover { opacity: 1; }

/* ری‌اکشن‌ها */
.bubble-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}
.reaction-chip small { font-size: 11px; opacity: 0.8; }
.reaction-chip:hover { background: rgba(0,0,0,0.1); }

.react-picker {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.react-emoji {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.15s;
}
.react-emoji:hover { transform: scale(1.3); background: rgba(0,0,0,0.05); }

/* دکمه‌های اکشن حباب */
.bubble-actions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.bubble-row:hover .bubble-actions { opacity: 1; }
.bubble-act {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  opacity: 0.5;
  border-radius: 4px;
}
.bubble-act:hover { opacity: 1; background: rgba(0,0,0,0.08); }

/* بج ویرایش */
.edited-badge {
  font-size: 10px;
  opacity: 0.7;
  font-style: italic;
  margin-inline-end: 4px;
}

/* پیام حذف‌شده */
.bubble-deleted {
  font-style: italic;
  opacity: 0.6;
}

/* جستجو در گفتگو */
.chat-search-results {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  width: 320px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 4px;
}
.search-result-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
}
.search-result-item:hover { background: rgba(0,0,0,0.04); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item mark { background: #ffeb3b; padding: 0 2px; border-radius: 2px; }
.sr-body { display: block; margin-bottom: 4px; }
.sr-time { opacity: 0.6; font-size: 11px; }
.search-empty { padding: 16px; text-align: center; opacity: 0.6; font-size: 13px; }

.bubble-row.search-hit .bubble {
  box-shadow: 0 0 0 3px rgba(255, 235, 59, 0.6);
  transition: box-shadow 0.3s;
}

/* پیام صوتی */
.voice-timer {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger, #e11d48);
  padding: 4px 8px;
}
#voiceBtn.is-recording {
  background: var(--danger, #e11d48);
  color: #fff;
  animation: typingPulse 1s ease-in-out infinite;
}

/* تست چت */
.chat-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 100001;
  pointer-events: none;
}
.chat-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* ==========================================================================
 * نِی‌باکس — پوسته واتساپی چت خصوصی
 * WhatsApp-style dark theme for private chat (chat.php)
 * ========================================================================== */

.wa-chat-wrap {
  --wa-bg: #0b141a;
  --wa-header: #202c33;
  --wa-bubble-mine: #005c4b;
  --wa-bubble-theirs: #202c33;
  --wa-input-bg: #2a3942;
  --wa-text: #e9edef;
  --wa-muted: #8696a0;
  --wa-accent: #00a884;
  --wa-tick-read: #53bdeb;
  --wa-border: #222d34;
  background: var(--wa-bg);
  color: var(--wa-text);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  min-height: 640px;
  height: calc(100vh - 220px);
  min-height: 560px;
  max-height: 800px;
  border: 1px solid var(--wa-border);
  direction: rtl;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* ---------- سایدبار مخاطبین ---------- */
.wa-sidebar {
  width: 340px;
  min-width: 300px;
  max-width: 380px;
  background: var(--wa-bg);
  border-left: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wa-sidebar-head {
  background: var(--wa-header);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wa-sidebar-title { font-size: 16px; font-weight: 600; }
.wa-sidebar-search { padding: 8px 12px; background: var(--wa-bg); }
.wa-sidebar-search input {
  width: 100%;
  background: var(--wa-header);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--wa-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.wa-sidebar-search input::placeholder { color: var(--wa-muted); }
.wa-contact-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.wa-contact-list::-webkit-scrollbar { width: 6px; }
.wa-contact-list::-webkit-scrollbar-thumb { background: #374045; border-radius: 3px; }
.wa-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(134,150,160,0.08);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.wa-contact:hover { background: var(--wa-header); }
.wa-contact.is-active { background: var(--wa-header); }
.wa-contact-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--wa-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 18px; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.wa-contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-contact-body { flex: 1; min-width: 0; }
.wa-contact-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-contact-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-contact-time { font-size: 11px; color: var(--wa-muted); white-space: nowrap; }
.wa-contact-preview {
  font-size: 12px; color: var(--wa-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.wa-unread-badge {
  background: var(--wa-accent); color: #fff;
  font-size: 11px; font-weight: 600;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px;
}

/* ---------- ناحیه چت ---------- */
.wa-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--wa-bg); }

/* هدر چت */
.wa-chat-header {
  background: var(--wa-header);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 5;
}
.wa-back-btn {
  display: none;
  background: none; border: none; color: var(--wa-text);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  line-height: 1;
}
.wa-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--wa-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 17px; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.wa-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-chat-info { flex: 1; min-width: 0; }
.wa-chat-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-status { font-size: 12px; color: var(--wa-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-status.typing { color: var(--wa-accent); }
.wa-chat-actions { display: flex; align-items: center; gap: 4px; }
.wa-icon-btn {
  background: none; border: none; color: #aebac1;
  font-size: 18px; cursor: pointer; padding: 8px;
  border-radius: 50%; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-icon-btn:hover { background: rgba(255,255,255,0.08); }

/* بدنه پیام‌ها */
.wa-chat-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--wa-bg);
  background-image:
    radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 22px 22px;
}
.wa-chat-body::-webkit-scrollbar { width: 6px; }
.wa-chat-body::-webkit-scrollbar-thumb { background: #374045; border-radius: 3px; }

.wa-day-divider {
  align-self: center;
  background: var(--wa-header);
  color: var(--wa-muted);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 8px;
  margin: 8px 0;
}

/* حباب پیام */
.wa-msg-row { display: flex; max-width: 82%; margin-bottom: 2px; }
.wa-msg-row.mine { align-self: flex-start; }
.wa-msg-row.theirs { align-self: flex-end; }
.wa-bubble {
  padding: 7px 10px 6px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.25);
  word-break: break-word;
  max-width: 100%;
}
.wa-msg-row.mine .wa-bubble { background: var(--wa-bubble-mine); border-top-right-radius: 2px; }
.wa-msg-row.theirs .wa-bubble { background: var(--wa-bubble-theirs); border-top-left-radius: 2px; }
.wa-bubble-text { white-space: pre-wrap; }
.wa-bubble-meta {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end; margin-top: 3px; float: left;
  margin-inline-start: 8px;
}
.wa-bubble-time { font-size: 10px; color: rgba(233,237,239,0.65); }
.wa-tick { font-size: 15px; color: var(--wa-muted); letter-spacing: -3px; }
.wa-tick.is-delivered { color: var(--wa-muted); }
.wa-tick.is-read { color: var(--wa-tick-read); }
.wa-edited-badge { font-size: 10px; color: rgba(233,237,239,0.55); font-style: italic; }

/* نقل‌قول */
.wa-quote {
  background: rgba(0,0,0,0.22);
  border-inline-start: 3px solid var(--wa-accent);
  border-radius: 4px;
  padding: 5px 8px;
  margin-bottom: 5px;
  font-size: 12px;
  cursor: pointer;
}
.wa-quote strong { display: block; color: var(--wa-accent); font-size: 11px; margin-bottom: 1px; }
.wa-quote p { color: rgba(233,237,239,0.8); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* فایل پیوست */
.wa-file-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.18);
  border-radius: 6px; padding: 8px 10px;
  margin-bottom: 4px; text-decoration: none; color: inherit;
}
.wa-file-icon { font-size: 26px; }
.wa-file-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.wa-file-size { font-size: 11px; opacity: 0.7; }

/* پیام صوتی */
.wa-voice { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.wa-voice audio { max-width: 200px; height: 32px; }

/* ری‌اکشن */
.wa-reactions { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.wa-reaction-chip {
  background: var(--wa-header);
  border: 1px solid #374045;
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--wa-text);
}
.wa-reaction-chip.mine { border-color: var(--wa-accent); }

/* اکشن‌های حباب */
.wa-bubble-actions {
  position: absolute;
  top: -30px;
  inset-inline-end: 0;
  display: none;
  background: var(--wa-header);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  padding: 2px;
  z-index: 10;
  white-space: nowrap;
}
.wa-msg-row:hover .wa-bubble-actions { display: flex; }
.wa-bubble-act {
  background: none; border: none; color: #aebac1;
  font-size: 15px; cursor: pointer; padding: 6px 8px;
  border-radius: 6px; line-height: 1;
}
.wa-bubble-act:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* پیام حذف‌شده */
.wa-deleted { font-style: italic; color: var(--wa-muted); font-size: 13px; }

/* نشانگر تایپ */
.wa-typing-row { align-self: flex-end; margin-bottom: 2px; }
.wa-typing-bubble {
  background: var(--wa-bubble-theirs);
  border-radius: 8px; padding: 10px 14px;
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--wa-muted);
}
.wa-typing-dots { display: inline-flex; gap: 3px; }
.wa-typing-dots span {
  width: 7px; height: 7px; background: var(--wa-muted);
  border-radius: 50%; display: inline-block;
  animation: waBounce 1.2s infinite;
}
.wa-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes waBounce { 0%,60%,100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- نوار ورودی ---------- */
.wa-chat-inputbar {
  background: var(--wa-header);
  padding: 8px 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.wa-input-box {
  flex: 1;
  background: var(--wa-input-bg);
  border-radius: 22px;
  display: flex;
  align-items: center;
  padding: 4px 6px 4px 14px;
  min-height: 44px;
}
.wa-input-box textarea {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--wa-text);
  font-size: 14px; font-family: inherit;
  resize: none; max-height: 110px;
  padding: 8px 4px;
  line-height: 1.5;
}
.wa-input-box textarea::placeholder { color: var(--wa-muted); }
.wa-input-icons { display: flex; align-items: center; gap: 2px; }
.wa-send-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--wa-accent); border: none;
  color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.wa-send-btn:active { transform: scale(0.92); }
.wa-send-btn:disabled { opacity: 0.5; cursor: default; }

/* پیش‌نمایش ریپلای/فایل */
.wa-reply-preview, .wa-file-preview {
  background: var(--wa-header);
  border-inline-start: 3px solid var(--wa-accent);
  padding: 6px 10px;
  margin: 0 10px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.wa-file-preview { border-inline-start-color: #53bdeb; }
.wa-preview-close { background: none; border: none; color: var(--wa-muted); cursor: pointer; font-size: 16px; }

/* پنل ایموجی */
.wa-emoji-panel {
  background: var(--wa-header);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid var(--wa-border);
}
.wa-emoji-panel button {
  background: none; border: none; font-size: 22px;
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.wa-emoji-panel button:hover { background: rgba(255,255,255,0.08); }

/* پنل ری‌اکشن سریع */
.wa-react-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  inset-inline-start: 0;
  background: var(--wa-header);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex; gap: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 20;
}
.wa-react-panel button {
  background: none; border: none; font-size: 24px;
  cursor: pointer; padding: 4px 6px; border-radius: 50%;
  transition: transform 0.1s;
}
.wa-react-panel button:hover { transform: scale(1.25); }

/* جستجو در گفتگو */
.wa-search-bar {
  background: var(--wa-header);
  padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--wa-border);
}
.wa-search-bar input {
  flex: 1; background: var(--wa-input-bg); border: none;
  border-radius: 8px; padding: 7px 12px;
  color: var(--wa-text); font-size: 13px; font-family: inherit; outline: none;
}
.wa-search-results {
  background: var(--wa-header);
  max-height: 180px; overflow-y: auto;
  border-bottom: 1px solid var(--wa-border);
  font-size: 13px;
}
.wa-search-item { padding: 8px 14px; cursor: pointer; border-bottom: 1px solid rgba(134,150,160,0.08); }
.wa-search-item:hover { background: var(--wa-input-bg); }
.wa-search-item mark { background: var(--wa-accent); color: #fff; border-radius: 2px; padding: 0 2px; }

/* حالت خالی */
.wa-empty-chat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--wa-muted); gap: 12px; padding: 40px;
  text-align: center;
}
.wa-empty-chat .big-icon { font-size: 64px; opacity: 0.4; }

/* ضبط صدا */
.wa-recording {
  display: flex; align-items: center; gap: 10px;
  flex: 1; color: #ff5b5b; font-size: 14px;
}
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5b5b; animation: waBlink 1s infinite; }
@keyframes waBlink { 50% { opacity: 0.3; } }

/* ---------- ریسپانسیو موبایل ---------- */
@media (max-width: 768px) {
  .wa-chat-wrap {
    border-radius: 0;
    border: none;
    height: calc(100vh - 140px);
    min-height: 480px;
    max-height: none;
  }
  .wa-sidebar { width: 100%; max-width: none; border-left: none; }
  .wa-chat-main { display: none; width: 100%; }
  /* وقتی چت باز است */
  .wa-chat-wrap.wa-chat-open .wa-sidebar { display: none; }
  .wa-chat-wrap.wa-chat-open .wa-chat-main { display: flex; }
  .wa-back-btn { display: inline-flex; }
  .wa-msg-row { max-width: 88%; }
  .wa-chat-body { padding: 10px 12px; }
}
