/* EIS 2030 — پوسته‌ی هم‌خانواده‌ی 2030Flow / Office2030 */
@font-face { font-family: Vazirmatn; src: url(/fonts/vazirmatn-var.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F3F2EF; --surface: #FFFFFF; --surface-2: #F9F8F5; --lane: #EEECE6; --line: #E6E2DA; --line-strong: #D3CDC1;
  --ink: #1E2433; --ink-2: #3B4252; --muted: #6E7180;
  --brand: #2D3C5A; --brand-ink: #FFFFFF; --brand-soft: #E7EBF3;
  --gold: #99753E; --gold-soft: #F4ECDD; --gold-ink: #7A5A28;
  --ok: #16865A; --ok-soft: #E3F4EC; --warn: #B86E00; --warn-soft: #FCF0DC; --danger: #C2364B; --danger-soft: #FBE7EA; --info: #2D6CC0; --info-soft: #E5EEFA;
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(30, 36, 51, .06), 0 1px 1px rgba(30, 36, 51, .04);
  --sh-2: 0 10px 30px -12px rgba(30, 36, 51, .25), 0 2px 6px rgba(30, 36, 51, .06);
  --side-w: 264px; --top-h: 58px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11151E; --surface: #181D29; --surface-2: #1D2331; --lane: #151A25; --line: #2A3142; --line-strong: #3A4258;
  --ink: #E9EBF1; --ink-2: #C6CAD6; --muted: #8E94A8;
  --brand: #98AACF; --brand-ink: #11151E; --brand-soft: #232C42;
  --gold: #C9A266; --gold-soft: #33291B; --gold-ink: #D9B57A;
  --ok: #4CC38A; --ok-soft: #173326; --warn: #E3A33B; --warn-soft: #362A15; --danger: #F07085; --danger-soft: #3A1C23; --info: #7FAEF0; --info-soft: #1B2840;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3); --sh-2: 0 14px 34px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.35; font-weight: 800; }
h1 { font-size: 22px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .6em; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
code { background: var(--lane); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--muted); } .xs { font-size: 12px; } .center { text-align: center; } .d-block { display: block; } .nowrap { white-space: nowrap; }
.danger-t { color: var(--danger); } .warn-t { color: var(--warn); } .ok-t { color: var(--ok); }
.row { display: flex; align-items: center; } .row.gap { gap: 8px; } .row.between { justify-content: space-between; gap: 10px; } .row.end { justify-content: flex-end; margin-bottom: 10px; } .row.wrap { flex-wrap: wrap; } .center-y { align-items: center; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.flip { transform: scaleX(-1); }
.xs-ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--info); }

/* ---------- دکمه‌ها و فرم ---------- */
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-m); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 650; cursor: pointer; transition: .15s; white-space: nowrap; text-decoration: none !important; min-height: 38px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--brand-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover, .btn.ghost.on { background: var(--brand-soft); color: var(--brand); }
.btn.danger.ghost { color: var(--danger); background: transparent; border-color: transparent; }
.btn.danger.ghost:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; border-radius: 10px; }
.btn.xs { padding: 2px 8px; min-height: 24px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 12px 18px; font-size: 15px; min-height: 48px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.busy, .icon-btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after, .icon-btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: rot .8s linear infinite; }
.btn.primary.busy::after { border-color: #fff transparent #fff transparent; }
.spin .ic { animation: rot .9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.icon-btn { font: inherit; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--lane); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; } .icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.xs { width: 22px; height: 22px; vertical-align: middle; } .icon-btn.xs .ic { width: 13px; height: 13px; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link-btn .ic { width: 15px; height: 15px; }

input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; width: 100%; min-height: 40px; transition: .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 40px; }
textarea { resize: vertical; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fld > span, .lbl { font-size: 13px; font-weight: 650; color: var(--ink-2); display: block; margin-bottom: 4px; }
.fld small { color: var(--muted); font-size: 12px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; padding: 4px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
.grid2 .span2 { grid-column: 1 / -1; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.card-chk { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.search { width: 260px; max-width: 100%; }
.page-head .row > select, .page-head .row > input:not(.search) { width: auto; }
.w-auto { width: 160px; }
.copy-row { display: flex; gap: 6px; } .copy-row input { font-family: ui-monospace, monospace; font-size: 12px; }
.seg { display: inline-flex; background: var(--lane); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font: inherit; border: 0; background: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg.sm button { padding: 3px 9px; font-size: 12px; }

/* ---------- برچسب، آواتار، آیکن برنامه ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; font-weight: 650; padding: 1px 9px; border-radius: 999px; background: var(--lane); color: var(--ink-2); white-space: nowrap; line-height: 20px; text-decoration: none !important; }
.pill[style*="--pc"] { background: color-mix(in srgb, var(--pc) 14%, transparent); color: var(--pc); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.danger { background: var(--danger-soft); color: var(--danger); } .pill.info { background: var(--info-soft); color: var(--info); } .pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill .ic { width: 12px; height: 12px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 750; font-size: 13px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.lg { width: 44px; height: 44px; font-size: 16px; } .avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.app-ic { --c: #2D3C5A; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 6px -2px color-mix(in srgb, var(--c) 60%, transparent); }
.app-ic .ic { width: 19px; height: 19px; stroke-width: 1.9; }
.app-ic.xs { width: 20px; height: 20px; border-radius: 6px; } .app-ic.xs .ic { width: 12px; height: 12px; }
.app-ic.sm { width: 28px; height: 28px; border-radius: 9px; } .app-ic.sm .ic { width: 15px; height: 15px; }
.app-ic.lg { width: 50px; height: 50px; border-radius: 15px; } .app-ic.lg .ic { width: 25px; height: 25px; }
.t-logo { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-ink); font-weight: 850; flex: none; }
.t-logo.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #34466A, #1F2A42); color: #D9B57A; font-weight: 900; letter-spacing: .5px; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(217,181,122,.35); font-family: system-ui, sans-serif; }
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 19px; }
.count { font-style: normal; font-size: 11px; font-weight: 750; background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 19px; margin-inline-start: auto; }
.count.big { background: var(--brand-soft); color: var(--brand); font-size: 12px; line-height: 22px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex: none; }
.dot.danger { background: var(--danger); }

/* ---------- ورود ---------- */
.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 22px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: rot .8s linear infinite; }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { background: linear-gradient(150deg, #34466A 0%, #1F2A42 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; inset-inline-end: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 40px solid rgba(201, 162, 102, .16); }
.auth-art h1 { font-size: 30px; max-width: 520px; margin: 26px 0 8px; position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; gap: 10px; font-size: 16px; position: relative; z-index: 1; }
.auth-feats { display: grid; gap: 10px; margin: 26px 0; max-width: 500px; position: relative; z-index: 1; }
.auth-feats div { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.08); border-radius: 12px; padding: 11px 13px; font-size: 14px; }
.auth-feats .ic { color: #D9B57A; }
.auth-apps { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.auth-apps span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.07); color: #D9B57A; }
.auth-box { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; }
.auth-card .back { margin-bottom: 14px; }
.otp { font-size: 22px !important; letter-spacing: 10px; text-align: center; font-weight: 750; }
.resend { margin-top: 12px; font-size: 13px; text-align: center; }
#pwLogin { margin-top: 18px; color: var(--muted); font-weight: 500; font-size: 13px; }
.onboard { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 80% 0%, var(--gold-soft), transparent 50%), var(--bg); }
.onboard-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px; max-width: 520px; width: 100%; box-shadow: var(--sh-2); text-align: center; }
.onboard-card form { text-align: start; margin-top: 18px; }
.onboard-card > .link-btn { margin-top: 16px; color: var(--muted); }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kind-pick label { cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; }
.kind-pick span { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 16px 10px; border: 1.5px solid var(--line); border-radius: var(--r-l); transition: .15s; }
.kind-pick span .ic { width: 26px; height: 26px; color: var(--muted); }
.kind-pick small { color: var(--muted); font-size: 12px; }
.kind-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.kind-pick input:checked + span .ic { color: var(--brand); }

/* ---------- شِل ---------- */
#shell { display: flex; min-height: 100vh; }
#side { width: var(--side-w); flex: none; background: var(--surface); border-inline-start: 0; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side-head { padding: 10px; border-bottom: 1px solid var(--line); }
.tenant-btn { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: var(--r-m); border: 0; background: none; color: var(--ink); cursor: pointer; text-align: start; }
.tenant-btn:hover { background: var(--lane); }
.t-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.4; }
.t-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-txt small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; text-decoration: none !important; margin-bottom: 1px; position: relative; }
.nav-item:hover { background: var(--lane); color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); }
.nav-item.app.open::before { content: ""; position: absolute; inset-inline-start: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav-item > span:not(.app-ic) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sep { font-size: 11.5px; font-weight: 750; color: var(--muted); margin: 14px 10px 6px; }
.side-empty { color: var(--muted); font-size: 12px; padding: 4px 10px; }
.side-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
#top { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 13px; text-decoration: none !important; white-space: nowrap; border: 1px solid transparent; }
.tab:hover { background: var(--lane); }
.tab.on { background: var(--surface); border-color: var(--line); box-shadow: var(--sh-1); color: var(--ink); }
.tab-x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.tab-x:hover { background: var(--danger-soft); color: var(--danger); }
.tab-x .ic { width: 12px; height: 12px; }
.search-btn { font: inherit; display: flex; align-items: center; gap: 8px; margin-inline-start: auto; min-width: 220px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.search-btn span { flex: 1; text-align: start; font-size: 13px; }
.search-btn kbd { font: 11px ui-monospace, monospace; background: var(--lane); border-radius: 6px; padding: 1px 6px; direction: ltr; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.badge { position: absolute; top: 3px; inset-inline-end: 3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.user-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
#view { flex: 1; overflow-y: auto; outline: none; }
#frames { flex: 1; min-height: 0; position: relative; }
.frame { position: absolute; inset: 0; display: flex; flex-direction: column; }
.frame[hidden] { display: none; }
.frame-bar { height: 38px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.fb-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.fb-path { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-actions { display: flex; gap: 2px; }
.frame-body { flex: 1; position: relative; background: var(--surface); }
.frame-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.frame-loading, .frame-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; background: var(--surface); z-index: 2; }
.frame-loading p { margin: 0; }
#scrim, #bnav, .only-m { display: none; }

/* ---------- صفحه ---------- */
.page { padding: 22px 26px 60px; max-width: 1360px; margin: 0 auto; }
.narrow-page { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.sec-t { margin: 24px 0 12px; font-size: 15px; color: var(--ink-2); }
.mt { margin-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; margin-bottom: 16px; box-shadow: var(--sh-1); }
.card.narrow { max-width: 420px; text-align: center; }
.table-card { padding: 0; overflow-x: auto; }
.list-card { padding: 6px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.grid-2-1 > .card { margin-bottom: 0; }
.grid-2-1 + * { margin-top: 16px; }
.note { display: flex; align-items: flex-start; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; flex-wrap: wrap; }
.note .ic { margin-top: 2px; color: var(--gold); }
.note.warn { background: var(--warn-soft); border-color: transparent; } .note.danger { background: var(--danger-soft); border-color: transparent; } .note.info { background: var(--info-soft); border-color: transparent; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 10px; color: var(--muted); text-align: center; }
.empty .ic { width: 30px; height: 30px; opacity: .55; }
.empty p { margin: 0; }
.empty.big { padding: 50px 10px; }
.skel { height: 74px; border-radius: var(--r-l); background: linear-gradient(90deg, var(--lane), var(--surface-2), var(--lane)); background-size: 300% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -6px 0 20px; scrollbar-width: none; }
.subtabs a { display: flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--muted); font-weight: 650; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.subtabs a:hover { color: var(--ink); }
.subtabs a.on { color: var(--brand); border-color: var(--brand); }
.subtabs .ic { width: 16px; height: 16px; }
.subtabs.light { margin-top: 0; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.li:last-child { border-bottom: 0; }
.li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.li small { color: var(--muted); font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv span { color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--lane); overflow: hidden; margin: 4px 0 6px; }
.meter i { display: block; height: 100%; background: var(--pc, var(--brand)); border-radius: 6px; }

/* جدول */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; font-weight: 700; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl tr.dim td { opacity: .55; }
.t-end { text-align: end; }
.matrix th { vertical-align: bottom; } .matrix th span { display: block; font-size: 11px; margin-top: 3px; max-width: 80px; white-space: normal; line-height: 1.3; }
.matrix select { min-height: 32px; padding: 3px 6px; font-size: 12px; width: auto; min-width: 84px; }
.matrix td, .matrix th { padding: 8px 6px; }
.lvl-none { color: var(--danger); } .lvl-view { color: var(--info); } .lvl-use { color: var(--ok); } .lvl-admin { color: var(--gold-ink); font-weight: 700; } .lvl-inherit { color: var(--muted); }
.perm-cell { min-width: 150px; } .perm-cell .chk { display: flex; font-size: 12px; padding: 1px 0; white-space: nowrap; }

/* ---------- داشبورد ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head h1 { font-size: 24px; margin-bottom: 2px; }
.dash-head p { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--r-l); background: var(--info-soft); margin-bottom: 12px; }
.banner > .ic { margin-top: 3px; color: var(--info); }
.banner > div { flex: 1; } .banner p { margin: 2px 0 0; font-size: 13px; }
.banner.ok { background: var(--ok-soft); } .banner.ok > .ic { color: var(--ok); }
.banner.warn { background: var(--warn-soft); } .banner.warn > .ic { color: var(--warn); }
.banner.danger { background: var(--danger-soft); } .banner.danger > .ic { color: var(--danger); }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 8px; scrollbar-width: thin; }
.qapp { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 96px; flex: none; padding: 12px 6px 10px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 12.5px; font-weight: 650; position: relative; transition: .15s; }
.qapp:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: transparent; color: var(--ink); }
.qapp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.qapp.locked { opacity: .55; filter: grayscale(.6); }
.qapp .lock { position: absolute; top: 8px; inset-inline-end: 8px; color: var(--muted); }
.qapp .lock .ic { width: 14px; height: 14px; }
.qapp .dot { position: absolute; top: 10px; inset-inline-end: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { font: inherit; text-align: start; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; position: relative; overflow: hidden; box-shadow: var(--sh-1); transition: .15s; }
.stat:hover { box-shadow: var(--sh-2); }
.stat::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--c, var(--line-strong)); }
.stat-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.stat-top .ic { width: 15px; height: 15px; }
.stat-val { font-size: 25px; font-weight: 850; line-height: 1.25; letter-spacing: -.3px; }
.stat-val small { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-sub { color: var(--muted); font-size: 12px; }
.stat.ok .stat-val { color: var(--ok); } .stat.warn .stat-val { color: var(--warn); } .stat.danger .stat-val { color: var(--danger); } .stat.info .stat-val { color: var(--info); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.wcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); overflow: hidden; position: relative; }
.wcard header { display: flex; align-items: center; gap: 10px; padding: 13px 14px 10px; }
.wc-t { flex: 1; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.wc-t small { color: var(--muted); font-size: 11.5px; }
.wcard footer { border-top: 1px solid var(--line); padding: 9px 14px; display: flex; justify-content: flex-end; }
.wcard footer .ic { transform: scaleX(1); }
.wlist { list-style: none; margin: 0; padding: 0 6px 6px; }
.witem { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border-radius: 10px; border: 0; background: none; text-align: start; color: var(--ink); cursor: pointer; }
.witem:hover { background: var(--surface-2); }
.wi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.wi-main b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.witem.unread b { font-weight: 800; }
.w-empty { color: var(--muted); font-size: 13px; padding: 4px 16px 16px; margin: 0; }
.bars { padding: 2px 14px 14px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); } .bl em { font-style: normal; color: var(--muted); font-size: 11px; }
.bt { height: 8px; background: var(--lane); border-radius: 8px; overflow: hidden; }
.bt i { display: block; height: 100%; background: var(--c, var(--brand)); border-radius: 8px; }
.bv { font-weight: 700; font-size: 12px; min-width: 56px; text-align: end; }
.prog { display: flex; align-items: center; gap: 14px; padding: 4px 16px 16px; }
.ring { --v: 0; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--lane) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; }
.probs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 16px; }
.prob { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-m); background: var(--surface-2); }
.prob > div { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.prob small { color: var(--muted); font-size: 12px; }
.editing { outline: 2px dashed var(--line-strong); outline-offset: 2px; }
.editing.is-hidden { opacity: .4; }
.edit-tools { display: flex; gap: 2px; }
.stat .edit-tools { position: absolute; top: 6px; inset-inline-end: 6px; background: var(--surface); border-radius: 8px; }

/* برنامه‌ها */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app-card { font: inherit; display: flex; gap: 14px; align-items: flex-start; text-align: start; padding: 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: .15s; box-shadow: var(--sh-1); }
.app-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.app-card p { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.app-card.locked { opacity: .65; } .app-card.locked .app-ic { filter: grayscale(.7); }
.locked-card { text-align: center; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upsell { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* سازمان */
.plan-card { border-top: 4px solid var(--pc); }
.plan-card h2 { color: var(--pc); }
.mod-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.mod-chip.on { color: var(--ink); }
.mod-chip > .ic { width: 14px; height: 14px; } .mod-chip.on > .ic { color: var(--ok); }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; border-top: 4px solid var(--pc); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-1); }
.plan.current { box-shadow: 0 0 0 2px var(--pc), var(--sh-2); }
.plan.dim { opacity: .55; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 16px; }
.plan p { margin: 0; font-size: 12.5px; }
.price { font-size: 18px; font-weight: 850; color: var(--pc); }
.price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.plan li { display: flex; gap: 6px; align-items: center; } .plan li .ic { width: 14px; height: 14px; color: var(--ok); }
.plan-mods { display: flex; flex-wrap: wrap; gap: 4px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.conn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh-1); border-top: 3px solid var(--c); }
.conn.dim { opacity: .55; }
.conn small { line-height: 1.5; }

/* ---------- پنجره، منوی بازشو، پیام ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(17, 21, 30, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal-back.out { opacity: 0; transition: .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--sh-2); animation: pop .18s; }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 8px 18px 6px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; flex-wrap: wrap; }
.modal-foot .danger.ghost { margin-inline-end: auto; }
.palette-modal .modal { max-width: 560px; align-self: start; margin-top: 10vh; }
.palette-modal .modal-head { display: none; }
.palette-modal .modal-body { padding: 10px; }
.pal-in { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pal-in input { border: 0; box-shadow: none !important; font-size: 15px; padding-inline: 0; }
.pal-list { max-height: 60vh; overflow-y: auto; }
.pal-item { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; color: var(--ink); text-align: start; cursor: pointer; }
.pal-item span { display: flex; flex-direction: column; line-height: 1.4; }
.pal-item small { color: var(--muted); font-size: 12px; }
.pal-item.on, .pal-item:hover { background: var(--brand-soft); }
.pal-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--lane); color: var(--ink-2); }
.popover { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-2); min-width: 240px; padding: 6px; animation: pop .14s; }
.popover.bell { width: 380px; max-width: calc(100vw - 16px); padding: 0; }
.pop-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-head div { display: flex; flex-direction: column; line-height: 1.4; } .pop-head small { color: var(--muted); }
.pop-item { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; color: var(--ink); cursor: pointer; text-align: start; text-decoration: none !important; }
.pop-item:hover { background: var(--lane); }
.pop-item.on { background: var(--brand-soft); }
.pop-item > span { flex: 1; display: flex; flex-direction: column; line-height: 1.35; } .pop-item small { color: var(--muted); font-size: 11.5px; }
.pop-item.danger { color: var(--danger); }
.pop-label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; }
.pop-label.row { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line); font-weight: 650; }
.bell-list { max-height: 420px; overflow-y: auto; padding: 4px; }
.notif { font: inherit; display: flex; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; text-align: start; color: var(--ink); cursor: pointer; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--info-soft); }
.n-txt { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; flex: 1; }
.n-txt small { color: var(--ink-2); font-size: 12.5px; }
.n-txt em { font-style: normal; color: var(--muted); font-size: 11.5px; }
#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
[dir=rtl] #toasts { transform: translateX(50%); }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--sh-2); font-weight: 600; font-size: 13.5px; max-width: min(520px, calc(100vw - 32px)); animation: pop .2s; pointer-events: auto; }
.toast.ok .ic { color: #4CC38A; } .toast.danger .ic { color: #F07085; } .toast.warn .ic { color: #E3A33B; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }

/* ---------- حالت embed و Mini App ---------- */
body.mode-embed #side, body.mode-embed .search-btn, body.mode-embed #tabs, body.mode-embed #bnav { display: none !important; }
body.mode-embed #main { height: auto; min-height: 100vh; }
body.mode-embed #top { display: none; }
body.mode-embed #view { overflow: visible; }
body.mode-embed .page { padding: 14px; }
body.mode-embed .dash-head h1 { font-size: 19px; }
body.mode-miniapp .search-btn kbd { display: none; }

/* ---------- موبایل ---------- */
@media (max-width: 1100px) { .grid-2-1 { grid-template-columns: 1fr; } .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; } }
@media (max-width: 900px) {
  .only-m { display: inline-grid; }
  #side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .22s; box-shadow: var(--sh-2); }
  body.side-open #side { transform: none; }
  body.side-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  #top { padding: 0 8px; gap: 6px; }
  .tab span { display: none; } .tab { padding: 5px; }
  #main { height: 100dvh; }
  #view { padding-bottom: 70px; }
  #frames { margin-bottom: 62px; }
  #bnav { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  #bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: none !important; position: relative; }
  #bnav a.on { color: var(--brand); }
  #bnav .ic { width: 22px; height: 22px; }
  #bnav .badge { top: 0; inset-inline-end: calc(50% - 20px); }
  .page { padding: 16px 14px 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; } .auth-art h1 { font-size: 21px; margin-top: 16px; } .auth-feats, .auth-apps { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .wgrid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px; } .stat-val { font-size: 20px; }
  .hide-s { display: none; }
  .search { width: 100%; }
  .page-head .row { width: 100%; }
  .qapp { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
