:root {
  --bg: #07080b;
  --bg-2: #0f1116;
  --bg-3: #161922;
  --border: #1f232c;
  --text: #ffffff;
  --text-dim: #6b7382;
  --accent: #ff5b3a;
  --accent-2: #ff8a4c;
  --green: #34d399;
  --red: #ef4444;
  --grid-line: rgba(255, 255, 255, 0.04);
}

:root[data-theme='light'] {
  --bg: #f5f6f9;
  --bg-2: #ffffff;
  --bg-3: #eef0f5;
  --border: #d9dde5;
  --text: #0f1116;
  --text-dim: #5a6373;
  --accent: #ff5b3a;
  --accent-2: #ff8a4c;
  --green: #059669;
  --red: #dc2626;
  --grid-line: rgba(0, 0, 0, 0.05);
}

.theme-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  background: var(--bg-3);
  transform: translateY(-1px);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
}
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme='light'] .theme-toggle .icon-moon {
  display: none;
}
:root[data-theme='light'] .theme-toggle .icon-sun {
  display: block;
}

.help-link {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.help-link:hover {
  background: var(--bg-3);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.help-link svg {
  color: var(--accent);
}
@media (max-width: 480px) {
  .help-link span {
    display: none;
  }
  .help-link {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

body {
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(800px 600px at 15% -10%, rgba(46, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 110% 0%, rgba(255, 91, 58, 0.18), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(168, 85, 247, 0.12), transparent 60%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);
  pointer-events: none;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  animation: bg-shimmer 32s ease-in-out infinite;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orb-float 22s ease-in-out infinite, orb-pulse 14s ease-in-out infinite;
}
.bg-orb.o1 {
  width: 380px;
  height: 380px;
  background: #ff5b3a;
  top: -120px;
  left: -120px;
  animation-delay: 0s;
}
.bg-orb.o2 {
  width: 460px;
  height: 460px;
  background: #2e5cff;
  top: 20%;
  right: -180px;
  animation-delay: -7s;
}
.bg-orb.o3 {
  width: 320px;
  height: 320px;
  background: #a855f7;
  bottom: -160px;
  left: 30%;
  animation-delay: -14s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}
@keyframes orb-pulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.58; }
}
@keyframes bg-shimmer {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-orb,
  .bg-orbs { animation: none; }
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* hero */
.hero {
  padding: 100px 20px 40px;
  text-align: center;
}
.hero-title {
  margin: 0 0 18px;
  font-size: clamp(56px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}
.hero-stats {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 18px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.hero-btn:hover {
  background: var(--bg-3);
  border-color: var(--accent);
}
.hero-btn:active {
  transform: scale(0.98);
}
.hero-btn svg {
  color: var(--accent);
}
.search-wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 18px 22px 18px 56px;
  background: rgba(20, 23, 30, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  backdrop-filter: blur(8px);
}
.search-input::placeholder {
  color: var(--text-dim);
}
.search-input:focus {
  border-color: var(--accent);
  background: rgba(20, 23, 30, 0.9);
}

/* list section */
.list-section {
  padding-top: 30px;
}
.section-title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dim);
}

.top-section {
  margin-bottom: 36px;
}
.top-section.hidden {
  display: none;
}
.top-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* rank highlights */
.server-card.rank-1 {
  border-color: rgba(255, 196, 0, 0.5);
  background: linear-gradient(180deg, rgba(255, 196, 0, 0.08), rgba(20, 23, 30, 0.65));
  box-shadow: 0 0 0 1px rgba(255, 196, 0, 0.18), 0 12px 40px rgba(255, 196, 0, 0.08);
}
.server-card.rank-1::before {
  background: radial-gradient(circle at top right, rgba(255, 196, 0, 0.18), transparent 60%);
}
.server-card.rank-2 {
  border-color: rgba(190, 200, 215, 0.4);
  background: linear-gradient(180deg, rgba(190, 200, 215, 0.06), rgba(20, 23, 30, 0.65));
}
.server-card.rank-2::before {
  background: radial-gradient(circle at top right, rgba(190, 200, 215, 0.14), transparent 60%);
}
.server-card.rank-3 {
  border-color: rgba(205, 127, 50, 0.45);
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.06), rgba(20, 23, 30, 0.65));
}
.server-card.rank-3::before {
  background: radial-gradient(circle at top right, rgba(205, 127, 50, 0.16), transparent 60%);
}

.rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #1a1300;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.rank-badge-1 {
  background: linear-gradient(135deg, #ffd84d, #ffb300);
  color: #1a1300;
}
.rank-badge-2 {
  background: linear-gradient(135deg, #e6ecf5, #aab4c4);
  color: #1a1f2a;
}
.rank-badge-3 {
  background: linear-gradient(135deg, #e9a26b, #b8753a);
  color: #1a1100;
}
.server-card.rank-1 .status-dot,
.server-card.rank-2 .status-dot,
.server-card.rank-3 .status-dot {
  display: none;
}

/* server list */
.server-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}
.loading,
.empty,
.error {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  grid-column: 1 / -1;
}
.error {
  color: var(--red);
}

.server-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(20, 23, 30, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.server-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 91, 58, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.server-card:hover {
  border-color: rgba(255, 91, 58, 0.5);
  transform: translateY(-3px);
  background: rgba(24, 27, 35, 0.85);
}
.server-card:hover::before {
  opacity: 1;
}
.server-card.offline {
  opacity: 0.65;
}
.server-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.server-card-icon {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.server-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.icon-placeholder {
  font-weight: 800;
  color: var(--text-dim);
  font-size: 20px;
}
.server-card-name {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.on {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.status-pill.off {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: status-dot-pulse 1.6s ease-out infinite;
}
.status-dot.off {
  background: var(--red);
  opacity: 0.7;
}
@keyframes status-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot.on {
    animation: none;
  }
}
.server-card-address {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 7px 11px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: text;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, color 0.15s ease;
}
.server-card-address:hover {
  background: var(--bg-2);
  border-color: var(--accent);
}
.server-card-address:active {
  transform: scale(0.98);
}
.server-card-address.copied {
  border-color: var(--green);
  color: var(--green);
}
.server-card-address.copied::after {
  content: 'Скопировано';
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.server-card-address .address-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-card-address .address-copy-icon {
  display: inline-flex;
  color: var(--text-dim);
  flex-shrink: 0;
}
.server-card-address:hover .address-copy-icon {
  color: var(--accent);
}
.server-card-address.copied .address-copy-icon {
  display: none;
}
.server-card-bottom {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-online {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-online-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.card-online-label {
  font-size: 13px;
  color: var(--text-dim);
}
.card-online-value {
  font-size: 14px;
}
.card-online-value b {
  font-size: 18px;
  color: var(--green);
  font-weight: 700;
}
.card-online-max {
  color: var(--text-dim);
}
.card-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #34d399);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.card-spark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}
.card-spark-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.card-spark-graph {
  flex: 1;
  height: 50px;
  display: flex;
  align-items: stretch;
}
.spark-svg {
  width: 100%;
  height: 100%;
}
.spark-empty {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  align-self: center;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head .section-title {
  margin: 0;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-weight: 600;
  font-size: 14px;
}

/* detail page */
.detail-wrap {
  padding-top: 40px;
}
.back-link {
  display: inline-block;
  margin: 0 0 18px;
  color: var(--text-dim);
}
.back-link:hover {
  color: var(--text);
}

.server-card-detail {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 40px;
}
.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-title h1 {
  margin: 0;
  font-size: 24px;
}

.detail-address-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.address-box {
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}
.copy-btn {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
}
.copy-btn:hover {
  background: var(--accent-2);
}

.detail-motd {
  background: var(--bg-3);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 18px;
  color: var(--text-dim);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.grid-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.grid-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.grid-value {
  font-size: 18px;
  font-weight: 700;
}
.grid-value.small {
  font-size: 13px;
  font-weight: 500;
}

.detail-section {
  margin-top: 20px;
}
.detail-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* chart */
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.chart-head h2 {
  margin: 0;
}
.range-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.range-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.range-tab:hover {
  color: var(--text);
}
.range-tab.active {
  background: var(--accent);
  color: #fff;
}
.chart-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 240px;
}
.chart-loading {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 12px;
  font-size: 13px;
}
.chart-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.chart-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chart-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.chart-stat-value {
  font-size: 20px;
  font-weight: 700;
}
.chart-svg {
  width: 100%;
  height: 240px;
  display: block;
}
.detail-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.link-btn {
  padding: 10px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--text-dim);
  text-align: center;
  font-size: 13px;
}

/* buttons (shared) */
.btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-2);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--text-dim);
}
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-title {
  margin: 0 0 4px;
  font-size: 20px;
  text-align: center;
}
.login-input {
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.login-input:focus {
  border-color: var(--accent);
}
.login-btn {
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.login-btn:hover {
  background: var(--accent-2);
}
.login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

/* admin */
.admin-wrap {
  padding: 30px 20px 60px;
}
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.admin-header h1 {
  margin: 6px 0 0;
  font-size: 28px;
}
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-section-head h2 {
  margin: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.admin-row-name {
  font-weight: 600;
}
.admin-row-name .muted {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 13px;
  margin-left: 6px;
}
.admin-row-host {
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  margin-top: 2px;
}
.admin-row-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-row-stats .muted {
  color: var(--text-dim);
  font-size: 13px;
}
.admin-row-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 640px) {
  .admin-row {
    grid-template-columns: 1fr;
  }
  .admin-row-actions {
    justify-content: flex-end;
  }
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.modal-close:hover {
  color: var(--text);
}

.server-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.server-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.server-form input,
.server-form textarea {
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.server-form input:focus,
.server-form textarea:focus {
  border-color: var(--accent);
}

/* compare modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-window {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(900px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--bg-3);
  color: var(--text);
}
.modal-body {
  padding: 20px 22px 22px;
  overflow-y: auto;
}
.compare-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.compare-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.compare-select select {
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
}
.compare-select select:focus {
  border-color: var(--accent);
}
#compare-range {
  margin-bottom: 14px;
}
.compare-chart-wrap {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.compare-chart {
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-chart .loading,
.compare-chart .empty,
.compare-chart .error {
  color: var(--text-dim);
  font-size: 14px;
}
.compare-chart .error {
  color: var(--red);
}
.compare-svg {
  width: 100%;
  height: auto;
  max-height: 360px;
  display: block;
}
.compare-svg .axis-text {
  fill: var(--text-dim);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.compare-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.compare-stats .stats-head {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stats-table th,
.stats-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.stats-table th {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dim);
}
.stats-table td.row-title {
  color: var(--text-dim);
  font-size: 13px;
}
.stats-table td.row-val {
  font-weight: 700;
}
.stats-table td.row-val .legend-dot {
  margin-right: 8px;
  vertical-align: middle;
}
.stats-table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 640px) {
  .compare-selects {
    grid-template-columns: 1fr;
  }
  .modal-body {
    padding: 16px;
  }
  .stats-table th,
  .stats-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
}
.server-form input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.server-form textarea {
  resize: vertical;
  min-height: 70px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}
@media (max-width: 480px) {
  .row-2 {
    grid-template-columns: 1fr;
  }
}
.form-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
