/* ===== Page live status ===== */
.status-page {
  --live-accent: var(--accent, #2f7a3e);
  --live-accent-strong: #1f5f2e;
  --live-accent-soft: #e9f7ed;
  --live-border: #dfe7df;
  --live-text: #152018;
  --live-muted: #617063;
  --live-surface: #ffffff;
  --live-surface-soft: #f7faf8;
  --live-danger: #b42318;
  --live-danger-soft: #fdecec;
  --live-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.status-main {
  padding-block: clamp(1.2rem, 2vw, 2rem) 2.5rem;
}

.live-section {
  display: grid;
  gap: 1.2rem;
}

.live-hero {
  padding: clamp(1.15rem, 2vw, 1.5rem);
  border: 1px solid var(--live-border);
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(47, 122, 62, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  box-shadow: var(--live-shadow);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--live-accent);
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
}

.page-intro {
  margin: 0.55rem 0 0;
  max-width: 72ch;
  color: var(--live-muted);
  line-height: 1.65;
}

/* ===== Toolbar ===== */
.live-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.05rem;
  border: 1px solid var(--live-border);
  border-radius: 1.15rem;
  background: var(--live-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.meters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.meter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--live-border);
  background: var(--live-surface-soft);
  color: var(--live-text);
  font-size: 0.98rem;
  line-height: 1;
}

.meter strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.meter-updated {
  color: var(--live-muted);
}

.meter-ico {
  font-size: 1rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  user-select: none;
  color: var(--live-text);
  font-weight: 600;
  cursor: pointer;
}

.toggle input {
  appearance: none;
  width: 2.7rem;
  height: 1.55rem;
  border-radius: 999px;
  position: relative;
  background: #e5e7eb;
  border: 1px solid #d0d5dd;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 0.16rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.toggle input:checked {
  background: var(--live-accent);
  border-color: var(--live-accent);
}

.toggle input:checked::after {
  transform: translateX(1.1rem);
}

.btn-live {
  appearance: none;
  border: 1px solid var(--live-accent);
  background: var(--live-accent);
  color: #fff;
  border-radius: 0.85rem;
  padding: 0.78rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  box-shadow: 0 10px 24px rgba(47, 122, 62, 0.18);
}

.btn-live:hover {
  transform: translateY(-1px);
  background: var(--live-accent-strong);
  border-color: var(--live-accent-strong);
}

.btn-live.is-active {
  background: var(--live-accent-strong);
  border-color: var(--live-accent-strong);
}

/* ===== Layout ===== */
.status-layout {
  display: grid;
  grid-template-columns: minmax(430px, 500px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  border: 1px solid var(--live-border);
  border-radius: 1.25rem;
  background: var(--live-surface);
  box-shadow: var(--live-shadow);
  overflow: clip;
}

.panel-servers {
  position: sticky;
  top: 1rem;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.4rem;
}

.card-title {
  margin: 0;
  color: var(--live-text);
  font-size: 1.1rem;
}

.card-subtitle {
  margin: 0.28rem 0 0;
  color: var(--live-muted);
  font-size: 0.94rem;
}

/* ===== Server list ===== */
.servers-chooser {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.server-item {
  width: 100%;
  text-align: left;
  padding: 0.95rem;
  border: 1px solid var(--live-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.server-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--live-accent) 35%, var(--live-border));
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.server-item[aria-pressed="true"] {
  border-color: var(--live-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live-accent) 15%, transparent);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf5 100%);
}

.server-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.server-item-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.server-name {
  font-size: 1rem;
  font-weight: 750;
  color: var(--live-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03);
}

.dot.on {
  background: #12b76a;
}

.dot.off {
  background: #f04438;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.online {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.status-badge.offline {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.status-badge.big {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}

.server-meta {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.server-capacity {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  background: #f3f6f4;
  color: #33443a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  background: var(--live-accent-soft);
  color: var(--live-accent-strong);
  border: 1px solid color-mix(in srgb, var(--live-accent) 18%, transparent);
  font-size: 0.85rem;
  font-weight: 600;
}

.server-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
  color: var(--live-muted);
  font-size: 0.9rem;
}

.kv {
  white-space: nowrap;
}

.progress {
  width: 100%;
  height: 0.52rem;
  border-radius: 999px;
  background: #edf2ee;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58b368 0%, #2f7a3e 100%);
}

/* ===== Right side ===== */
.players-list {
  padding: 1rem;
  min-height: 420px;
}

.traffic-detail,
.all-traffic {
  display: grid;
  gap: 1rem;
}

.traffic-hero {
  padding: 1rem;
  border: 1px solid var(--live-border);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
}

.traffic-hero-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.traffic-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--live-text);
}

.traffic-subtitle {
  margin: 0.35rem 0 0;
  color: var(--live-muted);
  line-height: 1.55;
}

.traffic-progress {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.traffic-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--live-muted);
  font-size: 0.95rem;
}

.traffic-progress-label strong {
  color: var(--live-text);
  font-size: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.summary-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--live-border);
  border-radius: 1rem;
  background: var(--live-surface);
}

.summary-card-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--live-accent-soft);
  color: var(--live-accent-strong);
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.summary-card-content {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.summary-card-label {
  color: var(--live-muted);
  font-size: 0.9rem;
}

.summary-card-value {
  color: var(--live-text);
  font-size: 1.15rem;
  line-height: 1.25;
  word-break: break-word;
}

.summary-card-note {
  color: var(--live-muted);
  font-size: 0.82rem;
}

/* ===== Global cards ===== */
.all-traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 0.9rem;
}

.traffic-server-card {
  border: 1px solid var(--live-border);
  border-radius: 1rem;
  background: var(--live-surface);
  padding: 1rem;
}

.traffic-server-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.traffic-server-card-head h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--live-text);
}

.traffic-server-card-infos {
  display: grid;
  gap: 0.7rem;
}

.traffic-server-card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--live-muted);
  font-size: 0.93rem;
}

.traffic-server-card-line strong {
  color: var(--live-text);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.traffic-server-card-meta {
  margin: 0;
  color: var(--live-muted);
  font-size: 0.88rem;
}

/* ===== Notes / Empty / Error ===== */
.public-note {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px dashed #cfe3d3;
  background: #f7fcf8;
  color: var(--live-muted);
  line-height: 1.55;
}

.empty-state,
.error-state {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  padding: 1.1rem;
  border-radius: 1rem;
  border: 1px dashed var(--live-border);
  background: var(--live-surface-soft);
  color: var(--live-muted);
}

.empty-state strong,
.error-state strong {
  color: var(--live-text);
}

.empty-state p,
.error-state p {
  margin: 0;
  line-height: 1.55;
}

.empty-state-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: #eef4ef;
  font-size: 1.2rem;
}

.error-state {
  border-color: #f3c7c2;
  background: var(--live-danger-soft);
}

.error-state strong {
  color: var(--live-danger);
}

/* ===== Skeleton ===== */
.server-skeleton,
.card-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: #edf1ee;
}

.server-skeleton {
  height: 132px;
}

.card-skeleton {
  min-height: 112px;
}

.server-skeleton::after,
.card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 100%
  );
  animation: shimmer 1.15s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .status-layout {
    grid-template-columns: 1fr;
  }

  .panel-servers {
    position: static;
  }
}

@media (max-width: 720px) {
  .live-toolbar {
    padding: 0.9rem;
  }

  .meters,
  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions {
    justify-content: space-between;
  }

  .traffic-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .all-traffic-grid {
    grid-template-columns: 1fr;
  }

  .players-list,
  .servers-chooser {
    padding: 0.9rem;
  }

  .server-item,
  .summary-card,
  .traffic-server-card,
  .traffic-hero {
    padding: 0.9rem;
  }
}