/* ============================================================
   ساب‌پنل سنایی — تم دارک، ریسپانسیو، RTL
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0e17;
  --bg2: #0d1220;
  --card: #111828;
  --card2: #16203449;
  --line: #1f2b44;
  --line2: #2a3a5c;
  --text: #e8ecf4;
  --muted: #8a94ab;
  --accent: #2dd4a7;
  --accent2: #4f8cff;
  --accent-grad: linear-gradient(135deg, #2dd4a7, #4f8cff);
  --danger: #f43f5e;
  --warn: #f5a524;
  --ok: #34d399;
  --info: #8b7cf6;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, #14263f55, transparent),
    radial-gradient(900px 420px at -10% 110%, #10332c55, transparent),
    var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
  min-height: 100vh;
}

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

.ic { vertical-align: -3px; flex: none; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .2px; }
.muted { color: var(--muted); font-weight: 400; }
.link { font-size: 13px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243350; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2e4168; }

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

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex: none;
  background: linear-gradient(180deg, #0e1526, #0b1120);
  border-inline-start: none;
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #06251d;
  border-radius: 12px;
  box-shadow: 0 6px 18px #2dd4a755;
}
.brand-mark.big { width: 56px; height: 56px; border-radius: 16px; }
.brand-txt strong { display: block; font-size: 16px; font-weight: 700; }
.brand-txt small { color: var(--muted); font-size: 11.5px; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: all .18s;
}
.nav-item:hover { background: #18233c; color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-grad);
  color: #06251d;
  font-weight: 700;
  box-shadow: 0 6px 16px #2dd4a744;
}

.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip strong { font-size: 13.5px; display: block; }
.user-chip small { color: var(--muted); font-size: 11.5px; }
.avatar {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #1c2a47;
  color: var(--accent);
  font-weight: 700;
  flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: #0c1220cc;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.page-title { font-size: 19px; font-weight: 700; flex: 1; }
.topbar-side { display: flex; align-items: center; gap: 10px; }
.chip-user { font-weight: 600; }

.content { padding: 24px 26px 60px; display: grid; gap: 20px; align-content: start; }

/* ============ اجزای عمومی ============ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 560px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.card-head h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 13px;
  box-shadow: var(--shadow);
}
.stat-ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  flex: none;
}
.c-teal { background: #2dd4a71f; color: #2dd4a7; }
.c-green { background: #34d3991f; color: #34d399; }
.c-orange { background: #f5a5241f; color: #f5a524; }
.c-indigo { background: #8b7cf61f; color: #8b7cf6; }
.c-blue { background: #4f8cff1f; color: #4f8cff; }
.c-pink { background: #f43f5e1f; color: #f43f5e; }
.stat strong { display: block; font-size: 19px; font-weight: 700; line-height: 1.3; }
.stat span { color: var(--muted); font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent-grad); color: #06251d; box-shadow: 0 6px 16px #2dd4a744; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: #18233c; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #1e2c49; }
.btn-danger { background: #f43f5e; color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  background: #18233c;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  flex: none;
}
.icon-btn:hover { color: var(--text); background: #22304f; }
.icon-btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #16223a;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 500;
}
.chip small { color: var(--muted); font-size: 10.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px;
  padding: 2.5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.b-ok { background: #34d39922; color: #34d399; }
.b-warn { background: #f5a52422; color: #f5a524; }
.b-danger { background: #f43f5e22; color: #f43f5e; }
.b-info { background: #8b7cf622; color: #8b7cf6; }
.b-muted { background: #8a94ab1c; color: var(--muted); }

.bar {
  height: 7px;
  background: #1a2540;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 5px;
  direction: ltr;
}
.bar.big { height: 10px; }
.bar span {
  display: block; height: 100%;
  background: var(--accent-grad);
  border-radius: 99px;
  transition: width .4s;
  min-width: 2px;
}
.bar span.hot { background: linear-gradient(135deg, #f5a524, #f43f5e); }
.bar span.inf { width: 100%; background: repeating-linear-gradient(45deg, #22314f, #22314f 6px, #1a2540 6px, #1a2540 12px); }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13.5px;
  border: 1px solid;
}
.alert .ic { margin-top: 4px; }
.alert-danger { background: #f43f5e14; border-color: #f43f5e44; color: #fda4b3; }
.alert-danger a { color: #fda4b3; text-decoration: underline; }
.alert-warn { background: #f5a52412; border-color: #f5a52444; color: #fcd28d; }
.alert-ok { background: #34d39912; border-color: #34d39944; color: #86efac; }

/* ============ فرم‌ها ============ */

.field { display: grid; gap: 6px; margin-bottom: 15px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: #b8c1d4; }
.field small.muted { font-size: 11px; }
.field input, .field select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 13px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border .18s, box-shadow .18s;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #2dd4a726;
}
.field input[readonly] { background: #0a0f1c; color: var(--accent); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.check-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 0;
  font-size: 13.5px;
  cursor: pointer;
  font-weight: 500;
}
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.check-inline {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border .15s;
}
.check-inline:hover { border-color: var(--line2); }
.check-inline input { accent-color: var(--accent); flex: none; }
.inbound-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 200px; overflow: auto; padding: 2px; }

.form-hint {
  display: flex; gap: 7px; align-items: center;
  background: #4f8cff10;
  border: 1px solid #4f8cff33;
  color: #a7c3f5;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
}
.err-txt { color: #f8718b; font-size: 12.5px; }

/* ============ صفحه ورود ============ */

.login-body { display: grid; place-items: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 420px; padding: 20px 0; }
.install-wrap { max-width: 640px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.install-card { padding: 28px 26px; }
.login-logo { text-align: center; margin-bottom: 24px; display: grid; gap: 6px; justify-items: center; }
.login-logo .brand-mark { margin: 0 auto 8px; }
.login-logo h1 { font-size: 21px; font-weight: 700; }
.login-logo p { color: var(--muted); font-size: 13px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.install-step { font-size: 15px; font-weight: 700; color: var(--accent); margin: 20px 0 12px; padding-top: 14px; border-top: 1px dashed var(--line2); }
.install-step:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }

.pass-wrap { position: relative; }
.pass-wrap input { padding-left: 42px; }
.pass-toggle {
  position: absolute;
  left: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: 0; color: var(--muted);
  cursor: pointer; padding: 6px;
}
.pass-toggle:hover { color: var(--text); }

.req-list { list-style: none; display: grid; gap: 7px; margin-bottom: 16px; }
.req-list li {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px;
}
.req-list li.ok { color: #86efac; }
.req-list li.fail { color: #f8718b; border-color: #f43f5e44; }
code { background: #1a2540; border-radius: 6px; padding: 1px 7px; font-size: 12px; direction: ltr; unicode-bidi: embed; }

/* ============ تولبار و جدول ============ */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tb-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tb-info { max-width: 640px; font-size: 12.5px; }
.tb-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--muted);
}
.search-box input {
  background: none; border: 0; outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 0;
  width: 190px;
}
.toolbar select {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.toolbar select:focus { border-color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #131c30; }
.table tbody tr:last-child td { border-bottom: 0; }
.th-actions { width: 1%; }
.td-actions { white-space: nowrap; width: 1%; }
.td-actions .icon-btn { margin-inline-start: 5px; }

.cell-user { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.u-cell { min-width: 0; }
.u-cell strong { font-size: 13.5px; display: block; word-break: break-all; }
.u-cell small { color: var(--muted); font-size: 11.5px; display: block; }
.online-dot {
  width: 8px; height: 8px;
  background: #3a4664;
  border-radius: 50%;
  flex: none;
  margin-inline-start: auto;
}
.online-dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.u-txt i { font-style: normal; color: var(--muted); font-size: 11px; }
.exp-date { display: block; font-size: 13px; }
.exp-left { display: block; font-size: 11px; color: var(--muted); }

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.auto-refresh { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.auto-refresh input { accent-color: var(--accent); }

.quota-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.quota-top.sm span { font-size: 12.5px; font-weight: 600; }
.quota-list { display: grid; gap: 14px; }
.quota-row .quota-top span { font-size: 13px; color: #b8c1d4; }

/* ============ نمودار ============ */

.chart {
  display: flex; align-items: flex-end; gap: 7px;
  height: 190px;
  padding-top: 26px;
}
.chart-col {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.chart-val { font-size: 10px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.chart-bar {
  width: 100%; max-width: 34px;
  flex: 1;
  background: #131c30;
  border-radius: 8px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.chart-bar span {
  display: block; width: 100%;
  background: var(--accent-grad);
  border-radius: 8px 8px 0 0;
  transition: height .5s;
  min-height: 2px;
}
.chart-day { font-size: 9.5px; color: var(--muted); white-space: nowrap; }

/* ============ مودال‌ها ============ */

.modal {
  position: fixed; inset: 0;
  background: #05070dcc;
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px #000a;
  animation: pop .22s ease;
}
.modal-sm { max-width: 400px; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-head h3 .ic { color: var(--accent); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
}
.modal-foot.no-border { border-top: 0; padding: 0; }
.confirm-msg { color: #b8c1d4; font-size: 14px; }

.qr-wrap { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 14px; width: fit-content; margin: 0 auto 16px; }
.qr-wrap img, .qr-wrap canvas { display: block; border-radius: 6px; }
.qr-empty { color: #333; font-size: 12px; padding: 40px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; font-size: 12.5px !important; }

.direct-link {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  margin-bottom: 9px;
  font-size: 12px;
}
.direct-link .dl-label { font-weight: 700; color: var(--accent); flex: none; }
.direct-link .dl-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; color: var(--muted); }
.share-row { display: flex; gap: 9px; margin-top: 13px; }

/* ============ توست ============ */

.toasts {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 200;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 13px;
  padding: 12px 15px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: slide-in .25s ease;
}
@keyframes slide-in { from { transform: translateX(-16px); opacity: 0; } }
.toast.t-ok { border-color: #34d39966; } .toast.t-ok .ic { color: var(--ok); }
.toast.t-err { border-color: #f43f5e66; } .toast.t-err .ic { color: var(--danger); }
.toast.t-info .ic { color: var(--accent2); }

/* ============ اجزای خاص ============ */

.quick-actions { display: grid; gap: 11px; }
.qa {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  transition: all .18s;
  color: var(--text);
}
.qa:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.qa-ic {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: #2dd4a714;
  color: var(--accent);
  border-radius: 12px;
  flex: none;
}
.qa strong { display: block; font-size: 14px; }
.qa small { color: var(--muted); font-size: 12px; }

.act-list { list-style: none; display: grid; gap: 4px; }
.act-list li {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
}
.act-list li:last-child { border-bottom: 0; }
.act-ic {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: #16223a; color: var(--accent2);
  border-radius: 9px;
  flex: none;
}
.act-body { flex: 1; min-width: 0; }
.act-body strong { font-size: 13px; display: block; }
.act-body small { color: var(--muted); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-list time { color: var(--muted); font-size: 11px; flex: none; }

.panel-status { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 13px; }
.panel-status.ok { background: #34d39910; border: 1px solid #34d39944; color: #86efac; }
.panel-status.fail { background: #f43f5e10; border: 1px solid #f43f5e44; color: #f8718b; }
.panel-status strong { display: block; font-size: 14px; color: var(--text); }
.panel-status small { color: var(--muted); font-size: 12px; }
.inbound-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

.empty, .empty-state { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 46px 16px; }
.empty-state .ic { color: #22314f; }
.empty-state h3 { color: var(--text); font-size: 16.5px; }
.empty-state p { font-size: 13px; max-width: 380px; }
.empty-state .btn { margin-top: 8px; }

.help-list { list-style: none; display: grid; gap: 11px; font-size: 13.5px; color: #b8c1d4; }
.help-list li { padding-inline-start: 4px; }
.test-result { margin-top: 12px; font-size: 13px; }
.test-result .ok { color: #86efac; }
.test-result .fail { color: #f8718b; }

/* ============ ریسپانسیو ============ */

.only-mobile { display: none !important; }

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    transform: translateX(-105%);
    transition: transform .28s ease;
    box-shadow: 0 0 40px #000a;
  }
  /* در RTL سایدبار سمت راست است و به راست پنهان می‌شود */
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  [dir="rtl"] .sidebar.open,
  .sidebar.open { transform: translateX(0); }
  .overlay {
    position: fixed; inset: 0;
    background: #05070daa;
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .overlay.show { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-grid !important; }
  .chip-user.only-desktop { display: none; }
  .content { padding: 16px 14px 70px; }
  .topbar { padding: 12px 14px; }
  .page-title { font-size: 16.5px; }
  .only-desktop-inline { display: none; }
}

@media (max-width: 760px) {
  /* جدول به کارت تبدیل می‌شود */
  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 6px 4px;
  }
  .table td {
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
  }
  .table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    flex: none;
  }
  .table td.td-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table td.td-actions::before { content: 'عملیات:'; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .table td .cell-user { flex: 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .inbound-checks { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 13px; }
  .stat strong { font-size: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tb-actions { justify-content: flex-end; }
  .search-box input { width: 100%; }
  .search-box { flex: 1; }
  .tb-filters { width: 100%; }
  .tb-filters > * { flex: 1; min-width: 0; }
  .modal { padding: 16px 10px; }
  .modal-foot { flex-wrap: wrap; }
  .chart { gap: 4px; }
  .chart-day { font-size: 8.5px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .brand-txt small { display: none; }
  .login-card { padding: 26px 18px; }
}

/* چاپ */
@media print {
  .sidebar, .topbar, .toolbar, .toasts, .td-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat { border-color: #ddd; box-shadow: none; }
}
