/* مرکز مانیتورینگ ورود، خروج و فعالیت پرسنل */
.sm-privacy-note {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .65rem;
    padding: .38rem .7rem;
    border: 1px solid rgba(16, 185, 129, .24);
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(16, 185, 129, .07);
    font-size: .76rem;
}

.sm-jump-nav {
    position: sticky;
    top: .65rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 1rem;
    padding: .55rem .7rem;
    overflow-x: auto;
    backdrop-filter: blur(18px);
}
.sm-jump-nav a {
    flex: 0 0 auto;
    padding: .38rem .72rem;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .78rem;
    transition: .18s ease;
}
.sm-jump-nav a:hover { color: var(--text-primary); background: rgba(124, 58, 237, .12); }
.sm-jump-nav > span { margin-inline-start: auto; white-space: nowrap; color: var(--text-muted); font-size: .72rem; }
.sm-kpis { margin-bottom: 1.25rem; }

.sm-section { margin: 1.35rem 0; scroll-margin-top: 5rem; }
.sm-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}
.sm-section-head > div { display: flex; align-items: center; gap: .7rem; }
.sm-section-head h3 { margin: 0 0 .1rem; font-size: 1.02rem; }
.sm-section-head p { margin: 0; color: var(--text-muted); font-size: .78rem; }
.sm-section-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #a78bfa;
    background: linear-gradient(145deg, rgba(124, 58, 237, .2), rgba(6, 182, 212, .08));
    border: 1px solid rgba(139, 92, 246, .2);
    font-weight: 800;
}
.sm-section-icon.sm-pulse { color: #34d399; background: rgba(16, 185, 129, .12); }
.sm-count {
    flex: 0 0 auto;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: .3rem .65rem;
    color: var(--text-muted);
    font-size: .72rem;
}

.sm-online-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: .75rem; }
.sm-online-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .7rem .8rem;
    min-height: 130px;
    padding: .9rem;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--role-color) 28%, transparent);
}
.sm-online-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--role-color), transparent);
}
.sm-online-avatar {
    position: relative;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
.sm-online-avatar i {
    position: absolute;
    inset: auto -2px -2px auto;
    width: 12px;
    height: 12px;
    border: 2px solid var(--bg-primary, #0b1020);
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .13), 0 0 10px #22c55e;
}
.sm-online-main { display: flex; flex-direction: column; min-width: 0; }
.sm-online-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-online-main span { color: var(--text-secondary); font-size: .78rem; }
.sm-online-main small { color: var(--text-muted); font-size: .72rem; }
.sm-online-stats { grid-column: 1 / -1; display: flex; gap: .5rem; }
.sm-online-stats span { flex: 1; padding: .4rem .5rem; border-radius: 10px; background: rgba(148, 163, 184, .06); color: var(--text-muted); font-size: .7rem; text-align: center; }
.sm-online-stats b { color: var(--text-primary); font-size: .84rem; }
.sm-person-filter { grid-column: 1 / -1; border: 0; padding: .15rem 0; color: var(--role-color); background: transparent; font: inherit; font-size: .68rem; text-align: right; cursor: pointer; }
.sm-person-filter:hover { text-decoration: underline; }
.sm-live-label { position: absolute; inset: .55rem auto auto .6rem; display: flex; align-items: center; gap: .25rem; color: #22c55e; font-size: .65rem; }
.sm-live-label i, .sm-session-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sm-live-label i { animation: sm-live 1.8s ease-in-out infinite; }
@keyframes sm-live { 50% { opacity: .35; box-shadow: 0 0 0 5px rgba(34, 197, 94, .12); } }

.sm-empty-inline { display: flex; align-items: center; gap: .8rem; min-height: 86px; padding: 1rem; border: 1px dashed var(--glass-border); border-radius: 16px; background: rgba(148, 163, 184, .025); }
.sm-empty-inline > span { font-size: 1.65rem; }
.sm-empty-inline div { display: flex; flex-direction: column; }
.sm-empty-inline small { color: var(--text-muted); }

.sm-filter-panel { margin-bottom: 1rem; }
.sm-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .75rem; align-items: end; }
.sm-filter-grid > label { display: flex; flex-direction: column; gap: .35rem; color: var(--text-secondary); font-size: .76rem; }
.sm-filter-grid input, .sm-filter-grid select { width: 100%; }
.sm-search { position: relative; }
.sm-search i { position: absolute; inset: auto auto .65rem .75rem; color: var(--text-muted); font-style: normal; }
.sm-filter-actions { display: flex; gap: .45rem; }
.sm-filter-actions .btn { flex: 1; }
.sm-group-chips { display: flex; gap: .45rem; margin-top: .9rem; padding-top: .8rem; overflow-x: auto; border-top: 1px solid var(--glass-border); }
.sm-filter-chip { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; border: 1px solid var(--glass-border); border-radius: 999px; padding: .38rem .7rem; color: var(--text-secondary); background: rgba(255,255,255,.02); font: inherit; font-size: .72rem; cursor: pointer; }
.sm-filter-chip:hover { border-color: rgba(139, 92, 246, .4); }
.sm-filter-chip.active { color: #c4b5fd; border-color: rgba(139, 92, 246, .5); background: rgba(124, 58, 237, .14); }
.sm-date-host { min-height: 42px; }

.sm-chart { margin: 1rem 0 1.35rem; overflow: hidden; }
.sm-bars { display: flex; align-items: end; gap: clamp(.28rem, 1.2vw, .75rem); min-height: 175px; padding: .5rem .2rem 0; overflow-x: auto; direction: ltr; }
.sm-bar-column { display: grid; grid-template-rows: 20px 125px 22px; place-items: center; flex: 1 0 34px; max-width: 70px; min-width: 34px; }
.sm-bar-value { color: var(--text-muted); font-size: .65rem; }
.sm-bar-track { display: flex; align-items: end; justify-content: center; gap: 2px; width: 100%; height: 120px; padding: 0 4px; border-bottom: 1px solid var(--glass-border); background: linear-gradient(to top, rgba(148,163,184,.05), transparent); }
.sm-bar-track i { width: 26%; min-height: 0; border-radius: 5px 5px 1px 1px; transition: height .45s ease; }
.sm-bar-actions { background: linear-gradient(#a78bfa, #7c3aed); }
.sm-bar-views { background: linear-gradient(#67e8f9, #0891b2); }
.sm-bar-logins { background: linear-gradient(#6ee7b7, #059669); }
.sm-bar-column small { color: var(--text-muted); font-size: .62rem; direction: rtl; }
.sm-chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: .55rem; color: var(--text-muted); font-size: .68rem; }
.sm-chart-legend span { display: flex; align-items: center; gap: .3rem; }
.sm-chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.sm-chart-legend .actions { background: #8b5cf6; }.sm-chart-legend .views { background: #06b6d4; }.sm-chart-legend .logins { background: #10b981; }

.sm-timeline { position: relative; display: grid; gap: .55rem; }
.sm-timeline::before { content: ''; position: absolute; top: 20px; bottom: 20px; right: 19px; width: 1px; background: linear-gradient(transparent, var(--glass-border) 8%, var(--glass-border) 92%, transparent); }
.sm-event { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: .7rem; }
.sm-event-marker { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--role-color) 35%, var(--glass-border)); border-radius: 13px; color: var(--role-color); background: color-mix(in srgb, var(--role-color) 12%, var(--bg-primary, #0b1020)); font-weight: 800; box-shadow: 0 0 0 5px var(--bg-primary, #0b1020); }
.sm-event-content { padding: .72rem .85rem; border: 1px solid var(--glass-border); border-radius: 15px; background: rgba(255,255,255,.025); transition: .18s ease; }
.sm-event:hover .sm-event-content { transform: translateX(-2px); border-color: color-mix(in srgb, var(--role-color) 35%, var(--glass-border)); background: color-mix(in srgb, var(--role-color) 5%, transparent); }
.sm-event-content header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.sm-event-title { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.sm-event-title strong { font-size: .86rem; }
.sm-event-group { padding: .18rem .45rem; border-radius: 999px; color: var(--text-muted); background: rgba(148, 163, 184, .07); font-size: .62rem; }
.sm-event-content time { flex: 0 0 auto; color: var(--text-muted); font-size: .68rem; }
.sm-event-content p { margin: .45rem 0 .55rem; color: var(--text-primary); line-height: 1.8; font-size: .82rem; }
.sm-event-content footer { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .55rem; color: var(--text-muted); font-size: .65rem; }
.sm-event-content footer b { color: var(--text-secondary); }
.sm-role-dot { width: 7px; height: 7px; border-radius: 50%; }

.sm-sessions-table { border: 1px solid var(--glass-border); border-radius: 16px; background: rgba(255,255,255,.02); }
.sm-sessions-table td > small, .sm-sessions-table td > strong { display: block; }
.sm-sessions-table td > small { color: var(--text-muted); font-size: .68rem; }
.sm-person-cell { display: flex; align-items: center; gap: .55rem; }
.sm-person-cell > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.sm-person-cell div { display: flex; flex-direction: column; min-width: 0; }
.sm-person-cell small { color: var(--text-muted); }
.sm-session-status { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .25rem .55rem; white-space: nowrap; font-size: .68rem; }
.sm-status-online { color: #34d399; background: rgba(16, 185, 129, .12); }
.sm-status-idle { color: #fbbf24; background: rgba(245, 158, 11, .12); }
.sm-status-logout { color: #94a3b8; background: rgba(148, 163, 184, .1); }
.sm-status-revoked { color: #fb7185; background: rgba(244, 63, 94, .11); }
.sm-session-help { margin: .65rem .2rem 0; color: var(--text-muted); font-size: .7rem; line-height: 1.7; }

[data-theme="light"] .sm-event-marker { box-shadow: 0 0 0 5px #f4f7fb; }
[data-theme="light"] .sm-online-card,
[data-theme="light"] .sm-event-content,
[data-theme="light"] .sm-sessions-table { background: rgba(255,255,255,.68); }
[data-theme="light"] .sm-privacy-note { color: #166534; }
[data-theme="light"] .sm-filter-chip.active { color: #6d28d9; }

@media (max-width: 720px) {
    .sm-jump-nav { top: .35rem; }
    .sm-jump-nav > span { display: none; }
    .sm-section-head { align-items: flex-start; }
    .sm-section-head p { max-width: 230px; }
    .sm-online-grid { grid-template-columns: 1fr; }
    .sm-filter-grid { grid-template-columns: 1fr; }
    .sm-filter-actions { width: 100%; }
    .sm-timeline::before { right: 16px; }
    .sm-event { grid-template-columns: 34px minmax(0, 1fr); gap: .5rem; }
    .sm-event-marker { width: 34px; height: 34px; border-radius: 11px; }
    .sm-event-content { padding: .65rem .7rem; }
    .sm-event-content header { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .sm-event-content p { font-size: .78rem; }
    .sm-event-content footer span:nth-last-child(-n+2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sm-live-label i { animation: none; }
    .sm-event-content, .sm-bar-track i { transition: none; }
}
