/* رساتو · مرکز فرماندهی: ورود و پنل مدیریت با زبان طراحی Tremor (کارت تیز، نوار رنگی، عدد جدولی)
   و حس زنده (رادار، ضربان، ساعت). پس از live.css و sharp.css بارگذاری می‌شود. */
html.live:root body{--k-amber:#D6AD55;--k-violet:#8b74ff;--k-cyan:#4fd8ef;--k-green:#45d9a0;--k-rose:#ff7a9a}

/* ─── رادار مشترک ─── */
.radar{position:relative;width:min(360px,80vw);aspect-ratio:1;border-radius:50%!important;margin:28px auto;background:radial-gradient(circle,rgba(214,173,85,.07) 0,transparent 70%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.07)}
.radar::before{content:"";position:absolute;inset:0;border-radius:50%;background:repeating-radial-gradient(circle,transparent 0 calc(25% - 1px),rgba(255,255,255,.07) calc(25% - 1px) 25%),linear-gradient(transparent calc(50% - .5px),rgba(255,255,255,.06) 50%,transparent calc(50% + .5px)),linear-gradient(90deg,transparent calc(50% - .5px),rgba(255,255,255,.06) 50%,transparent calc(50% + .5px))}
.radar .sweep{position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,rgba(230,201,131,.0) 0deg,rgba(230,201,131,.0) 300deg,rgba(230,201,131,.35) 358deg,rgba(230,201,131,.0) 360deg);animation:sweep 4s linear infinite}
@keyframes sweep{to{transform:rotate(1turn)}}
.radar .blip{position:absolute;width:7px;height:7px;margin:-3.5px;border-radius:50%!important;background:var(--k-amber);box-shadow:0 0 12px var(--k-amber);animation:blip 4s linear infinite}
.radar .blip:nth-of-type(2){top:30%;left:62%;animation-delay:.35s}
.radar .blip:nth-of-type(3){top:66%;left:72%;background:var(--k-violet);box-shadow:0 0 12px var(--k-violet);animation-delay:1.3s}
.radar .blip:nth-of-type(4){top:72%;left:34%;background:var(--k-cyan);box-shadow:0 0 12px var(--k-cyan);animation-delay:2.4s}
.radar .blip:nth-of-type(5){top:38%;left:26%;background:var(--k-green);box-shadow:0 0 12px var(--k-green);animation-delay:3.2s}
@keyframes blip{0%,4%{opacity:0;transform:scale(.4)}8%{opacity:1;transform:scale(1.4)}40%{opacity:.6;transform:scale(1)}70%,100%{opacity:0}}
.radar .core{position:absolute;inset:38%;display:grid;place-items:center;border-radius:50%!important;background:rgba(8,14,28,.9);box-shadow:0 0 0 1px rgba(230,201,131,.4),0 0 0 calc(var(--beat,0) * 12px) rgba(214,173,85,calc(.3 - var(--beat,0) * .28)),0 0 50px -10px rgba(214,173,85,.7)}
.radar .core img{width:52%;height:52%}

/* ─── صفحهٔ ورود ─── */
html.live:root body .login-shell{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:none!important}
html.live:root body .login-shell>.brand{display:flex!important;flex-direction:column;justify-content:space-between;padding:40px 48px;border-inline-end:1px solid rgba(255,255,255,.07);background:linear-gradient(160deg,rgba(214,173,85,.06),rgba(139,116,255,.05) 55%,transparent)!important;position:relative;overflow:hidden}
.login-shell>.brand h1{font-size:clamp(34px,4vw,52px)!important;line-height:1.35;margin:14px 0 10px;color:var(--ink)!important}
.login-shell>.brand h1 em{font-style:normal;background:linear-gradient(100deg,#f6f0e5,var(--amber) 40%,#a995ff);-webkit-background-clip:text;background-clip:text;color:transparent}
.login-shell>.brand p{color:var(--muted)!important;max-width:420px}
.deck{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:6px}
.deck div{padding:10px 12px;border:1px solid rgba(255,255,255,.08);border-radius:4px;background:rgba(255,255,255,.03);font-size:12px;color:var(--muted)}
.deck b{display:block;font-size:13px;color:var(--ink);font-weight:500}
.deck i{display:inline-block;width:6px;height:6px;border-radius:50%;margin-inline-end:6px;background:var(--k-green);box-shadow:0 0 0 calc(var(--beat,0) * 5px) rgba(69,217,160,calc(.35 - var(--beat,0) * .3))}
.ticker{font:12px/1.8 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--faint);direction:ltr;text-align:left;height:22px;overflow:hidden}
.ticker span{display:block;animation:tick 12s steps(1) infinite}
@keyframes tick{0%{transform:translateY(0)}25%{transform:translateY(-22px)}50%{transform:translateY(-44px)}75%{transform:translateY(-66px)}}
html.live:root body .login-shell .form-side{display:flex;flex-direction:column;justify-content:center;padding:32px 6vw;background:none!important;border:0!important;box-shadow:none!important;backdrop-filter:none}
html.live:root body .login-shell .form-card{max-width:420px;width:100%;margin:auto;padding:30px!important}
.login-kicker{font:11px ui-monospace,monospace!important;letter-spacing:.12em;color:var(--amber-2)!important;direction:ltr;text-align:right}
html.live:root body .form-card .emblem{width:52px;height:52px;border-radius:6px!important;display:grid;place-items:center;background:rgba(8,14,28,.9);box-shadow:0 0 0 1px rgba(230,201,131,.4),0 0 0 calc(var(--beat,0) * 8px) rgba(214,173,85,calc(.3 - var(--beat,0) * .28))}
html.live:root body .form-card .emblem img{width:30px;height:30px}
html.live:root body .login-shell .topbar{border:0!important;background:none!important;backdrop-filter:none;padding:0 0 20px}
.login-shell .form-footer{text-align:center;color:var(--faint);font-size:13px;margin-top:18px}
.login-shell .form-footer a{color:var(--amber-2)}
@media(max-width:900px){html.live:root body .login-shell{grid-template-columns:1fr}html.live:root body .login-shell>.brand{padding:24px 20px 8px;border:0}.login-shell>.brand .radar{width:200px;margin:10px auto}.deck,.ticker,.login-shell>.brand>footer{display:none}}

/* ─── پنل مدیریت: نوار کناری و سربرگ فرماندهی ─── */
html.live:root body .sidebar{background:rgba(5,9,20,.72)!important;border-inline-start:1px solid rgba(255,255,255,.07)!important;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
html.live:root body .sidebar .brand .name{color:var(--ink)}
html.live:root body .sidebar .brand .tag{color:var(--faint)}
html.live:root body .sidebar .nav a{position:relative;border-radius:4px!important;color:var(--muted)!important;min-height:40px;display:flex;align-items:center;transition:background .2s,color .2s}
html.live:root body .sidebar .nav a:hover{background:rgba(255,255,255,.05)!important;color:var(--ink)!important}
html.live:root body .sidebar .nav a.active{background:linear-gradient(90deg,rgba(214,173,85,.14),rgba(214,173,85,.02))!important;color:var(--ink)!important}
html.live:root body .sidebar .nav a.active::before{content:"";position:absolute;inset-inline-start:0;top:8px;bottom:8px;width:2px;background:var(--amber);box-shadow:0 0 10px var(--amber)}
html.live:root body .main>.topbar{position:sticky;top:0;z-index:5;border-radius:0!important;border-width:0 0 1px!important;background:rgba(6,11,23,.7)!important}
.cmd-live{display:inline-flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);padding:5px 10px;border:1px solid rgba(255,255,255,.08);border-radius:4px}
.cmd-live time{font:12px ui-monospace,monospace;color:var(--ink);direction:ltr}

/* ─── کارت‌های KPI به سبک Tremor: نوار رنگی بالا، عدد جدولی، برچسب ریز ─── */
html.live:root body .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
html.live:root body .card.stat{position:relative;overflow:hidden;padding:18px 18px 16px!important}
html.live:root body .card.stat::before{content:"";position:absolute;top:0;inset-inline:0;height:2px;background:var(--accent-k,var(--k-amber))}
html.live:root body .cards .card.stat:nth-child(4n+2){--accent-k:var(--k-violet)}
html.live:root body .cards .card.stat:nth-child(4n+3){--accent-k:var(--k-cyan)}
html.live:root body .cards .card.stat:nth-child(4n+4){--accent-k:var(--k-green)}
html.live:root body .card.stat .label{font-size:12px!important;color:var(--faint)!important;letter-spacing:.01em}
html.live:root body .card.stat .value{font-size:28px!important;font-weight:700;font-variant-numeric:tabular-nums;margin-top:6px;line-height:1.3}
html.live:root body .card.stat .spark{display:block;height:28px;margin-top:10px;width:100%}

/* سربرگ مرکز فرماندهی */
.cmd-hero{position:relative;display:grid;grid-template-columns:1.4fr 1fr;gap:18px;align-items:center;padding:22px 24px;margin-bottom:14px;border:1px solid rgba(255,255,255,.08);border-radius:6px;background:linear-gradient(120deg,rgba(214,173,85,.09),rgba(139,116,255,.06) 60%,rgba(255,255,255,.01));overflow:hidden}
.cmd-hero h2{font-size:24px;margin:6px 0 6px;color:var(--ink)}
.cmd-hero p{margin:0;color:var(--muted);font-size:13px}
.cmd-hero .radar{width:170px;margin:0 auto}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.chip-k{display:inline-flex;align-items:center;gap:7px;font-size:12px;padding:6px 10px;border:1px solid rgba(255,255,255,.09);border-radius:4px;background:rgba(255,255,255,.03);color:var(--muted)}
.chip-k i{width:7px;height:7px;border-radius:50%;background:var(--k-green);box-shadow:0 0 0 calc(var(--beat,0) * 5px) rgba(69,217,160,calc(.35 - var(--beat,0) * .3))}
.chip-k.off i{background:#ff7a85;box-shadow:none}
.chip-k.warn i{background:var(--k-amber);box-shadow:none}
@media(max-width:760px){.cmd-hero{grid-template-columns:1fr}.cmd-hero .radar{display:none}}

/* ─── چیدمان بهتر ورود (v2) ─── */
html.live:root body .login-shell{grid-template-columns:minmax(0,1fr) minmax(380px,480px);gap:0;max-width:1240px;margin:0 auto}
html.live:root body .login-shell>.brand{padding:36px 44px;justify-content:center;gap:22px;border:0;background:none!important}
html.live:root body .login-shell>.brand>.brand-name{position:absolute;top:28px;inset-inline-start:44px}
.login-shell>.brand>div{display:grid;grid-template-columns:1fr auto;grid-template-areas:"eyebrow radar" "title radar" "lead radar" "deck deck";column-gap:28px;align-items:center}
.login-shell>.brand .eyebrow{grid-area:eyebrow;display:inline-flex;align-items:center;gap:8px;width:fit-content}
.login-shell>.brand h1{grid-area:title;margin:6px 0!important}
.login-shell>.brand h1::after,.login-shell>.brand h1::before{display:none!important}
.login-shell>.brand p{grid-area:lead;margin:0!important}
.login-shell>.brand .radar{grid-area:radar;width:220px;margin:0}
.login-shell>.brand .deck{grid-area:deck;margin-top:26px}
html.live:root body .login-shell .form-side{padding:28px 32px;border-inline-start:1px solid rgba(255,255,255,.07)!important;background:linear-gradient(180deg,rgba(255,255,255,.025),transparent)!important;min-height:100vh}
html.live:root body .login-shell .form-card{max-width:400px;padding:28px 26px!important}
.login-shell .form-card h2{font-size:22px;margin:8px 0 4px}
.login-shell .form-card .intro{margin:0 0 18px}
.login-shell .field{margin-bottom:14px}
.login-shell .ticker{position:absolute;bottom:24px;inset-inline-start:44px}
@media(max-width:1080px){.login-shell>.brand>div{grid-template-columns:1fr;grid-template-areas:"eyebrow" "title" "lead" "deck"}.login-shell>.brand .radar{display:none}}
@media(max-width:900px){
 html.live:root body .login-shell{grid-template-columns:1fr}
 html.live:root body .login-shell>.brand{padding:22px 20px 0;min-height:auto}
 html.live:root body .login-shell>.brand>.brand-name{position:static}
 .login-shell>.brand h1{font-size:26px!important}
 .login-shell>.brand p,.login-shell>.brand .deck,.login-shell .ticker{display:none!important}
 html.live:root body .login-shell .form-side{min-height:auto;border:0!important;padding:14px 16px 32px;background:none!important}
 html.live:root body .login-shell .form-side>.topbar{display:none}
 html.live:root body .login-shell .form-card{max-width:none}
}

/* ─── ورود با شماره ─── */
.pl-note{font-size:13px;color:var(--muted);margin:0 0 14px;line-height:1.9}
.pl-note b{color:var(--ink)}
.pl-steps{margin:0 0 16px;padding-inline-start:20px;font-size:13px;color:var(--muted);line-height:2.1}
input.otp{font:600 26px ui-monospace,monospace!important;letter-spacing:.5em;text-align:center}
#pl-link .tg-live{width:100%;justify-content:flex-start}
.tg-text .dots{display:inline-flex;gap:2px;margin-inline-start:4px;vertical-align:middle}
.tg-text .dots i{width:3px;height:3px;border-radius:50%;background:currentColor;animation:typing 1.2s infinite}
.tg-text .dots i:nth-child(2){animation-delay:.15s}.tg-text .dots i:nth-child(3){animation-delay:.3s}
@keyframes typing{0%,60%,100%{opacity:.2}30%{opacity:1}}
.pl-alt{margin-top:14px;font-size:13px;color:var(--muted)}
.pl-alt summary{cursor:pointer;min-height:40px;display:flex;align-items:center}
.pl-alt form{margin-top:8px}
.tg-live{display:inline-flex;align-items:center;gap:14px;padding:10px 16px 10px 12px;border-radius:4px;border:1px solid rgba(42,171,238,.45);background:rgba(42,171,238,.10);color:var(--ink);text-decoration:none}
.tg-orb{position:relative;display:grid;place-items:center;width:42px;height:42px;border-radius:50%!important;background:linear-gradient(135deg,#37bbfe,#007dbb);flex:none}
.tg-orb svg{width:22px;height:22px;fill:#fff}
.tg-orb::before,.tg-orb::after{content:"";position:absolute;inset:0;border-radius:50%;border:1.5px solid #2AABEE;animation:orb 2.4s cubic-bezier(.23,1,.32,1) infinite}
.tg-orb::after{animation-delay:1.2s}
@keyframes orb{from{transform:scale(1);opacity:.7}to{transform:scale(1.9);opacity:0}}
.tg-text{display:flex;flex-direction:column;line-height:1.5}.tg-text small{font-size:12px;color:var(--muted)}
.login-shell .brand-name img.wordmark{height:44px;width:auto;border-radius:0!important;box-shadow:none!important}
html.live:root body .form-card .text-button{display:block;margin:12px auto 0;background:none!important;border:0!important;box-shadow:none!important;color:var(--muted)!important;min-height:40px;font-size:13px;cursor:pointer}html.live:root body .form-card .text-button:hover{color:var(--ink)!important}

.bot-control .card label{display:flex;flex-direction:column;gap:6px;margin:10px 0}
.bot-control .card label.switch{flex-direction:row;align-items:center;gap:10px;cursor:pointer}
.bot-control .card label.switch small{margin-inline-start:auto;color:var(--faint);font-size:11px}
.agent-grid{display:grid;grid-template-columns:1fr;gap:2px}
