:root {
  color-scheme: dark;
  --bg: #020912;
  --surface: #06111d;
  --surface-2: #0a1a2a;
  --line: rgba(74, 142, 208, .22);
  --text: #f1f7ff;
  --muted: #9baac0;
  --green: #00e077;
  --blue: #2094ff;
  --cyan: #00c8ff;
  --purple: #8d5cff;
  --amber: #ffb23f;
  --red: #ff414d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at 30% 0, rgba(32, 148, 255, .12), transparent 26%),
    radial-gradient(circle at 80% 8%, rgba(0, 224, 119, .08), transparent 24%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #03101d;
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 6px;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  text-transform: uppercase;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  min-height: 56px;
  padding: 0 18px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(23, 91, 223, .35), rgba(8, 26, 48, .72));
  box-shadow: inset 3px 0 0 var(--blue), 0 12px 28px rgba(4, 31, 75, .26);
}

.side-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(47, 209, 124, .12);
}

.main {
  min-width: 0;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  margin: -18px -18px 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 9, 18, .72);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #071829;
  cursor: pointer;
}

.menu-button {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: linear-gradient(180deg, rgba(8, 24, 40, .94), rgba(4, 13, 24, .96));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 112px;
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 14px;
  align-content: center;
  isolation: isolate;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, currentColor 58%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .46), 0 0 34px color-mix(in srgb, currentColor 18%, transparent);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .78;
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, currentColor 28%, transparent), transparent 28%),
    linear-gradient(120deg, color-mix(in srgb, currentColor 12%, transparent), transparent 48%);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  grid-column: 2;
  margin-top: 2px;
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.05;
  white-space: nowrap;
  text-shadow: 0 0 18px color-mix(in srgb, currentColor 28%, transparent);
}

.metric.violet strong {
  font-size: 24px;
}

.metric::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 138px;
  height: 42px;
  opacity: .92;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, currentColor 12%, transparent)),
    repeating-linear-gradient(90deg, transparent 0 13px, color-mix(in srgb, currentColor 18%, transparent) 14px 15px),
    linear-gradient(135deg, transparent 0 38%, currentColor 39% 41%, transparent 42% 55%, currentColor 56% 58%, transparent 59%);
  clip-path: polygon(0 91%, 16% 88%, 28% 66%, 39% 70%, 51% 39%, 63% 28%, 79% 68%, 100% 46%, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 12px color-mix(in srgb, currentColor 36%, transparent));
}

.metric-icon {
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 22px color-mix(in srgb, currentColor 22%, transparent);
}

.metric.blue { color: var(--blue); border-color: rgba(32, 148, 255, .38); background: linear-gradient(135deg, rgba(7, 39, 75, .96), rgba(6, 17, 29, .96)); }
.metric.cyan { color: var(--cyan); border-color: rgba(0, 200, 255, .34); background: linear-gradient(135deg, rgba(3, 45, 58, .92), rgba(6, 17, 29, .96)); }
.metric.purple { color: var(--purple); border-color: rgba(141, 92, 255, .36); background: linear-gradient(135deg, rgba(32, 21, 70, .96), rgba(6, 17, 29, .96)); }
.metric.violet { color: #b59cff; border-color: rgba(181, 156, 255, .34); background: linear-gradient(135deg, rgba(21, 21, 58, .96), rgba(6, 17, 29, .96)); }
.metric.alert { color: var(--red); border-color: rgba(255, 65, 77, .36); background: linear-gradient(135deg, rgba(64, 15, 25, .92), rgba(6, 17, 29, .96)); }

.metric.blue .metric-icon { background: rgba(32, 148, 255, .22); }
.metric.cyan .metric-icon { background: rgba(0, 200, 255, .18); }
.metric.purple .metric-icon { background: rgba(141, 92, 255, .24); }
.metric.violet .metric-icon { background: rgba(181, 156, 255, .18); }
.metric.alert .metric-icon { background: rgba(255, 65, 77, .20); }

.metric.alert strong {
  color: var(--red);
}

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

.online-map-panel,
.live-sessions-panel {
  min-height: 0;
}

.online-map-panel {
  grid-column: 1;
  grid-row: 1;
}

.right-rail {
  display: grid;
  gap: 14px;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.live-sessions-panel {
  grid-column: 1;
  grid-row: 2;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(0, 224, 119, .12);
  font-size: 12px;
  font-weight: 800;
}

.online-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(rgba(3, 14, 25, .30), rgba(3, 14, 25, .72)),
    radial-gradient(ellipse at 54% 54%, rgba(14, 88, 122, .52), transparent 18%),
    radial-gradient(ellipse at 32% 58%, rgba(12, 80, 52, .48), transparent 22%),
    radial-gradient(ellipse at 74% 48%, rgba(20, 72, 114, .42), transparent 24%),
    linear-gradient(150deg, #061524, #020914 70%);
  background-size: cover;
  background-position: center;
}

.online-map::before {
  content: "";
  position: absolute;
  inset: 12% 3% 2%;
  opacity: .62;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(0, 224, 119, .14), transparent 35%),
    radial-gradient(ellipse at 55% 70%, rgba(0, 200, 255, .14), transparent 38%);
}

.map-glow {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(0, 224, 119, .34) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(0, 200, 255, .28) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 178, 63, .20) 0 .9px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, .12) 0 .7px, transparent 1.4px);
  background-position: 12px 10px, 42px 28px, 24px 36px, 64px 14px;
  background-size: 64px 52px, 92px 72px, 118px 88px, 148px 106px;
  opacity: .74;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.66));
  animation: mapParticles 18s linear infinite;
}

.map-glow::before,
.map-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-glow::before {
  background-image:
    radial-gradient(circle, rgba(0, 224, 119, .18) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(0, 200, 255, .14) 0 .9px, transparent 1.7px);
  background-position: 20px 18px, 78px 34px;
  background-size: 42px 38px, 74px 58px;
  opacity: .58;
  animation: mapParticles 11s linear infinite reverse;
}

.map-glow::after {
  background-image: radial-gradient(circle, rgba(0, 224, 119, .28) 0 1.4px, transparent 2.6px);
  background-position: 18px 22px;
  background-size: 156px 120px;
  opacity: .28;
  filter: blur(.2px);
}

@keyframes mapParticles {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-64px, -52px, 0);
  }
}

.map-path {
  position: absolute;
  left: 9%;
  right: 8%;
  top: 42%;
  height: 38%;
  border-top: 2px solid rgba(0, 224, 119, .78);
  border-right: 2px solid rgba(0, 200, 255, .72);
  border-radius: 50% 42% 56% 40%;
  transform: rotate(6deg);
  filter: drop-shadow(0 0 10px rgba(0, 224, 119, .45));
}

.online-map-avatars {
  position: absolute;
  inset: 0;
}

.map-avatar {
  position: absolute;
  width: 210px;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(0, 224, 119, .30);
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(3, 22, 36, .88), rgba(4, 46, 45, .72));
  box-shadow: 0 18px 34px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.map-avatar:hover {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: rgba(0, 224, 119, .72);
  box-shadow: 0 20px 42px rgba(0, 0, 0, .45), 0 0 28px rgba(0, 224, 119, .25);
}

.map-avatar::after {
  content: "";
  position: absolute;
  left: 52px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid #06111d;
  box-shadow: 0 0 18px rgba(0, 224, 119, .8);
}

.map-avatar img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 224, 119, .92);
  box-shadow: 0 0 0 5px rgba(0, 224, 119, .14), 0 0 26px rgba(0, 224, 119, .38);
  background: #101c2c;
}

.map-avatar strong,
.map-avatar small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-avatar-copy {
  min-width: 0;
}

.map-avatar strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.1;
}

.map-avatar small {
  margin-top: 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.map-empty,
.mini-empty {
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.compact-panel .panel-head {
  min-height: 56px;
  padding: 14px 16px;
}

.compact-panel .panel-head h2 {
  font-size: 15px;
  text-transform: uppercase;
}

.mini-chart {
  height: 116px;
  padding: 18px 20px 14px;
  display: flex;
  align-items: end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.mini-chart div {
  flex: 1;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, rgba(141, 92, 255, .86), rgba(32, 148, 255, .10));
  box-shadow: 0 0 22px rgba(141, 92, 255, .25);
}

.mini-chart div:nth-child(1) { height: 36%; }
.mini-chart div:nth-child(2) { height: 52%; }
.mini-chart div:nth-child(3) { height: 72%; }
.mini-chart div:nth-child(4) { height: 66%; }
.mini-chart div:nth-child(5) { height: 82%; }
.mini-chart div:nth-child(6) { height: 44%; }

.mini-list {
  display: grid;
  padding: 8px 14px 14px;
}

.mini-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.mini-item:last-child {
  border-bottom: 0;
}

.mini-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(0, 200, 255, .11);
  font-weight: 900;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 65, 77, .48);
  background: var(--surface-2);
  box-shadow: 0 0 18px rgba(255, 65, 77, .14);
}

.mini-icon.ok {
  color: var(--green);
  background: rgba(0, 224, 119, .12);
}

.mini-icon.exit,
.mini-item.danger .mini-icon {
  color: var(--red);
  background: rgba(255, 65, 77, .14);
}

.mini-item strong,
.mini-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-item strong {
  font-size: 13px;
}

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

.mini-item b {
  color: var(--red);
  background: rgba(255, 65, 77, .12);
  border: 1px solid rgba(255, 65, 77, .26);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
}

.danger-panel {
  border-color: rgba(255, 65, 77, .30);
}

.danger-panel h2 {
  color: var(--red);
}

.row-action {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(32, 148, 255, .10);
  padding: 0 12px;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr);
  gap: 18px;
}

.content-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  min-height: 72px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search {
  width: min(280px, 100%);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  padding: 0 12px;
}

.form-stack {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.form-stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-stack input,
.form-stack select,
.form-stack textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  padding: 10px 12px;
}

.form-stack textarea {
  resize: vertical;
}

.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inline-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px;
}

.inline-check input {
  width: auto;
}

.rss-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.rss-wide-panel {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.rss-status-grid,
.rss-preset-grid {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.rss-status-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.rss-status-grid div {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.rss-status-grid span,
.rss-preset span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rss-status-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
}

.rss-preset-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  padding-top: 0;
}

.rss-preset {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  text-align: left;
  cursor: pointer;
}

.rss-preset:hover {
  border-color: rgba(0, 224, 119, .36);
  background: rgba(0, 224, 119, .10);
}

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

.rss-list,
.rss-preview,
.rss-log-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.rss-item,
.rss-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .04);
}

.rss-preview-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
}

.rss-preview-item > img {
  grid-row: span 4;
  width: 130px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

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

.rss-item strong,
.rss-log strong {
  display: block;
  color: var(--text);
}

.rss-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.rss-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.rss-message-preview {
  margin: 8px 0;
  padding: 10px;
  border-left: 3px solid var(--green);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 224, 119, .08);
  font-size: 13px;
  white-space: pre-wrap;
}

.danger-action {
  color: var(--red);
  border-color: rgba(255, 65, 77, .32);
}

.rss-status {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(0, 224, 119, .14);
  font-size: 12px;
  font-weight: 800;
}

.rss-status.off {
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
}

.rss-log.success strong { color: var(--green); }
.rss-log.error strong { color: var(--red); }
.rss-log.info strong { color: var(--blue); }

.check-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.check-grid legend {
  color: var(--muted);
  padding: 0 6px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-grid input {
  width: auto;
}

.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #061016;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  text-decoration: none;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

td {
  color: #d9e5e9;
  font-size: 13px;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-button,
.avatar-card {
  cursor: pointer;
}

.person-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.person-button:hover span,
.avatar-card:hover strong {
  color: var(--green);
}

.person img,
.avatar-card img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge.entry {
  color: var(--green);
  background: rgba(47, 209, 124, .12);
}

.badge.exit {
  color: var(--red);
  background: rgba(240, 100, 100, .12);
}

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.avatar-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.avatar-grid.list {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.avatar-card,
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}

.avatar-card strong,
.avatar-card span {
  display: block;
}

.avatar-card span,
.rank-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.rank-list {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.rank-item {
  justify-content: space-between;
}

.rank-item b {
  color: var(--blue);
}

.config-list {
  padding: 18px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.config-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.config-list dt {
  color: var(--muted);
}

.config-list dd {
  margin: 0;
  text-align: right;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.presence-popups {
  position: fixed;
  top: 82px;
  right: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.presence-popup {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(0, 224, 119, .34);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(0, 224, 119, .18), rgba(7, 24, 40, .94)),
    rgba(7, 24, 40, .96);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45), 0 0 28px rgba(0, 224, 119, .16);
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  animation: presenceBounceIn .62s cubic-bezier(.2, 1.35, .35, 1) both;
}

.presence-popup.exit {
  border-color: rgba(255, 65, 77, .38);
  background:
    linear-gradient(135deg, rgba(255, 65, 77, .18), rgba(7, 24, 40, .94)),
    rgba(7, 24, 40, .96);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45), 0 0 28px rgba(255, 65, 77, .14);
}

.presence-popup.leaving {
  animation: presenceBounceOut .55s ease-in both;
}

.presence-popup img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .20);
  background: var(--surface-2);
}

.presence-popup b,
.presence-popup small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-popup b {
  font-size: 15px;
}

.presence-popup small {
  margin-top: 4px;
  color: #b9c7dc;
  font-size: 13px;
}

.presence-popup.entry small {
  color: #76ffb2;
}

.presence-popup.exit small {
  color: #ff8d94;
}

@keyframes presenceBounceIn {
  0% {
    opacity: 0;
    transform: translateX(34px) scale(.88);
  }
  58% {
    opacity: 1;
    transform: translateX(-8px) scale(1.04);
  }
  78% {
    transform: translateX(3px) scale(.98);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes presenceBounceOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  35% {
    transform: translateX(-10px) scale(1.03);
  }
  100% {
    opacity: 0;
    transform: translateX(42px) scale(.86);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  font-size: 22px;
}

.avatar-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.avatar-modal-head img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.avatar-modal-head h2,
.avatar-modal-head p {
  margin: 0;
}

.avatar-modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px;
}

.modal-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .03);
}

.modal-stats span,
.modal-stats strong {
  display: block;
}

.modal-stats span {
  color: var(--muted);
  font-size: 12px;
}

.modal-stats strong {
  margin-top: 7px;
  font-size: 18px;
}

.modal-actions {
  padding: 0 18px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions .secondary-button {
  min-width: 130px;
}

.export-button {
  color: #061016;
  border-color: rgba(0, 224, 119, .55);
  background: linear-gradient(135deg, var(--green), #00b8ff);
  box-shadow: 0 12px 32px rgba(0, 224, 119, .16);
}

.modal-message-form {
  padding-top: 12px;
}

/* Dashboard style closer to the supplied Salinas Core reference. */
.app-shell {
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 14px;
}

.brand {
  padding: 0 8px 12px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0, 224, 119, .35));
}

.brand strong {
  font-size: 17px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 0 14px 0 58px;
  font-size: 14px;
  font-weight: 600;
}

.nav-item::before {
  position: absolute;
  left: 20px;
  width: 22px;
  color: #a9b8cf;
  font-size: 20px;
  text-align: center;
}

.nav-item[data-view="dashboard"]::before { content: "▦"; color: #eef6ff; }
.nav-item[data-view="online"]::before { content: "☷"; }
.nav-item[data-view="sessions"]::before { content: "☊"; }
.nav-item[data-view="avatars"]::before { content: "☰"; }
.nav-item[data-view="regions"]::before { content: "⬡"; }
.nav-item[data-view="bans"]::before { content: "⊘"; }
.nav-item[data-view="corrade"]::before { content: "↗"; }
.nav-item[data-view="rss"]::before { content: "RSS"; font-size: 12px; font-weight: 800; }
.nav-item[data-view="settings"]::before { content: "⚙"; }

.nav-badge {
  margin-left: auto;
  min-width: 26px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(0, 224, 119, .18);
  text-align: center;
}

.nav-badge.danger {
  color: #fff;
  background: rgba(255, 65, 77, .48);
}

.main {
  padding: 14px 16px;
}

.topbar {
  margin: -14px -16px 14px;
  padding: 14px 16px 14px 32px;
}

.topbar h1,
.topbar p {
  display: none;
}

.topbar-actions {
  gap: 14px;
  width: 100%;
  justify-content: flex-end;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  font-size: 26px;
}

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(0, 224, 119, .22);
  border-radius: 999px;
  color: var(--green);
  background: rgba(0, 224, 119, .07);
  font-size: 13px;
  font-weight: 800;
}

.top-action,
.reload-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #071829;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.reload-button {
  border-color: rgba(32, 148, 255, .55);
  background: linear-gradient(135deg, #194fdb, #1239a8);
  box-shadow: 0 0 26px rgba(32, 148, 255, .18);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.online-map {
  min-height: 290px;
}

.online-map::before {
  clip-path: polygon(7% 54%, 21% 35%, 43% 26%, 66% 32%, 91% 48%, 83% 69%, 58% 79%, 28% 72%);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .55));
}

.map-path {
  top: 35%;
  height: 42%;
}

.compact-panel .panel-head {
  min-height: 70px;
}

.live-sessions-panel .panel-head h2 span {
  color: var(--cyan);
  font-size: 14px;
  text-transform: uppercase;
}

.status-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(8, 24, 40, .94), rgba(4, 13, 24, .96));
  overflow: hidden;
}

.status-strip div {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 14px 20px;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.status-strip div:last-child {
  border-right: 0;
}

.status-strip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status-strip strong {
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 20;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .metric-grid,
  .content-grid,
  .content-grid.two,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .live-sessions-panel {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .clock {
    display: none;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rss-layout,
  .rss-status-grid,
  .rss-preset-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .rss-preview-item {
    grid-template-columns: 1fr;
  }

  .rss-preview-item > img {
    width: 100%;
  }

  .modal-stats {
    grid-template-columns: 1fr;
  }
}

/* Tropical Salinas theme */
:root {
  --bg: #e9fbff;
  --surface: rgba(255, 250, 232, .90);
  --surface-2: rgba(255, 246, 218, .96);
  --line: rgba(157, 113, 55, .24);
  --text: #123047;
  --muted: #5c7182;
  --green: #13a85f;
  --blue: #208ed9;
  --cyan: #0daec6;
  --purple: #e34e55;
  --amber: #f1a72d;
  --red: #e43e3f;
  --shadow: 0 18px 42px rgba(79, 117, 126, .22);
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(104, 205, 238, .88) 0 15%, rgba(179, 232, 238, .72) 15% 31%, rgba(250, 222, 161, .72) 31% 100%),
    repeating-linear-gradient(165deg, rgba(255, 255, 255, .20) 0 2px, transparent 2px 70px),
    #f8ddb0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 31%, rgba(255, 255, 255, .72), transparent 0 10%, transparent 64%),
    linear-gradient(180deg, transparent 0 28%, rgba(255, 255, 255, .60) 28% 29%, rgba(39, 172, 201, .55) 29% 35%, rgba(255, 242, 196, .68) 35% 100%);
  opacity: .92;
}

body::after {
  inset: 0;
  background:
    radial-gradient(ellipse at 7% -10%, rgba(37, 120, 47, .45) 0 4%, transparent 4.2%),
    radial-gradient(ellipse at 96% -9%, rgba(37, 120, 47, .42) 0 5%, transparent 5.2%),
    linear-gradient(135deg, rgba(20, 118, 70, .26) 0 2px, transparent 2px 54px),
    linear-gradient(225deg, rgba(20, 118, 70, .22) 0 2px, transparent 2px 56px);
  background-size: 620px 260px, 620px 260px, 180px 120px, 170px 118px;
  background-position: -170px -94px, calc(100% + 170px) -90px, -36px -28px, calc(100% - 120px) -24px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}

.app-shell {
  background: transparent;
}

.sidebar {
  top: 18px;
  height: calc(100vh - 36px);
  margin: 18px 0 18px 36px;
  border: 1px solid rgba(199, 154, 83, .42);
  border-radius: 22px;
  background: rgba(255, 251, 235, .88);
  box-shadow: 0 20px 50px rgba(85, 126, 121, .20);
  backdrop-filter: blur(18px);
}

.brand {
  color: #0f748a;
}

.brand strong {
  color: #0f7a8e;
  font-size: 18px;
}

.brand span {
  color: #2d6f84;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  color: #946a36;
  background: transparent;
}

.nav-item::before {
  color: #9c713c;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #2ba9e8, #147ec4);
  box-shadow: 0 14px 26px rgba(32, 142, 217, .28);
}

.nav-item.active::before,
.nav-item:hover::before {
  color: #fff;
}

.nav-badge {
  color: #05763d;
  background: rgba(19, 168, 95, .16);
}

.nav-item.active .nav-badge,
.nav-item:hover .nav-badge {
  color: #0f5132;
  background: rgba(255, 255, 255, .76);
}

.nav-badge.danger {
  color: #d83336;
  background: rgba(228, 62, 63, .16);
}

.side-status {
  color: #089653;
  border-top-color: rgba(157, 113, 55, .24);
}

.pulse {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(19, 168, 95, .14);
}

.main {
  padding: 18px 24px 26px 30px;
}

.topbar {
  min-height: 74px;
  margin: 18px 12px 18px 0;
  padding: 14px 18px;
  border: 1px solid rgba(199, 154, 83, .34);
  border-radius: 28px;
  background: rgba(255, 251, 235, .88);
  box-shadow: 0 18px 46px rgba(88, 136, 142, .18);
  backdrop-filter: blur(18px);
}

.topbar h1,
.topbar p {
  display: none;
}

.menu-button {
  color: #9c713c;
}

.system-pill {
  color: #087540;
  border-color: rgba(19, 168, 95, .20);
  background: rgba(255, 250, 232, .84);
  box-shadow: 0 8px 22px rgba(126, 86, 39, .10);
}

.clock {
  color: #23364b;
  font-weight: 700;
}

.top-action,
.reload-button,
.icon-button,
.secondary-button,
.row-action {
  border-color: rgba(199, 154, 83, .30);
  color: #7a5427;
  background: rgba(255, 250, 232, .82);
  box-shadow: 0 9px 22px rgba(126, 86, 39, .10);
}

.reload-button {
  color: #fff;
  border-color: rgba(24, 130, 209, .42);
  background: linear-gradient(135deg, #2fa9ef, #147dcc);
  box-shadow: 0 14px 28px rgba(32, 142, 217, .25);
}

.metric-grid {
  gap: 12px;
  margin: 0 12px 14px 0;
}

.metric,
.panel,
.modal-card {
  color: var(--text);
  border: 1px solid rgba(199, 154, 83, .34);
  background: rgba(255, 250, 232, .87);
  box-shadow: 0 18px 42px rgba(82, 125, 133, .18);
  backdrop-filter: blur(12px);
}

.metric {
  min-height: 122px;
  border-radius: 16px;
}

.metric::before {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .65), transparent 44%),
    radial-gradient(circle at 87% 73%, rgba(255, 183, 67, .22), transparent 24%),
    linear-gradient(15deg, transparent 66%, rgba(255, 216, 136, .64) 67% 75%, transparent 76%);
}

.metric::after {
  opacity: .75;
  height: 34px;
  color: currentColor;
  filter: none;
}

.metric-icon {
  width: 52px;
  height: 52px;
  color: #fff;
  font-size: 25px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(32, 142, 217, .20);
}

.metric span {
  color: #283e52;
}

.metric strong {
  font-size: 29px;
  text-shadow: none;
}

.metric.violet strong {
  font-size: 25px;
}

.metric.cyan {
  color: #1688cd;
  border-color: rgba(32, 142, 217, .36);
  background:
    linear-gradient(110deg, rgba(255,255,255,.86), rgba(220, 244, 249, .78)),
    linear-gradient(180deg, transparent 65%, rgba(244, 199, 115, .42) 66%);
}

.metric.purple {
  color: #e64b54;
  border-color: rgba(230, 75, 84, .30);
  background:
    linear-gradient(110deg, rgba(255,255,255,.88), rgba(255, 241, 198, .80)),
    linear-gradient(180deg, transparent 65%, rgba(244, 199, 115, .42) 66%);
}

.metric.violet {
  color: #0c859c;
  border-color: rgba(12, 133, 156, .30);
  background:
    linear-gradient(110deg, rgba(255,255,255,.88), rgba(222, 249, 239, .82)),
    linear-gradient(180deg, transparent 65%, rgba(60, 185, 213, .18) 66%);
}

.metric.blue {
  color: #0b9b57;
  border-color: rgba(19, 168, 95, .30);
  background:
    linear-gradient(110deg, rgba(255,255,255,.88), rgba(232, 252, 202, .80)),
    linear-gradient(180deg, transparent 65%, rgba(244, 199, 115, .36) 66%);
}

.metric.alert {
  color: #e33e3f;
  border-color: rgba(227, 62, 63, .30);
  background:
    linear-gradient(110deg, rgba(255,255,255,.88), rgba(255, 224, 205, .80)),
    linear-gradient(180deg, transparent 65%, rgba(244, 199, 115, .38) 66%);
}

.metric.cyan .metric-icon { background: linear-gradient(135deg, #35baf3, #1482c9); }
.metric.purple .metric-icon { background: linear-gradient(135deg, #ff7b83, #e14650); }
.metric.violet .metric-icon { background: linear-gradient(135deg, #33c19d, #0c8ca2); }
.metric.blue .metric-icon { background: linear-gradient(135deg, #6bd86d, #10a95d); }
.metric.alert .metric-icon { background: linear-gradient(135deg, #ff8664, #dc3c3e); }

.dashboard-grid {
  margin-right: 12px;
}

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

.panel-head {
  border-bottom-color: rgba(199, 154, 83, .28);
  background: rgba(255, 250, 232, .46);
}

.panel-head h2 {
  color: #102f48;
}

.panel-head p {
  color: #226f95;
}

.live-pill,
.badge.entry {
  color: #078749;
  background: rgba(19, 168, 95, .15);
}

.badge.exit {
  color: #df373a;
  background: rgba(228, 62, 63, .16);
}

.online-map {
  min-height: 330px;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, .12), rgba(255, 251, 235, .36)),
    radial-gradient(ellipse at 48% 45%, rgba(96, 191, 130, .56), transparent 28%),
    radial-gradient(ellipse at 49% 53%, rgba(246, 214, 135, .88), transparent 31%),
    radial-gradient(ellipse at 50% 72%, rgba(21, 183, 199, .50), transparent 48%),
    linear-gradient(180deg, #64d4ed 0%, #74d6df 48%, #f6d896 49%, #f7e5ba 100%);
}

.online-map::before {
  inset: 13% 4% 12%;
  opacity: .72;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(91, 182, 92, .70), transparent 35%),
    radial-gradient(ellipse at 48% 63%, rgba(246, 213, 139, .92), transparent 43%),
    radial-gradient(ellipse at 34% 76%, rgba(255, 246, 213, .80), transparent 22%);
  clip-path: polygon(8% 58%, 22% 37%, 45% 25%, 67% 32%, 91% 48%, 84% 70%, 58% 82%, 28% 74%);
}

.map-path {
  border-top-color: rgba(127, 255, 134, .92);
  border-right-color: rgba(19, 168, 95, .66);
  filter: drop-shadow(0 0 10px rgba(65, 226, 111, .58));
}

.map-glow {
  opacity: .42;
  mix-blend-mode: multiply;
}

.map-avatar {
  border-color: rgba(19, 168, 95, .34);
  background: rgba(255, 251, 235, .86);
  color: #173347;
  box-shadow: 0 16px 30px rgba(78, 113, 102, .22), inset 0 1px 0 rgba(255, 255, 255, .75);
}

.map-avatar strong {
  color: #173347;
}

.map-avatar small,
.map-avatar::after {
  color: #078749;
}

.map-avatar img {
  border-color: rgba(19, 168, 95, .72);
  box-shadow: 0 0 0 5px rgba(19, 168, 95, .14), 0 0 20px rgba(19, 168, 95, .30);
}

.mini-chart div {
  background: linear-gradient(180deg, rgba(47, 169, 239, .92), rgba(47, 169, 239, .12));
  box-shadow: 0 0 20px rgba(47, 169, 239, .20);
}

.danger-panel {
  border-color: rgba(228, 62, 63, .28);
}

.danger-panel h2 {
  color: #d83336;
}

.mini-item,
th,
td {
  border-bottom-color: rgba(199, 154, 83, .22);
}

td {
  color: #18374d;
}

th {
  color: #7a613f;
}

table {
  background: rgba(255, 250, 232, .40);
}

.person img,
.avatar-card img {
  background: #f7dfaa;
}

.avatar-card,
.rank-item,
.config-list div,
.modal-stats div {
  border-color: rgba(199, 154, 83, .30);
  background: rgba(255, 251, 235, .70);
}

.avatar-card span,
.rank-item span,
.mini-item small,
.mini-item time,
.modal-stats span,
.config-list dt {
  color: #607487;
}

.search,
.form-stack input,
.form-stack select,
.form-stack textarea {
  color: #18374d;
  border-color: rgba(47, 169, 239, .26);
  background: rgba(255, 251, 235, .84);
}

.status-strip {
  border-color: rgba(199, 154, 83, .34);
  background: rgba(255, 251, 235, .88);
  box-shadow: 0 18px 42px rgba(82, 125, 133, .18);
}

.status-strip div {
  border-right-color: rgba(199, 154, 83, .26);
}

.status-strip span {
  color: #7a613f;
}

.status-strip strong {
  color: #11895a;
}

.toast {
  color: #173347;
  border-color: rgba(199, 154, 83, .34);
  background: rgba(255, 251, 235, .92);
}

.modal-backdrop {
  background: rgba(42, 96, 111, .38);
}

.modal-close {
  color: #7a5427;
  border-color: rgba(199, 154, 83, .30);
  background: rgba(255, 250, 232, .82);
}

.export-button,
.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #13a85f, #22add8);
  box-shadow: 0 14px 28px rgba(19, 168, 95, .20);
}

.presence-popup {
  color: #173347;
  border-color: rgba(19, 168, 95, .34);
  background: rgba(255, 251, 235, .94);
}

.presence-popup.exit {
  border-color: rgba(228, 62, 63, .34);
  background: rgba(255, 241, 223, .95);
}

/* Admin-managed visual assets and day/night modes */
.site-asset {
  display: block;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}

.metric-asset {
  width: 100%;
  height: 100%;
}

.panel-head-asset {
  width: 58px;
  height: 58px;
  margin-left: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18));
}

.sidebar-decor {
  width: min(150px, 88%);
  max-height: 220px;
  margin: 0 auto 8px;
}

.footer-asset {
  width: 58px;
  height: 44px;
  margin: 0 auto 6px;
}

.status-strip div {
  text-align: center;
}

body.theme-day .online-map {
  background-image:
    linear-gradient(180deg, rgba(255, 251, 235, .12), rgba(255, 251, 235, .36)),
    var(--asset-sl-map, linear-gradient(transparent, transparent)),
    var(--asset-map-day, linear-gradient(transparent, transparent)),
    radial-gradient(ellipse at 48% 45%, rgba(96, 191, 130, .56), transparent 28%),
    radial-gradient(ellipse at 49% 53%, rgba(246, 214, 135, .88), transparent 31%),
    radial-gradient(ellipse at 50% 72%, rgba(21, 183, 199, .50), transparent 48%),
    linear-gradient(180deg, #64d4ed 0%, #74d6df 48%, #f6d896 49%, #f7e5ba 100%);
  background-size: cover;
  background-position: center;
}

body.theme-night {
  --bg: #020912;
  --surface: #06111d;
  --surface-2: #0a1a2a;
  --line: rgba(74, 142, 208, .26);
  --text: #f1f7ff;
  --muted: #9baac0;
  --green: #00e077;
  --blue: #2094ff;
  --cyan: #00c8ff;
  --purple: #8d5cff;
  --amber: #ffb23f;
  --red: #ff414d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
  color: var(--text);
  background:
    radial-gradient(circle at 30% 0, rgba(32, 148, 255, .12), transparent 26%),
    radial-gradient(circle at 80% 8%, rgba(0, 224, 119, .08), transparent 24%),
    linear-gradient(180deg, #010711 0%, #041120 52%, #020914 100%);
}

body.theme-night::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 241, 189, .18), transparent 4%),
    radial-gradient(circle at 72% 18%, rgba(58, 153, 255, .16), transparent 10%),
    linear-gradient(180deg, rgba(5, 17, 34, .72), rgba(1, 7, 17, .92));
  opacity: .95;
}

body.theme-night::after {
  background:
    radial-gradient(ellipse at 7% -10%, rgba(24, 92, 58, .30) 0 4%, transparent 4.2%),
    radial-gradient(ellipse at 96% -9%, rgba(24, 92, 58, .26) 0 5%, transparent 5.2%);
  background-size: 620px 260px, 620px 260px;
  background-position: -170px -94px, calc(100% + 170px) -90px;
  background-repeat: no-repeat;
}

body.theme-night .sidebar,
body.theme-night .topbar,
body.theme-night .metric,
body.theme-night .panel,
body.theme-night .modal-card,
body.theme-night .status-strip {
  color: var(--text);
  border-color: rgba(74, 142, 208, .30);
  background: linear-gradient(180deg, rgba(8, 24, 40, .94), rgba(4, 13, 24, .96));
  box-shadow: var(--shadow);
}

body.theme-night .sidebar {
  background: rgba(3, 16, 29, .94);
}

body.theme-night .brand strong,
body.theme-night .panel-head h2,
body.theme-night .map-avatar strong {
  color: var(--text);
}

body.theme-night .brand span,
body.theme-night .panel-head p,
body.theme-night .metric span,
body.theme-night .mini-item small,
body.theme-night .mini-item time,
body.theme-night .status-strip span {
  color: var(--muted);
}

body.theme-night .nav-item {
  color: var(--muted);
}

body.theme-night .nav-item:hover,
body.theme-night .nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(23, 91, 223, .35), rgba(8, 26, 48, .72));
  box-shadow: inset 3px 0 0 var(--blue), 0 12px 28px rgba(4, 31, 75, .26);
}

body.theme-night .top-action,
body.theme-night .reload-button,
body.theme-night .icon-button,
body.theme-night .secondary-button,
body.theme-night .row-action,
body.theme-night .search,
body.theme-night .form-stack input,
body.theme-night .form-stack select,
body.theme-night .form-stack textarea {
  color: var(--text);
  border-color: rgba(74, 142, 208, .30);
  background: #071829;
}

body.theme-night .reload-button,
body.theme-night .primary-button,
body.theme-night .export-button {
  color: #fff;
  background: linear-gradient(135deg, #126ed8, #0b94dd);
}

body.theme-night .metric.cyan { color: var(--cyan); border-color: rgba(0, 200, 255, .34); background: linear-gradient(135deg, rgba(3, 45, 58, .92), rgba(6, 17, 29, .96)); }
body.theme-night .metric.purple { color: var(--purple); border-color: rgba(141, 92, 255, .36); background: linear-gradient(135deg, rgba(32, 21, 70, .96), rgba(6, 17, 29, .96)); }
body.theme-night .metric.violet { color: #b59cff; border-color: rgba(181, 156, 255, .34); background: linear-gradient(135deg, rgba(21, 21, 58, .96), rgba(6, 17, 29, .96)); }
body.theme-night .metric.blue { color: var(--blue); border-color: rgba(32, 148, 255, .38); background: linear-gradient(135deg, rgba(7, 39, 75, .96), rgba(6, 17, 29, .96)); }
body.theme-night .metric.alert { color: var(--red); border-color: rgba(255, 65, 77, .36); background: linear-gradient(135deg, rgba(64, 15, 25, .92), rgba(6, 17, 29, .96)); }

body.theme-night .panel-head {
  border-bottom-color: rgba(74, 142, 208, .24);
  background: rgba(5, 19, 34, .58);
}

body.theme-night .online-map {
  background-image:
    linear-gradient(rgba(3, 14, 25, .22), rgba(3, 14, 25, .72)),
    var(--asset-sl-map, linear-gradient(transparent, transparent)),
    var(--asset-map-night, linear-gradient(transparent, transparent)),
    var(--asset-map-day, linear-gradient(transparent, transparent)),
    radial-gradient(ellipse at 54% 54%, rgba(14, 88, 122, .52), transparent 18%),
    radial-gradient(ellipse at 32% 58%, rgba(12, 80, 52, .48), transparent 22%),
    radial-gradient(ellipse at 74% 48%, rgba(20, 72, 114, .42), transparent 24%),
    linear-gradient(150deg, #061524, #020914 70%);
  background-size: cover;
  background-position: center;
}

body.theme-night .map-avatar,
body.theme-night .avatar-card,
body.theme-night .rank-item,
body.theme-night .config-list div,
body.theme-night .modal-stats div {
  color: var(--text);
  border-color: rgba(0, 224, 119, .30);
  background: linear-gradient(135deg, rgba(3, 22, 36, .88), rgba(4, 46, 45, .72));
}

body.theme-night td {
  color: var(--text);
}

body.theme-night th {
  color: var(--muted);
}

body.theme-night table {
  background: rgba(4, 13, 24, .56);
}
