.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 82% -10%, #1e40af26, transparent 60%),
    radial-gradient(760px 440px at 8% 18%, #8b5cff18, transparent 58%),
    #05060b;
}

.admin-body .orb { display: none; }

.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.admin-sidebar,
.admin-main,
.admin-panel,
.admin-stat,
.admin-login,
.admin-denied {
  border: 1px solid #273044;
  background: #0d101a;
  box-shadow: 0 18px 60px #0008;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid #21283a;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  background: linear-gradient(135deg, #7c5cff, #2563eb);
  box-shadow: 0 10px 26px #7c5cff35;
}

.admin-logo strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0;
}

.admin-logo small {
  display: block;
  margin-top: 2px;
  color: #8b95aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-tabs {
  display: grid;
  gap: 8px;
}

.admin-tab {
  width: 100%;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #aab3c4;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}

.admin-tab span {
  font-size: 14px;
  font-weight: 800;
}

.admin-tab small {
  color: #717b90;
  font-size: 11px;
  font-weight: 700;
}

.admin-tab:hover,
.admin-tab.is-active {
  color: #f8fafc;
  border-color: #334155;
  background: #151a28;
}

.admin-tab.is-active {
  border-color: #7c5cff88;
  box-shadow: 0 0 0 1px #7c5cff22 inset;
}

.admin-sidebar-card {
  margin-top: auto;
  padding: 13px;
  border-radius: 8px;
  background: #080a11;
  border: 1px solid #20283a;
}

.admin-sidebar-card span {
  display: block;
  color: #8b95aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-sidebar-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.admin-main {
  min-width: 0;
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(180deg, #0b0d16, #070910 48%, #05060b),
    #080a11;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #20283a;
}

.admin-brand h1 {
  margin: 8px 0 2px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-brand p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-user {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 8px;
  background: #111827;
  border: 1px solid #273044;
}

.admin-user img,
.cell-user img {
  border-radius: 8px;
  object-fit: cover;
  background: #1f2937;
}

.admin-user img {
  width: 32px;
  height: 32px;
}

.admin-user span {
  font-size: 13px;
  font-weight: 800;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-stat {
  position: relative;
  min-height: 110px;
  padding: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.admin-stat::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--stat-color, #7c5cff);
  opacity: .14;
  filter: blur(2px);
}

.admin-stat.blue { --stat-color: #3b82f6; }
.admin-stat.green { --stat-color: #22c55e; }
.admin-stat.purple { --stat-color: #8b5cff; }
.admin-stat.amber { --stat-color: #d97706; }
.admin-stat.pink { --stat-color: #ff5ca0; }
.admin-stat.cyan { --stat-color: #22d3ee; }

.admin-stat .label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.admin-stat .value {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.admin-stat .sub {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #7f8aa1;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 14px;
  align-items: start;
}

.admin-panel {
  border-radius: 8px;
  overflow: hidden;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #20283a;
  background: #101421;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.admin-panel-head p {
  margin: 3px 0 0;
  color: #7f8aa1;
  font-size: 12px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 5px #64748b1c;
}

.pulse-dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 5px #22c55e1f, 0 0 22px #22c55e77;
}

.admin-live-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.admin-live-item {
  display: grid;
  grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #080a11;
  border: 1px solid #20283a;
}

.live-main {
  min-width: 0;
}

.live-main strong,
.cell-user .name {
  display: block;
  font-weight: 800;
}

.live-main span,
.cell-user .login,
.table-note {
  color: #7f8aa1;
  font-size: 12px;
}

.live-title {
  min-width: 0;
  color: #cbd5e1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-rows {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.period-rows div {
  padding: 12px;
  border-radius: 8px;
  background: #080a11;
  border: 1px solid #20283a;
}

.period-rows span,
.period-rows small {
  display: block;
  color: #7f8aa1;
  font-size: 12px;
}

.period-rows strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.channels-table { min-width: 840px; }

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #20283a;
  vertical-align: middle;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #94a3b8;
  background: #101421;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #121827; }

.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.cell-user img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.pill-row,
.link-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pill-live {
  background: #22c55e1f;
  color: #86efac;
  border: 1px solid #22c55e55;
}

.pill-offline {
  background: #1f2937;
  color: #94a3b8;
  border: 1px solid #334155;
}

.pill-ok {
  background: #2563eb1f;
  color: #93c5fd;
  border: 1px solid #3b82f655;
}

.admin-link {
  color: #c7d2fe;
  text-decoration: none;
  font-weight: 800;
}

.admin-link.muted {
  color: #7f8aa1;
}

.admin-link:hover { text-decoration: underline; }

.admin-centered {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login,
.admin-denied {
  width: min(480px, 100%);
  padding: 26px;
  border-radius: 8px;
  text-align: center;
}

.admin-login h1,
.admin-denied h2 {
  margin: 12px 0 8px;
  font-size: 24px;
}

.admin-login p,
.admin-denied p {
  margin: 0 0 20px;
  color: #94a3b8;
  line-height: 1.5;
}

.admin-empty {
  padding: 32px;
  text-align: center;
  color: #7f8aa1;
}

.admin-empty.compact {
  padding: 22px;
}

@media (max-width: 1280px) {
  .admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .admin-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-sidebar-card { display: none; }
  .admin-main { padding: 14px; }
  .admin-header { align-items: stretch; flex-direction: column; }
  .admin-actions { justify-content: flex-start; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .admin-tabs { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: 1fr; }
  .admin-live-item { grid-template-columns: 1fr; }
  .admin-brand h1 { font-size: 21px; }
}
