/* Platform admin layout – self-contained (shared styles.css has no span-12/span-4) */

body.platform-admin .shell {
  width: 100%;
  max-width: 100%;
}

body.platform-admin .workspace {
  min-width: 0;
  width: 100%;
}

body.platform-admin .page.grid.active {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

body.platform-admin .span-12 {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

body.platform-admin #pageStatus.grid.active .span-4 {
  grid-column: span 4;
  min-width: 0;
}

body.platform-admin .panel-head {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

body.platform-admin .panel-head > div:first-child {
  flex: 1 1 200px;
}

body.platform-admin .panel-actions {
  flex: 1 1 320px;
  justify-content: flex-end;
}

.platform-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-nav .nav-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.platform-nav .nav-item:hover,
.platform-nav .nav-item.active {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.platform-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  flex-shrink: 0;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.health-dot.ok {
  background: var(--green);
}
.health-dot.bad {
  background: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px 16px;
}

.dashboard-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.dashboard-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-card.live {
  border-color: rgba(255, 45, 85, 0.35);
  background: rgba(255, 45, 85, 0.1);
}

.dashboard-card.live strong {
  color: #ff7f9b;
}

.dashboard-card.trial {
  border-color: rgba(91, 124, 255, 0.35);
  background: rgba(91, 124, 255, 0.1);
}

.dashboard-card.premium {
  border-color: rgba(0, 229, 199, 0.35);
  background: rgba(0, 229, 199, 0.08);
}

.dashboard-card.pro {
  border-color: rgba(177, 76, 255, 0.35);
  background: rgba(177, 76, 255, 0.1);
}

.dashboard-card.videos {
  border-color: rgba(255, 221, 0, 0.35);
  background: rgba(255, 221, 0, 0.08);
}

.dashboard-meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-input {
  min-width: 180px;
  flex: 1 1 180px;
  max-width: 280px;
}

.platform-table-wrap {
  overflow-x: auto;
  width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.platform-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.platform-table th,
.platform-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

/* User management: dense but readable operational overview. */
.users-table {
  min-width: 1400px;
  table-layout: auto;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 42px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 48px;
}

/* 3 Felhasználó · 4 Állapotjelző · 5 Regisztráció · 6 Belépés · 7 LIVE · 8 Előfizetés · 9 Videók */
.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 16%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 14%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 11%;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 13%;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
  width: 14%;
}

.users-table th:nth-child(8),
.users-table td:nth-child(8) {
  width: 12%;
}

.users-table th:nth-child(9),
.users-table td:nth-child(9) {
  width: 7%;
}

/* Műveletek: shrink-to-content (the icon row), never compressed → never clipped. */
.users-table th:nth-child(10),
.users-table td:nth-child(10) {
  width: 1%;
  white-space: nowrap;
}

.marketing-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.marketing-form label {
  display: grid;
  gap: 6px;
}

.marketing-form textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.marketing-count,
.marketing-mail-mode {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.marketing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.videos-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.videos-table {
  min-width: 1180px;
}

.muted-inline {
  color: var(--muted);
}

.video-preview-dialog {
  max-width: 860px;
  width: calc(100% - 32px);
  padding: 20px;
}

.video-preview-dialog video {
  width: 100%;
  max-height: 60vh;
  border-radius: 14px;
  background: #000;
}

.video-preview-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.platform-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: rgba(255, 221, 0, 0.18);
  color: #ffe566;
}
.badge-trial {
  background: rgba(91, 124, 255, 0.18);
  color: #9eb4ff;
}
.badge-active {
  background: rgba(22, 199, 132, 0.18);
  color: #5fe0a8;
}
.badge-expired {
  background: rgba(255, 84, 112, 0.18);
  color: #ff8da3;
}
.badge-muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.badge-live {
  background: rgba(255, 45, 85, 0.2);
  color: #ff7f9b;
}

.expiry-soon {
  color: #ffe566;
}
.expiry-over {
  color: #ff8da3;
}

/* A <td> must stay a normal table-cell — display:flex here breaks column sizing and the
   buttons overflow into neighbouring columns. Keep it a cell; lay the icons out inline. */
.actions-cell {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.actions-cell .icon-btn {
  vertical-align: middle;
}

.actions-cell .icon-btn + .icon-btn {
  margin-left: 5px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.icon-btn-good {
  color: var(--green);
  border-color: rgba(22, 199, 132, 0.35);
}

.icon-btn-good:hover {
  background: rgba(22, 199, 132, 0.12);
}

.icon-btn-danger {
  color: #ff8da3;
  border-color: rgba(255, 84, 112, 0.35);
}

.icon-btn-danger:hover {
  background: rgba(255, 84, 112, 0.12);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 24px !important;
}

.stat-block p {
  margin: 0 0 10px;
}

.platform-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 0;
  background: var(--bg-2);
  color: var(--text);
  max-width: 520px;
  width: calc(100% - 32px);
}

.platform-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.platform-dialog form {
  padding: 20px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dialog-head h3 {
  margin: 0;
}

.dialog-user {
  color: var(--muted);
  margin: 0 0 16px;
}

.dialog-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  body.platform-admin #pageStatus.grid.active {
    grid-template-columns: 1fr;
  }

  body.platform-admin #pageStatus.grid.active .span-4 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body.platform-admin .shell {
    grid-template-columns: 1fr;
  }

  body.platform-admin .sidebar {
    position: static;
    height: auto;
  }

  .platform-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-input {
    max-width: none;
    width: 100%;
  }
}

/* ── Owner dashboard additions (todos / finance / live / audit / drill-down) ── */

.todo-queues {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.todo-queue {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.todo-queue:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}

.todo-queue.is-active {
  border-color: rgba(var(--blue-rgb), 0.45);
  background: rgba(var(--blue-rgb), 0.08);
  box-shadow: inset 3px 0 0 var(--blue);
}

.todo-queue.is-empty {
  opacity: 0.62;
}

.todo-queue-ic {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 17px;
  color: var(--blue);
  background: rgba(var(--blue-rgb), 0.12);
}

.todo-queue-ic.orange {
  color: var(--orange);
  background: rgba(var(--orange-rgb), 0.12);
}

.todo-queue-ic.violet {
  color: var(--violet);
  background: rgba(var(--violet-rgb), 0.12);
}

.todo-queue-ic.red {
  color: var(--red);
  background: rgba(var(--red-rgb), 0.12);
}

.todo-queue-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.todo-queue-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.todo-count {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.todo-active {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
}

.todo-active-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.todo-active-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

#todoShowAll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#todoShowAll[hidden] {
  display: none !important;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.todo-main {
  min-width: 0;
  flex: 1;
}

.todo-main strong {
  display: block;
  font-size: 14px;
}

.todo-main small {
  color: var(--muted);
  font-size: 12px;
}

.todo-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.todo-gap {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--violet-rgb), 0.28);
  background: rgba(var(--violet-rgb), 0.08);
  color: var(--violet);
  font-size: 11px;
  font-weight: 700;
}

.days-left {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.days-left.urgent {
  color: var(--red);
}

button.primary.small {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Funnel */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 150px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  font-size: 13px;
  color: var(--muted);
}

.funnel-bar-wrap {
  height: 16px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 124, 255, 0.9), rgba(0, 229, 199, 0.9));
  min-width: 2px;
  transition: width 0.4s var(--ease);
}

.funnel-value {
  text-align: right;
  font-weight: 700;
  font-size: 14px;
}

/* Streamer earnings (this month) */
.earnings-total {
  text-align: right;
  flex-shrink: 0;
}

.earnings-total strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: #ffe566;
}

.earnings-total span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.platform-table th.num,
.platform-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.earnings-table td.num {
  font-weight: 700;
}

/* Live */
.live-now-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: middle;
}

.live-now-pill.active {
  border-color: rgba(255, 45, 85, 0.45);
  background: rgba(255, 45, 85, 0.12);
  color: #ff7f9b;
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2d55;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.6);
  animation: live-pulse 1.6s infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 45, 85, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 45, 85, 0);
  }
}

tr.row-suspended {
  opacity: 0.55;
}

/* User drill-down dialog */
.user-detail-dialog {
  max-width: 720px;
  width: calc(100vw - 40px);
}

.user-detail-body h4 {
  margin: 18px 0 8px;
  font-size: 14px;
}

.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
}

.detail-card strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.detail-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-channels {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.ch-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}

.ch-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ch-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ch-edit.hidden {
  display: none;
}

.ch-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 180px;
}

.ch-edit input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.ch-edit-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex: 0 0 auto;
}

.ch-edit .hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* "What did the assistant hear?" — the phase-0 evidence panel under a channel row. Scrolls on its own
   so a busy broadcast's log can't push the rest of the channel list off the screen. */
.assistant-log {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.assistant-log.hidden {
  display: none;
}

.assistant-log .hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.assistant-obs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.assistant-obs li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}

.assistant-obs li small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

button.secondary.small {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.secondary.danger,
button.secondary.danger {
  border-color: rgba(var(--red-rgb), 0.35);
  color: var(--red);
}

/* Live-caption toggle in the user detail: green when ON, dimmed when its state couldn't load. */
button[data-captions-toggle][data-captions-state='on'] {
  border-color: rgba(var(--green-rgb), 0.5);
  color: var(--green);
}
button[data-captions-toggle][data-captions-state='error'] {
  opacity: 0.55;
}

@media (max-width: 1100px) {
  .todo-queues {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .todo-queues {
    grid-template-columns: 1fr;
  }
  .funnel-row {
    grid-template-columns: 110px 1fr 40px;
  }
}

/* ── Forgalom (web-traffic analytics) ───────────────────────────────────────── */
body.platform-admin .span-6 {
  grid-column: span 6;
  min-width: 0;
}
body.platform-admin .span-4 {
  grid-column: span 4;
  min-width: 0;
}

@media (max-width: 900px) {
  body.platform-admin .page.grid.active {
    grid-template-columns: 1fr;
  }
  body.platform-admin .span-6,
  body.platform-admin .span-4 {
    grid-column: auto;
  }
}

.traffic-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.range-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.range-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.range-tab:hover {
  color: var(--text);
}
.range-tab.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.traffic-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}
.traffic-bar {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.traffic-bar__label {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.traffic-bar__track {
  height: 8px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
}
.traffic-bar__fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #7c5cff, #a78bff);
}
.traffic-bar__fill.fb {
  background: linear-gradient(90deg, #1877f2, #4e93f7);
}
.traffic-bar__value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.traffic-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding-top: 8px;
  overflow-x: auto;
}
.traffic-col {
  flex: 1 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 14px;
}
.traffic-col__bars {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 120px;
}
.traffic-col__bar {
  width: 9px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #a78bff, #7c5cff);
  min-height: 2px;
}
.traffic-col__bar.fb {
  background: linear-gradient(180deg, #4e93f7, #1877f2);
}
.traffic-col__label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.traffic-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}
.dashboard-card.fb strong {
  color: #4e93f7;
}
.muted-legend {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ── Promó / ingyenes-időszak panel ─────────────────────────────────────── */
.promo-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.5;
}
.promo-status.free {
  border-color: rgba(22, 199, 132, 0.5);
  color: var(--green);
}
.promo-status.grace {
  border-color: rgba(255, 176, 32, 0.55);
  color: #ffb020;
}
.promo-status.paid {
  border-color: rgba(255, 84, 112, 0.45);
  color: var(--red);
}

.promo-form {
  display: grid;
  gap: 16px;
  max-width: 720px;
}
.promo-modes {
  display: grid;
  gap: 10px;
  border: none;
  padding: 0;
  margin: 0;
}
.promo-mode {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.promo-mode:hover {
  border-color: var(--line-strong);
}
/* Override the global `input,select{width:100%;min-height:46px}` so the radio stays a small dot. */
.promo-mode input[type='radio'] {
  -webkit-appearance: radio;
  appearance: radio;
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  accent-color: var(--blue, #5b7cff);
  cursor: pointer;
}
.promo-mode span {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
  font-size: 14px;
}
.promo-mode strong {
  font-weight: 600;
}
.promo-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.promo-grace {
  display: grid;
  gap: 6px;
  max-width: 360px;
}
.promo-grace input {
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.promo-actions {
  display: flex;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════════════════
   MODERN SKIN 2026 — a dago panel a streamer-konzol (public/console) dizájn-
   nyelvére hozva. Csak ez a fájl tölti be (platform-only), a legacy admint NEM
   érinti. A tokenek felüldefiniálásával minden meglévő, var()-t használó szabály
   automatikusan átszíneződik; alább a komponens-szintű finomítás.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --cyan: #00e5c7;
  --cyan-rgb: 0, 229, 199;
  --blue: #5b7cff;
  --blue-rgb: 91, 124, 255;
  --violet: #b14cff;
  --violet-rgb: 177, 76, 255;
  --green: #16c784;
  --green-rgb: 22, 199, 132;
  --red: #ff5470;
  --red-rgb: 255, 84, 112;
  --yellow: #ffd23f;
  --yellow-rgb: 255, 210, 63;
  --pink: #ff5db1;
  --pink-rgb: 255, 93, 177;
  --orange: #ff9e3d;
  --orange-rgb: 255, 158, 61;
  --teal: #2dd4bf;
  --teal-rgb: 45, 212, 191;
  --gold: #ffcf4d;
  --silver: #cdd6e6;
  --bronze: #e0915a;

  --grad: linear-gradient(120deg, #ff2e8a 0%, #c13bff 52%, #7c4dff 100%);
  --grad-cyan: linear-gradient(120deg, #00e5c7 0%, #5b7cff 50%, #b14cff 100%);
  --brand-pink: #ff2e8a;
  --brand-pink-rgb: 255, 46, 138;

  --bg: #08080e;
  --panel: rgba(255, 255, 255, 0.045);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5fa;
  --muted: #9aa0b6;
  --muted-2: #868dad;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body.platform-admin {
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 92% -10%, rgba(37, 99, 235, 0.08), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}
body.platform-admin h1,
body.platform-admin h2,
body.platform-admin h3,
body.platform-admin h4 {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
}
/* lassan sodródó aurora a háttéren */
body.platform-admin::before {
  content: '';
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 300px at 20% 30%, rgba(var(--cyan-rgb), 0.1), transparent 60%),
    radial-gradient(560px 300px at 80% 10%, rgba(var(--violet-rgb), 0.1), transparent 60%);
  filter: blur(20px);
  opacity: 0.7;
  animation: pf-aurora 22s ease-in-out infinite alternate;
}
@keyframes pf-aurora {
  from {
    transform: translateX(-3%) translateY(-1%);
  }
  to {
    transform: translateX(4%) translateY(2%);
  }
}
body.platform-admin .shell,
body.platform-admin .login-screen {
  position: relative;
  z-index: 1;
}
body.platform-admin ::selection {
  background: rgba(var(--blue-rgb), 0.35);
  color: #fff;
}

/* Brand: gradiens logó-csempe */
body.platform-admin .brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
body.platform-admin .brand .logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 18px;
  box-shadow:
    0 6px 18px rgba(var(--brand-pink-rgb), 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
body.platform-admin .brand.compact .logo {
  width: 34px;
  height: 34px;
  font-size: 16px;
}
body.platform-admin .brand h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
body.platform-admin .brand p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

/* Sidebar */
body.platform-admin .sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.18));
  backdrop-filter: blur(8px);
}

/* Menü: színes ikon-badge-ek */
body.platform-admin .platform-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.platform-admin .platform-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
body.platform-admin .nav-label {
  flex: 1 1 auto;
  min-width: 0;
}
.nav-ic {
  --accent: var(--cyan-rgb);
  --accent-solid: var(--cyan);
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
  color: var(--accent-solid);
  background: rgba(var(--accent), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent), 0.18);
  transition:
    background 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    color 0.15s var(--ease);
}
.nav-ic.cyan {
  --accent: var(--cyan-rgb);
  --accent-solid: var(--cyan);
}
.nav-ic.blue {
  --accent: var(--blue-rgb);
  --accent-solid: var(--blue);
}
.nav-ic.violet {
  --accent: var(--violet-rgb);
  --accent-solid: var(--violet);
}
.nav-ic.green {
  --accent: var(--green-rgb);
  --accent-solid: var(--green);
}
.nav-ic.red {
  --accent: var(--red-rgb);
  --accent-solid: var(--red);
}
.nav-ic.pink {
  --accent: var(--pink-rgb);
  --accent-solid: var(--pink);
}
.nav-ic.orange {
  --accent: var(--orange-rgb);
  --accent-solid: var(--orange);
}
.nav-ic.teal {
  --accent: var(--teal-rgb);
  --accent-solid: var(--teal);
}
.nav-ic.yellow {
  --accent: var(--yellow-rgb);
  --accent-solid: var(--yellow);
}
body.platform-admin .platform-nav .nav-item:hover {
  color: var(--text);
  background: var(--surface);
}
body.platform-admin .platform-nav .nav-item:hover .nav-ic {
  background: rgba(var(--accent), 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent), 0.4),
    0 4px 12px rgba(var(--accent), 0.18);
}
body.platform-admin .platform-nav .nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(var(--accent), 0.16), rgba(255, 255, 255, 0.03));
  border-color: rgba(var(--accent), 0.22);
}
body.platform-admin .platform-nav .nav-item.active .nav-ic {
  /* keep the whole badge a light tint so the dark glyph stays ≥3:1 on cool/red accents too */
  background: linear-gradient(140deg, rgba(var(--accent), 0.95), rgba(var(--accent), 0.74));
  color: #0a0a12;
  box-shadow: 0 6px 16px rgba(var(--accent), 0.4);
}

/* Topbar — üveg-pill */
body.platform-admin .topbar.platform-topbar {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}
body.platform-admin .kicker {
  color: var(--cyan);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
body.platform-admin #pageTitle {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Panelek — üveg, felső fény-él, hover */
body.platform-admin .panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s var(--ease);
}
body.platform-admin .panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}
body.platform-admin .panel:hover {
  border-color: var(--line-2);
}

/* Login-kártya — felső gradiens-él + blur */
body.platform-admin .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
}
body.platform-admin .login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  border-radius: 22px 22px 0 0;
}
body.platform-admin .login-card input {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--text);
}
body.platform-admin .login-card input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.18);
}

/* Gombok — gradiens primary, üveg secondary, glow + fókusz-gyűrűk
   (csak szín/háttér/keret — a méret-specifikus szabályokat, pl. .small, nem írjuk felül) */
body.platform-admin button.primary,
body.platform-admin .primary {
  background: var(--grad);
  border: none;
  color: #0a0a12;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(var(--brand-pink-rgb), 0.3);
}
body.platform-admin button.primary:hover,
body.platform-admin .primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 30px rgba(var(--brand-pink-rgb), 0.42);
  transform: translateY(-1px);
}
body.platform-admin button.secondary,
body.platform-admin .secondary {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 600;
}
body.platform-admin button.secondary:hover,
body.platform-admin .secondary:hover {
  border-color: var(--blue);
  background: rgba(var(--blue-rgb), 0.1);
}
/* danger variant must survive the generic secondary skin (same specificity, so scope higher) */
body.platform-admin button.secondary.danger,
body.platform-admin .secondary.danger {
  border-color: rgba(var(--red-rgb), 0.4);
  color: var(--red);
  background: rgba(var(--red-rgb), 0.05);
}
body.platform-admin button.secondary.danger:hover,
body.platform-admin .secondary.danger:hover {
  border-color: var(--red);
  background: rgba(var(--red-rgb), 0.14);
}
body.platform-admin button:focus-visible,
body.platform-admin a:focus-visible,
body.platform-admin input:focus-visible,
body.platform-admin select:focus-visible,
body.platform-admin textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Egyedi görgetősáv */
body.platform-admin * {
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* Szerver panel */
body.platform-admin .server-log {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted);
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
body.platform-admin .server-restart-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  body.platform-admin::before,
  body.platform-admin .live-dot,
  body.platform-admin .brand .logo::after {
    animation: none;
  }
}

/* ===================================================================
   PLATFORM V23 — CLEAR BLUE (app.pktok.com console parity)
   Off-white + graphite + royal blue. Calm product UI for ops work.
   =================================================================== */
body.platform-admin {
  --bg: #f4f6f9;
  --bg-2: #eaedf2;
  --panel: #ffffff;
  --surface: #f0f3f7;
  --surface-2: #e4e9f0;
  --line: #dbe1e9;
  --line-2: #c5ced9;
  --line-strong: #b0bbc8;
  --text: #1c2532;
  --muted: #647082;
  --muted-2: #818c9b;
  --brand-pink: #2563eb;
  --brand-pink-rgb: 37, 99, 235;
  --pink: #4f46e5;
  --pink-rgb: 79, 70, 229;
  --cyan: #0f6cbd;
  --cyan-rgb: 15, 108, 189;
  --blue: #2563eb;
  --blue-rgb: 37, 99, 235;
  --violet: #4f46e5;
  --violet-rgb: 79, 70, 229;
  --green: #16805b;
  --green-rgb: 22, 128, 91;
  --red: #dc3d57;
  --red-rgb: 220, 61, 87;
  --yellow: #d89b22;
  --yellow-rgb: 216, 155, 34;
  --orange: #c2410c;
  --orange-rgb: 194, 65, 12;
  --teal: #0f6cbd;
  --teal-rgb: 15, 108, 189;
  --grad: linear-gradient(125deg, #1d4ed8 0%, #3b82f6 100%);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 18px 45px rgba(26, 39, 60, 0.13);
  --shadow-soft: 0 6px 20px rgba(26, 39, 60, 0.08);
  color-scheme: light;
  background:
    radial-gradient(900px 520px at 92% -10%, rgba(37, 99, 235, 0.08), transparent 65%),
    var(--bg);
}

body.platform-admin::before {
  inset: auto -8vw -24vh auto;
  width: 48vw;
  height: 48vw;
  min-width: 520px;
  min-height: 520px;
  border: 90px solid rgba(var(--blue-rgb), 0.055);
  border-radius: 50%;
  background: none;
  filter: none;
  opacity: 1;
  animation: none;
}

body.platform-admin .sidebar {
  background: linear-gradient(180deg, #fcfcfe, #f6f7fb);
  border-right-color: var(--line);
  backdrop-filter: none;
}

body.platform-admin .brand .logo,
body.platform-admin .brand.compact .logo {
  border-radius: 5px;
  background: #2563eb;
  color: #fff;
  box-shadow: none;
}

body.platform-admin .topbar.platform-topbar,
body.platform-admin .panel,
body.platform-admin .login-card {
  background: var(--panel);
  border-color: var(--line);
  backdrop-filter: none;
  box-shadow: var(--shadow-soft);
}

body.platform-admin .panel::before,
body.platform-admin .login-card::before {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

body.platform-admin .platform-nav .nav-item.active {
  color: var(--text);
  background: rgba(var(--blue-rgb), 0.1);
  border-color: rgba(var(--blue-rgb), 0.22);
}

body.platform-admin .platform-nav .nav-item.active .nav-ic {
  color: #fff;
  background: var(--accent-solid, var(--blue));
  box-shadow: none;
}

body.platform-admin button.primary,
body.platform-admin .primary {
  color: #fff;
  background: #2563eb;
  border-color: #1d4ed8;
  box-shadow: none;
}

body.platform-admin button.primary:hover,
body.platform-admin .primary:hover {
  background: #1d4ed8;
}

body.platform-admin button.secondary,
body.platform-admin .secondary,
body.platform-admin .login-card input {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-2);
}

body.platform-admin .server-log {
  background: #11151c;
  color: #e8edf5;
}

body.platform-admin * {
  scrollbar-color: rgba(15, 15, 32, 0.28) transparent;
}

.user-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(var(--blue-rgb), 0.09), transparent 54%), var(--panel) !important;
}

.user-hero > div:first-child {
  flex: 1 1 300px;
}

.user-hero h3 {
  margin: 5px 0 6px;
  font-size: clamp(21px, 2vw, 29px);
}

.user-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.user-overview {
  flex: 2 1 650px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

/* The cards are BUTTONS: one click filters the table below to that cohort. */
.user-overview-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.user-overview-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.user-overview-card.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
  background: rgba(var(--blue-rgb), 0.07);
}

.user-overview-card strong,
.user-overview-card span,
.user-overview-card small {
  display: block;
}

.user-overview-card strong {
  color: var(--blue);
  font-size: 22px;
}

.user-overview-card span {
  margin-top: 2px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.user-overview-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.user-overview-card.cohort-good strong {
  color: var(--green);
}

.user-overview-card.cohort-bad strong {
  color: var(--red);
}

.user-overview-card.cohort-warn strong {
  color: var(--orange);
}

.user-overview-card.cohort-muted strong {
  color: var(--muted);
}

/* The owner's private "€20 paying customer" planning checkbox in the subscription cell */
.pay-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* The shared stylesheet dresses every input as a 46px text field — undo it, like .select-col. */
.pay-flag input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--green);
  cursor: pointer;
}

.pay-flag.on {
  border-color: rgba(var(--green-rgb), 0.5);
  color: var(--green);
  background: rgba(var(--green-rgb), 0.08);
}

/* Whole-row green for flagged accounts (Felhasználók + Élő). Declared BEFORE the row-selected
   and row-live-problem rules, so selection (blue) and problems (red) still win over it. */
body.platform-admin .platform-table tr.row-paying > td {
  background: rgba(var(--green-rgb), 0.09);
}

body.platform-admin .platform-table tr.row-paying > td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}

.platform-badge.badge-paying {
  background: rgba(var(--green-rgb), 0.16);
  color: var(--green);
  white-space: nowrap;
}

/* Relative-time recency colors in the user table */
.activity-cell strong.rec-fresh {
  color: var(--green);
}

.activity-cell strong.rec-stale {
  color: var(--orange);
}

.activity-cell strong.rec-never {
  color: var(--muted);
  font-weight: 500;
}

/* Column-index selectors used to duplicate these two rules for the LIVE cell; they were redundant
   with `.activity-cell` (which that cell carries) and only a trap when a column is inserted. */
.user-identity strong,
.user-identity small,
.user-identity span,
.activity-cell strong,
.activity-cell small,
.activity-cell span {
  display: block;
}

.user-identity small,
.activity-cell small {
  margin-top: 4px;
  color: var(--muted);
}

.user-identity span,
.activity-cell span {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11px;
}

.activity-cell strong {
  font-size: 13px;
}

.user-detail-dialog {
  max-width: 1040px;
}

.detail-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.detail-section h4 {
  margin-top: 0;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.detail-facts > div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--panel);
}

.detail-facts > div.wide {
  grid-column: 1 / -1;
}

.detail-facts dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ch-view > span,
.ch-view small {
  display: block;
}

.ch-view small {
  margin-top: 4px;
  color: var(--muted);
}

.detail-audit {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-audit li {
  display: grid;
  grid-template-columns: 145px minmax(150px, 0.7fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}

.detail-audit span,
.detail-audit small {
  color: var(--muted);
}

@media (max-width: 1050px) {
  .user-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .user-overview {
    flex-basis: auto;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .user-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-facts {
    grid-template-columns: 1fr;
  }
  .detail-facts > div.wide {
    grid-column: auto;
  }
  .detail-audit li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* V23 — multi-select user operations and create-account modal */
.bulk-user-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--blue-rgb), 0.055);
}

.bulk-user-bar strong {
  min-width: 86px;
  color: #dce8f7;
  font-size: 13px;
}

.bulk-user-bar select {
  width: min(310px, 100%);
  min-height: 38px;
}

.bulk-user-bar button {
  min-height: 38px;
  padding: 8px 13px;
}

.bulk-user-note {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.select-col {
  padding-right: 6px !important;
  padding-left: 10px !important;
  text-align: center !important;
}

body.platform-admin .select-col input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
  padding: 0;
  border-radius: 5px;
  accent-color: var(--blue);
  cursor: pointer;
}

body.platform-admin .users-table tr.row-selected > td {
  background: rgba(var(--blue-rgb), 0.075);
}

body.platform-admin .users-table tr.row-selected > td:first-child {
  box-shadow: inset 3px 0 0 var(--blue);
}

body.platform-admin .create-user-dialog {
  width: min(720px, calc(100vw - 36px));
  max-width: 720px;
}

@media (max-width: 780px) {
  .bulk-user-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-user-bar strong,
  .bulk-user-bar select,
  .bulk-user-bar button {
    width: 100%;
  }
}

/* V23 — Clear Blue dialogs and user drill-down */
body.platform-admin .platform-dialog {
  max-height: min(90vh, 920px);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

body.platform-admin .platform-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
}

body.platform-admin #actionDialog {
  max-width: 680px;
}

body.platform-admin .platform-dialog form {
  max-height: min(90vh, 920px);
  overflow-y: auto;
  padding: 0;
}

body.platform-admin .platform-dialog .dialog-head {
  position: sticky;
  z-index: 4;
  top: 0;
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

body.platform-admin .platform-dialog .dialog-head h3 {
  color: var(--text);
  font-size: 19px;
  letter-spacing: -0.01em;
}

body.platform-admin .platform-dialog .dialog-head .secondary {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
}

body.platform-admin #actionDialog form > .dialog-user {
  margin: 0;
  padding: 15px 22px 0;
}

body.platform-admin .platform-dialog .form-grid {
  gap: 15px;
  margin: 0;
  padding: 19px 22px 4px;
}

body.platform-admin .dialog-section-title {
  display: grid;
  gap: 3px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

body.platform-admin .dialog-section-title:not(:first-child) {
  margin-top: 7px;
}

body.platform-admin .dialog-section-title strong {
  color: var(--text);
  font-size: 13px;
}

body.platform-admin .dialog-section-title span {
  color: var(--muted);
  font-size: 11px;
}

body.platform-admin .platform-dialog .form-grid label,
body.platform-admin .archive-reason,
body.platform-admin .permanent-delete label {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

body.platform-admin .platform-dialog input:not([type='hidden']),
body.platform-admin .platform-dialog select,
body.platform-admin .platform-dialog textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

body.platform-admin .platform-dialog input:not([type='hidden']):hover,
body.platform-admin .platform-dialog select:hover,
body.platform-admin .platform-dialog textarea:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

body.platform-admin .platform-dialog input:not([type='hidden']):focus,
body.platform-admin .platform-dialog select:focus,
body.platform-admin .platform-dialog textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.13);
}

body.platform-admin .platform-dialog input::placeholder,
body.platform-admin .platform-dialog textarea::placeholder {
  color: var(--muted-2);
}

body.platform-admin .platform-dialog .dialog-actions {
  gap: 10px;
  margin: 15px 0 0;
  padding: 17px 22px 21px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

body.platform-admin .platform-dialog .dialog-actions .primary {
  min-width: 120px;
}

body.platform-admin .user-detail-dialog {
  width: min(1120px, calc(100vw - 36px));
  max-width: 1120px;
}

body.platform-admin .user-detail-body {
  max-height: calc(90vh - 70px);
  overflow-y: auto;
  padding: 22px 24px 28px;
  background:
    radial-gradient(620px 280px at 90% 0%, rgba(var(--blue-rgb), 0.06), transparent 70%),
    var(--panel);
}

body.platform-admin .user-detail-body > h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.platform-admin .user-detail-body > h4::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

body.platform-admin .detail-cards {
  gap: 10px;
}

body.platform-admin .detail-card {
  min-height: 88px;
  padding: 14px 15px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

body.platform-admin .detail-card strong {
  color: var(--text);
  font-size: 19px;
}

body.platform-admin .detail-section {
  padding: 18px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

body.platform-admin .detail-section h4 {
  color: var(--text);
  font-size: 14px;
}

body.platform-admin .detail-facts {
  border-color: var(--line);
  background: var(--line);
}

body.platform-admin .detail-facts > div {
  padding: 12px 14px;
  background: var(--panel);
}

body.platform-admin .detail-facts dt {
  color: var(--muted);
}

body.platform-admin .detail-facts dd {
  color: var(--text);
  line-height: 1.45;
}

body.platform-admin .user-detail-dialog .platform-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

body.platform-admin .user-detail-dialog .platform-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

body.platform-admin .user-detail-dialog .platform-table td {
  color: var(--text);
  background: transparent;
}

body.platform-admin .user-detail-dialog .platform-table tbody tr:hover td {
  background: rgba(var(--blue-rgb), 0.045);
}

body.platform-admin .ch-item {
  padding: 13px 14px;
  border-color: var(--line);
  background: var(--panel);
}

body.platform-admin .ch-edit {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

body.platform-admin .ch-edit input {
  background: #ffffff;
}

body.platform-admin .timeline-item {
  border-radius: 8px;
  transition: background 0.15s ease;
}

body.platform-admin .timeline-item:hover {
  background: rgba(var(--blue-rgb), 0.035);
}

body.platform-admin .timeline-dot {
  border-color: var(--panel);
}

body.platform-admin .archive-dialog {
  width: min(720px, calc(100vw - 36px));
  max-width: 720px;
  overflow-y: auto;
}

body.platform-admin .archive-dialog > .dialog-user {
  margin: 0;
  padding: 16px 22px 0;
}

body.platform-admin .archive-dialog > .archive-impact {
  margin: 15px 22px;
}

body.platform-admin .archive-impact > div {
  border-color: var(--line);
  background: var(--surface);
}

body.platform-admin .archive-dialog > .archive-reason {
  display: grid;
  margin: 0 22px;
}

body.platform-admin .archive-dialog > .hint {
  margin: 11px 22px 0;
  color: var(--muted);
}

body.platform-admin .archive-dialog > .permanent-delete {
  margin: 0 22px 22px;
  border-color: rgba(var(--red-rgb), 0.25);
  background: rgba(var(--red-rgb), 0.045);
}

body.platform-admin .video-preview-dialog > .dialog-user,
body.platform-admin .video-preview-dialog > video,
body.platform-admin .video-preview-actions {
  margin-right: 22px;
  margin-left: 22px;
}

body.platform-admin .video-preview-dialog {
  overflow-y: auto;
}

body.platform-admin .video-preview-actions {
  margin-bottom: 22px;
}

body.platform-admin .health-state.warn {
  color: #a16207;
}

@media (max-width: 680px) {
  body.platform-admin .platform-dialog,
  body.platform-admin .user-detail-dialog,
  body.platform-admin .archive-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  body.platform-admin .platform-dialog .dialog-head {
    padding: 14px 15px;
  }

  body.platform-admin .platform-dialog .form-grid,
  body.platform-admin .user-detail-body {
    padding-right: 15px;
    padding-left: 15px;
  }

  body.platform-admin .user-detail-body {
    max-height: calc(100vh - 76px);
  }

  body.platform-admin .archive-dialog > .dialog-user,
  body.platform-admin .archive-dialog > .archive-reason,
  body.platform-admin .archive-dialog > .hint,
  body.platform-admin .archive-dialog > .permanent-delete {
    margin-right: 15px;
    margin-left: 15px;
  }

  body.platform-admin .archive-dialog > .archive-impact {
    margin-right: 15px;
    margin-left: 15px;
  }
}

/* V21 — account health, timeline and safe archive */
.health-states {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.health-states small {
  color: var(--muted);
  font-size: 11px;
}

.health-state {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.health-state.healthy {
  border-color: rgba(var(--green-rgb), 0.28);
  color: var(--green);
  background: rgba(var(--green-rgb), 0.08);
}

.health-state.warn {
  border-color: rgba(var(--yellow-rgb), 0.34);
  color: #8b5b0a;
  background: rgba(var(--yellow-rgb), 0.1);
}

.health-state.urgent {
  border-color: rgba(var(--red-rgb), 0.3);
  color: var(--red);
  background: rgba(var(--red-rgb), 0.08);
}

.health-state.muted {
  color: var(--muted);
  background: var(--surface);
}

tr.row-archived {
  opacity: 0.62;
}

.live-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.live-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
}

tr.row-live-problem {
  background: rgba(var(--red-rgb, 220, 70, 70), 0.08);
}

.message-templates,
.saved-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.saved-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: inherit;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.saved-filter-chip span {
  opacity: 0.7;
  font-weight: 700;
}

.saved-filter-chip:hover {
  border-color: rgba(120, 160, 220, 0.55);
}

button.sort-th {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  white-space: nowrap; /* "ID" must not wrap into "I D" in the narrow first column */
}

button.sort-th::after {
  content: '↕';
  opacity: 0.35;
  font-size: 0.78em;
}

button.sort-th.is-active[data-dir='asc']::after {
  content: '↑';
  opacity: 0.9;
}

button.sort-th.is-active[data-dir='desc']::after {
  content: '↓';
  opacity: 0.9;
}

button.sort-th:hover {
  color: var(--accent, #2f6fed);
}

.message-detail-body .message-body {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface, #f4f7fb);
  border: 1px solid rgba(30, 50, 80, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  max-height: 50vh;
  overflow: auto;
}

.live-session-table {
  min-width: 900px;
}

.user-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 150px minmax(0, 1fr);
  gap: 10px;
  min-height: 56px;
  padding: 9px 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 27px;
  bottom: -10px;
  left: 7px;
  width: 2px;
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  z-index: 1;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 4px solid var(--panel);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--line-2);
}

.timeline-item.live .timeline-dot {
  background: var(--green);
}

.timeline-item.admin .timeline-dot {
  background: var(--violet);
}

.timeline-item.subscription .timeline-dot {
  background: var(--yellow);
}

.timeline-item time {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item small {
  margin-top: 4px;
  color: var(--muted);
}

.archive-dialog {
  width: min(720px, calc(100vw - 32px));
}

.archive-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.archive-impact > div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.archive-impact strong,
.archive-impact span {
  display: block;
}

.archive-impact strong {
  font-size: 20px;
}

.archive-impact span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.archive-reason {
  display: grid;
  gap: 6px;
}

.archive-reason textarea {
  width: 100%;
  resize: vertical;
}

.permanent-delete {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--red-rgb), 0.25);
  border-radius: 9px;
  background: rgba(var(--red-rgb), 0.04);
}

/* An already archived account only gets the delete half of the dialog: `hidden` must beat the
   explicit `display` of the reason label and the action bar (the attribute alone would lose). */
.archive-dialog [hidden] {
  display: none !important;
}

.permanent-delete h4 {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.permanent-delete p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .timeline-item {
    grid-template-columns: 18px 1fr;
  }
  .timeline-item time {
    grid-column: 2;
  }
  .timeline-item > div {
    grid-column: 2;
  }
  .archive-impact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Opponent-language picker next to the captions toggle in the user detail. */
select.captions-lang {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 190px;
}
