/* =====================================================================
   PublishPages Admin — LOGIN SESSIONS styles (.ps- prefix, scoped)
===================================================================== */
.ps {
  --ps-ink: #0f172a;
  --ps-ink-2: #475569;
  --ps-ink-3: #94a3b8;
  --ps-line: #e5e7eb;
  --ps-soft: #f8fafc;
  --ps-accent: var(--primary, #ff7a3d);
  --ps-green: #16a34a;
  position: relative;
}

/* header */
.ps-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.ps-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ps-live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--ps-line); font-size: 13px; font-weight: 600; color: var(--ps-ink-2); white-space: nowrap; }
.ps-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ps-ink-3); }
.ps-live[data-state="live"] { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.ps-live[data-state="live"] .ps-live-dot { background: #22c55e; animation: psPulse 2s infinite; }
.ps-live[data-state="pending"] .ps-live-dot { background: #f59e0b; animation: psBlink 1s infinite; }
.ps-live[data-state="error"] { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.ps-live[data-state="error"] .ps-live-dot { background: #ef4444; }
@keyframes psPulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes psBlink { 50% { opacity: .35; } }

.ps-menu { min-width: 290px; padding: 6px; border-radius: 12px; }
.ps-menu .dropdown-item { border-radius: 8px; padding: 9px 12px; font-weight: 600; white-space: normal; }
.ps-menu .dropdown-item small { display: block; font-weight: 400; color: var(--ps-ink-3); margin-left: 1.6rem; font-size: 12px; }

/* stats */
.ps-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.ps-stat { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--ps-line); border-radius: 14px; padding: 14px 16px; }
.ps-stat > i { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #fff4ee; color: var(--ps-accent); font-size: 18px; flex: 0 0 auto; }
.ps-stat.is-green > i { background: #ecfdf3; color: var(--ps-green); }
.ps-stat-value { font-size: 22px; font-weight: 800; color: var(--ps-ink); line-height: 1.1; }
.ps-stat-label { font-size: 12.5px; color: var(--ps-ink-2); font-weight: 600; }

/* toolbar */
.ps-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.ps-seg { display: inline-flex; background: #f1f5f9; border-radius: 12px; padding: 4px; gap: 2px; }
.ps-seg-btn { border: 0; background: transparent; border-radius: 9px; padding: 7px 14px; font-weight: 700; font-size: 13.5px; color: var(--ps-ink-2); display: inline-flex; align-items: center; gap: 7px; }
.ps-seg-btn.active { background: #fff; color: var(--ps-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.ps-count { background: #e2e8f0; color: var(--ps-ink-2); border-radius: 999px; font-size: 11.5px; padding: 1px 8px; font-weight: 700; }
.ps-seg-btn.active .ps-count { background: var(--ps-accent); color: #fff; }
.ps-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-chip { border: 1px solid var(--ps-line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ps-ink-2); display: inline-flex; align-items: center; gap: 6px; }
.ps-chip:hover { border-color: #cbd5e1; }
.ps-chip.active { border-color: var(--ps-ink); background: var(--ps-ink); color: #fff; }
.ps-clear { margin-left: auto; font-weight: 600; text-decoration: none; }

/* list */
.ps-list { display: flex; flex-direction: column; gap: 10px; }
.ps-row { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--ps-line); border-radius: 14px; padding: 14px 16px; transition: border-color .2s, box-shadow .2s; }
.ps-row:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,23,42,.05); }
.ps-row.is-me { border-color: #fed7c3; background: linear-gradient(0deg, #fff, #fffaf7); }
.ps-row.is-ended { background: var(--ps-soft); }
.ps-row.is-ended .ps-ico { filter: grayscale(1); opacity: .7; }

.ps-ico { position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: 0 0 auto; background: #eef2ff; color: #4f46e5; }
.ps-ico.is-mobile { background: #fdf2f8; color: #db2777; }
.ps-ico.is-tablet { background: #ecfeff; color: #0891b2; }
.ps-ico-dot { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; }

.ps-main { flex: 1 1 auto; min-width: 0; }
.ps-title { font-weight: 800; color: var(--ps-ink); font-size: 15.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
.ps-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .01em; }
.ps-badge.is-me { background: #fff1e8; color: #c2410c; }
.ps-badge.is-new { background: #fef3c7; color: #92400e; }
.ps-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--ps-ink-2); margin-top: 3px; }
.ps-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ps-meta i { color: var(--ps-ink-3); }
.ps-panel { font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 6px; }
.ps-panel.is-admin { background: #fff4ee; color: #c2410c; }
.ps-panel.is-manager { background: #eef2ff; color: #4338ca; }
.ps-panel i { color: inherit !important; }
.ps-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ps-status { font-weight: 600; }
.ps-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.ps-dot.is-idle { background: #cbd5e1; }
.ps-status.is-online { color: var(--ps-green); }
.ps-status.is-ended { color: var(--ps-ink-2); }

.ps-side { flex: 0 0 auto; align-self: center; }
.ps-act { font-weight: 700; border-radius: 10px; white-space: nowrap; }
.ps-remove { color: var(--ps-ink-3); border: 1px solid var(--ps-line); }
.ps-remove:hover { color: #dc2626; }

.ps-empty { text-align: center; padding: 48px 16px; background: #fff; border: 1px dashed #d7dde5; border-radius: 14px; color: var(--ps-ink-2); }
.ps-empty i { font-size: 30px; color: var(--ps-ink-3); display: block; margin-bottom: 8px; }
.ps-empty p { margin: 8px 0 0; }
.ps-empty.is-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.ps-empty.is-error i { color: #ef4444; }
.ps-foot { font-size: 12.5px; color: var(--ps-ink-3); margin: 16px 2px 0; }

/* toast + modal */
.ps-toast { position: fixed; top: 18px; left: 50%; transform: translate(-50%, -20px); background: var(--ps-ink, #0f172a); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(15,23,42,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2000; max-width: calc(100vw - 32px); }
.ps-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ps-toast.is-ok { background: #166534; }
.ps-toast.is-err { background: #b91c1c; }
.ps-modal .modal-content { border: 0; border-radius: 16px; }
.ps-modal .modal-body { padding: 24px 24px 8px; }
.ps-modal .modal-footer { border-top: 0; padding: 12px 24px 20px; }
.ps-modal-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fef2f2; color: #dc2626; font-size: 20px; margin-bottom: 12px; }

/* responsive */
@media (max-width: 991.98px) { .ps-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
  .ps-row { flex-wrap: wrap; padding: 13px; gap: 12px; }
  .ps-main { flex-basis: calc(100% - 60px); }
  .ps-side { flex-basis: 100%; }
  .ps-side .ps-act:not(.ps-remove) { width: 100%; }
  .ps-side .ps-remove { float: right; }
  .ps-clear { margin-left: 0; }
  .ps-stat { padding: 12px; }
  .ps-stat-value { font-size: 19px; }
}

/* Sidebar fit: with the extra "Login Sessions" link, short laptop screens
   (≤ 920px tall) could push the last links under the email box. There the
   sidebar scrolls and the email box sticks to the bottom instead.
   Taller screens look exactly as before. */
@media (min-width: 768px) and (max-height: 920px) {
  .sidebar { overflow-y: auto; }
  .sidebar > .position-absolute.bottom-0 { position: sticky !important; bottom: 0; margin: 12px 0 0 !important; padding: 14px 1rem 6px !important; z-index: 1; background: #fff !important; border-top: 1px solid #eef0f3; border-radius: 0 !important; }
}
