@font-face { font-family: "SchoolFont"; src: url("../font.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn.woff2") format("woff2-variations"), url("fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff; --ink: #0b0b0b; --ink-2: #2a2a2a; --muted: #6f6f6f; --line: #e7e7e7; --soft: #f5f5f5; --soft-2: #fafafa;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px -18px rgba(0,0,0,.18);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.8 "SchoolFont", "Vazirmatn", Tahoma, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
h1, h2, h3 { margin: 0; line-height: 1.45; font-weight: 800; }
h2 { font-size: 1.05rem; } h3 { font-size: 1rem; }
p { margin: 0; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); } .block { display: block; } .center { text-align: center; } .strong { font-weight: 700; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
[dir="ltr"] { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }

/* نوار بالا */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-t { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-t strong { font-size: .98rem; }
.brand-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.mark { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.mark-ic { display: grid; place-items: center; width: 100%; height: 100%; }
.mark-img { display: none; width: 100%; height: 100%; object-fit: contain; }
.mark.has-logo { background: #fff; border: 1px solid var(--line); padding: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.mark.has-logo .mark-ic { display: none; }
.mark.has-logo .mark-img { display: block; border-radius: 9px; }
.mark.lg.has-logo { width: 92px; height: 92px; border-radius: 26px; padding: 8px; }
.mark.lg.has-logo .mark-img { border-radius: 18px; }
.mark.lg { width: 60px; height: 60px; border-radius: 18px; } .mark.lg .ic { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav a .ic { width: 18px; height: 18px; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a.on { background: var(--ink); color: #fff; }
.me { position: relative; margin-inline-start: auto; }
.me summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 4px 4px 12px; border-radius: 999px; border: 1px solid var(--line); }
.me summary::-webkit-details-marker { display: none; }
.me summary:hover { background: var(--soft-2); }
.me-t { display: flex; flex-direction: column; line-height: 1.3; }
.me-t strong { font-size: .85rem; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t small { color: var(--muted); font-size: .75rem; }
.menu { position: absolute; left: 0; top: calc(100% + 8px); width: 260px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu-head { display: flex; flex-direction: column; padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; line-height: 1.5; }
.menu-head small { color: var(--muted); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); cursor: pointer; text-align: right; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.menu form { margin: 0; }
.menu .ic { width: 18px; height: 18px; }
.avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.page-title { font-size: 1.45rem; }

/* خوش‌آمد */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h1 { font-size: 1.6rem; }
.pulse { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.pulse.tick i { animation: ping .9s ease-out; }
.pulse.off i { background: #b5b5b5; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.45); } 100% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } }

/* آمار */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; }
.stat strong { font-size: 1.7rem; line-height: 1.2; font-weight: 800; }
.stat span { color: var(--muted); font-size: .85rem; }
.stats.mini .stat { padding: 12px 14px; } .stats.mini .stat strong { font-size: 1.3rem; }

/* کارت کلاس */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.ccard { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.cards .ccard.is-live { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.ccard-top { display: flex; align-items: flex-start; gap: 12px; }
.ccard-t { flex: 1; min-width: 0; }
.ccard-t h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-t p { color: var(--muted); font-size: .88rem; }
.cic { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft-2); display: grid; place-items: center; flex: none; }
.cic.lg { width: 58px; height: 58px; border-radius: 18px; } .cic.lg .ic { width: 26px; height: 26px; }
.is-live .cic { background: var(--ink); color: #fff; border-color: var(--ink); }
.meta { margin: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .86rem; }
.meta div { display: flex; align-items: center; gap: 8px; }
.meta dt .ic { width: 17px; height: 17px; }
.meta dd { margin: 0; }
.ccard-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; align-items: center; }
.ccard-act > div { display: flex; gap: 8px; flex-wrap: wrap; }
.ccard-act form { margin: 0; }
.ccard-act .grow { flex: 1; } .ccard-act .grow form { flex: 1; }

/* نمایش بر اساس وضعیت زنده */
[data-class-id]:not(.is-live) .live-on { display: none !important; }
[data-class-id].is-live .live-off { display: none !important; }
.ccard.just-live { animation: glow 1.4s ease-out 2; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 14px rgba(0,0,0,0); } }

.waiting { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: var(--r-md); background: var(--soft); color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.hero { padding: 20px; }
.hero .ccard { border: 0; padding: 0; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero.is-live { border-color: var(--ink); }
.hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-act form { margin: 0; }

/* برنامه هفته */
.board { display: flex; flex-direction: column; gap: 28px; }
.sec-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.program { display: flex; flex-direction: column; gap: 14px; }
.pday { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pday h3 { font-size: .95rem; padding: 12px 18px; background: var(--soft-2); border-bottom: 1px solid var(--line); }
.pday h3 small { font-weight: 500; margin-inline-start: 6px; }
.pday ul { list-style: none; margin: 0; padding: 0; }
.sitem { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.sitem:last-child { border-bottom: 0; }
.sitem.is-live { background: #fff; box-shadow: inset -4px 0 0 var(--ink); }
.sitem.is-past { opacity: .5; }
.stime { font-weight: 800; font-size: .95rem; text-align: right; font-family: inherit; }
.stitle { display: flex; flex-direction: column; line-height: 1.45; text-decoration: none; min-width: 0; }
.stitle strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge.soon { background: var(--ink); color: #fff; border-color: var(--ink); }

/* زمان‌بندی */
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rules li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.rules form { margin: 0; }
.rule-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; flex: none; }
.rule-ic .ic { width: 18px; height: 18px; }
.rule-t { flex: 1; font-size: .9rem; line-height: 1.7; }
.sub-card { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.sub-card h3 { font-size: .95rem; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; align-self: flex-start; }
.seg label { cursor: pointer; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.seg span { display: block; padding: 7px 18px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.time { display: flex; align-items: center; gap: 6px; }
.time select { width: auto; min-width: 78px; text-align: center; font-weight: 700; }
.time b { font-weight: 800; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.inline-check input { width: 16px; height: 16px; min-height: 0; accent-color: #000; }

/* تقویم شمسی */
.jdp { position: relative; }
.jdp-btn { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #d9d9d9; border-radius: var(--r-md); background: #fff; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: right; }
.jdp-btn:hover { border-color: var(--ink); }
.jdp-btn:disabled { color: #a3a3a3; background: var(--soft-2); cursor: not-allowed; }
.jdp-btn .ic { width: 18px; height: 18px; color: var(--muted); }
.jdp-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); padding: 12px; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head strong { font-size: .95rem; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-grid .wd { font-size: .72rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.jdp-grid button { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.jdp-grid button:hover { background: var(--soft); }
.jdp-grid button.today { box-shadow: inset 0 0 0 1px var(--ink); }
.jdp-grid button.sel { background: var(--ink); color: #fff; }
.jdp-grid button.fri { color: var(--muted); }
.jdp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* ===== صفحه کلاس ===== */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; }
.back:hover { color: var(--ink); }
.back .ic { width: 16px; height: 16px; }
.chero { border: 1px solid var(--line); border-radius: 24px; padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 18px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.chero.is-live { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.chero-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.chero-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.chero-status { display: flex; }
.chero h1 { font-size: 1.9rem; line-height: 1.35; letter-spacing: -.3px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.facts li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.facts li > span:last-child { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.facts small { color: var(--muted); font-size: .76rem; }
.facts b { font-weight: 700; font-size: .92rem; }
.fact-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; }
.fact-ic .ic { width: 18px; height: 18px; }
.chero-act { display: flex; gap: 10px; flex-wrap: wrap; }
.chero-act form { margin: 0; }
.chero-act .btn.lg { min-width: 170px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-top: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a .ic { width: 18px; height: 18px; }
.tabs a small { background: var(--soft); border-radius: 999px; padding: 0 8px; font-size: .75rem; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.js-tabs .panel:not(.on) { display: none; }
.panel { padding-top: 6px; display: flex; flex-direction: column; gap: 16px; }

.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.pcol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.phead h2 { font-size: 1rem; }
.soft-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--soft-2); border: 1px dashed #d6d6d6; color: var(--ink-2); font-size: .9rem; }
.soft-empty .ic { width: 22px; height: 22px; flex: none; color: var(--muted); }

.sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sess { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; }
.sess.today { border-color: var(--ink); }
.sess.is-past { opacity: .45; }
.datebox { width: 52px; height: 52px; border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; flex: none; }
.sess.today .datebox { background: var(--ink); color: #fff; }
.datebox b { font-size: 1.15rem; font-weight: 800; }
.datebox small { font-size: .68rem; opacity: .8; }
.sess-t { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.sess-t small { color: var(--muted); }

.rules li.ended { opacity: .5; }
.rule-t { display: flex; flex-direction: column; line-height: 1.55; }
.rule-t small { color: var(--muted); font-size: .82rem; }

.adder { border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.adder summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 700; }
.adder summary::-webkit-details-marker { display: none; }
.adder-ic { width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; transition: transform .2s; }
.adder-ic .ic { width: 16px; height: 16px; }
.adder[open] .adder-ic { transform: rotate(45deg); }
.adder[open] summary { border-bottom: 1px solid var(--line); }

.sched-form { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 16px; margin: 0; }
.seg.full { display: flex; width: 100%; }
.seg.full label { flex: 1; }
.seg.full span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; }
.seg span .ic { width: 16px; height: 16px; }
.seg.small span { padding: 5px 12px; font-size: .82rem; }
.sf-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; }
.sf-label { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { position: relative; cursor: pointer; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.day span { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #d4d4d4; display: grid; place-items: center; font-weight: 800; font-size: .9rem; user-select: none; transition: background .12s, color .12s; }
.day input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.day input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.time select { min-width: 66px; padding-inline: 8px; min-height: 42px; }
.end-row { display: flex; flex-direction: column; gap: 10px; }
.sf-preview { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.sf-preview:empty { display: none; }
.sf-preview.err { background: var(--ink); color: #fff; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; display: flex; flex-direction: column; }
.mini-stats b { font-size: 1.4rem; font-weight: 800; line-height: 1.3; }
.mini-stats span { color: var(--muted); font-size: .82rem; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 220px; }
.people-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.people-grid li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.people-grid li[hidden] { display: none; }
.pstate { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pstate.in { background: var(--ink); color: #fff; }

.timeline { list-style: none; margin: 0; padding: 0; border-right: 2px solid var(--line); margin-right: 8px; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 0; position: relative; }
.timeline .dot { position: absolute; right: -7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #bdbdbd; }
.timeline .dot.strong { border-color: var(--ink); background: var(--ink); }
.tl-t { flex: 1; display: flex; flex-direction: column; line-height: 1.45; }
.tl-t small { color: var(--muted); font-size: .78rem; }
.timeline time { color: var(--muted); font-size: .84rem; white-space: nowrap; }

.set-form { gap: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.set-block { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 22px; border-bottom: 1px solid var(--line); }
.set-label h3 { font-size: 1rem; margin-bottom: 4px; }
.set-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.set-save { padding: 16px 22px; display: flex; justify-content: flex-end; background: var(--soft-2); }
.danger { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border: 1px dashed #bdbdbd; border-radius: 20px; flex-wrap: wrap; }
.danger h3 { font-size: 1rem; }
.danger form { margin: 0; }

/* ===== فهرست کلاس‌ها ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; }
.newbox { border: 1px solid var(--ink); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.newbox-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.newbox-foot { display: flex; justify-content: flex-end; }
.step-block { display: flex; gap: 16px; }
.step-no { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .9rem; }
.step-body { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step-body h3 { font-size: 1rem; line-height: 32px; }
.search.grow { flex: 1; }
.clist { display: flex; flex-direction: column; gap: 10px; }
.citem { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: border-color .15s; }
.citem:hover { border-color: #bdbdbd; }
.citem.is-live { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.citem[hidden] { display: none; }
.citem-main { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.citem-t { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.citem-t strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-info { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); background: var(--soft); padding: 4px 10px; border-radius: 999px; text-decoration: none; }
.chip-info .ic { width: 14px; height: 14px; }
.chip-info.warn { background: #fff; border: 1px dashed var(--ink); color: var(--ink); }
.citem-act { display: flex; gap: 8px; }
.citem-act form { margin: 0; }

/* نشان */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid var(--line); color: var(--muted); background: #fff; white-space: nowrap; }
.badge.live-on, .badge.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.live-on i, .badge.on i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.badge.ok { color: var(--ink); border-color: var(--ink); }
.badge.bad { background: var(--soft); color: var(--ink); border-color: var(--ink); border-style: dashed; }
@keyframes blink { 50% { opacity: .25; } }

/* دکمه */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .06s, opacity .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: #262626; }
.btn:active { transform: scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn.outline { background: #fff; color: var(--ink); }
.btn.outline:hover { background: var(--soft); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.block { width: 100%; }
.btn.lg { height: 52px; font-size: 1rem; border-radius: 16px; }
.btn:disabled, .btn.busy { opacity: .5; cursor: progress; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--soft); border-color: var(--line); }
.icon-btn .ic { width: 18px; height: 18px; }
.link { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* کارت عمومی و فرم */
.card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; background: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 small { font-weight: 600; margin-inline-start: 4px; }
.form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.form > .btn { align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .86rem; font-weight: 700; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #d9d9d9; border-radius: var(--r-md); padding: 10px 14px; min-height: 46px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
input::placeholder { color: #a3a3a3; }
input[dir="ltr"] { text-align: left; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .row form { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.savebar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; z-index: 5; }
.savebar .btn { box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: .93rem; padding: 3px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: #d4d4d4; position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* انتخاب مخاطب */
.picker { display: flex; flex-direction: column; gap: 10px; }
.pick-grade { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.pick-head { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.pick-head small { color: var(--muted); font-weight: 500; margin-inline-start: auto; }
.pick-head input, .chip input { width: 18px; height: 18px; min-height: 0; accent-color: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { cursor: pointer; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px !important; height: 1px !important; min-height: 0; padding: 0; }
.chip span { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid #d4d4d4; font-size: .88rem; font-weight: 600; user-select: none; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:disabled + span { opacity: .75; }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* جدول و فهرست */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: right; font-weight: 700; color: var(--muted); font-size: .8rem; padding: 10px 22px; background: var(--soft-2); border-block: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.act { width: 1%; white-space: nowrap; }
.actions { display: flex; gap: 2px; justify-content: flex-end; } .actions form { margin: 0; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid #d9d9d9; border-radius: var(--r-md); padding: 0 12px; }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.search input { border: 0; padding-inline: 0; box-shadow: none !important; }
.search:focus-within { border-color: var(--ink); }
.people, .log { list-style: none; margin: 0; padding: 0; }
.people { max-height: 560px; overflow: auto; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people-t { flex: 1; display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.log li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.log li:last-child { border-bottom: 0; }

/* پیام */
.note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; font-size: .92rem; border: 1px solid var(--ink); background: #fff; }
.note.error { background: var(--ink); color: #fff; }
.note.info { background: var(--soft); border-color: var(--line); }
.note a { color: inherit; font-weight: 800; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 16px; border: 1px dashed #d4d4d4; border-radius: var(--r-lg); }
.state-ic { width: 58px; height: 58px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; margin-bottom: 4px; }
.state-ic .ic { width: 26px; height: 26px; }

/* ورود */
.bare-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.card.narrow { width: 100%; max-width: 420px; padding: 32px 26px; box-shadow: var(--shadow); }
.card.center { align-items: center; text-align: center; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 4px; }
.login-brand h1 { font-size: 1.35rem; margin-top: 6px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.code-input { text-align: center !important; font-size: 1.6rem; letter-spacing: .5em; font-weight: 800; padding-inline-start: .5em; }
.sent-to { text-align: center; color: var(--ink-2); }
.step-links { display: flex; justify-content: space-between; }
.keep { margin-top: 2px; }
.profiles { display: flex; flex-direction: column; gap: 10px; }
.profiles form { margin: 0; }
.profile { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; font: inherit; text-align: right; color: var(--ink); }
.profile:hover { border-color: var(--ink); }
.profile.cur { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.profile-t { flex: 1; display: flex; flex-direction: column; line-height: 1.45; }
.profile-t small { color: var(--muted); }

@media (max-width: 900px) {
  .split, .panel-grid { grid-template-columns: 1fr; }
  .citem { grid-template-columns: minmax(0, 1fr) auto; }
  .citem-meta { grid-column: 1 / -1; grid-row: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .me-t { display: none; }
  .me summary { padding: 3px; }
  .wrap { padding: 20px 14px 56px; }
  .hello h1 { font-size: 1.3rem; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .hero-act, .hero-act form, .hero-act .btn { width: 100%; }
  .brand-t small { max-width: 150px; }
  .chero { padding: 18px; }
  .chero h1 { font-size: 1.45rem; }
  .chero-act, .chero-act form, .chero-act .btn.lg { width: 100%; }
  .set-block { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .citem { grid-template-columns: 1fr; gap: 12px; }
  .citem-act > * { flex: 1; } .citem-act .btn { width: 100%; }
  .mini-stats b { font-size: 1.15rem; }
  .sf-row { grid-template-columns: 1fr; gap: 6px; }
  .step-block { gap: 12px; }
  .panel-grid .pcol:last-child { order: -1; }
  .sitem { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; }
  .sitem .stime { grid-column: 1 / -1; text-align: right; font-size: .86rem; color: var(--muted); }
  .jdp-pop { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
