:root {
  --bg: #0c0c14;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #ececf1;
  --text-2: #a1a1b5;
  --text-3: #6b6b80;
  --accent: #7c5cfc;
  --accent-2: #a78bfa;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --tg-blue: #2AABEE;
  --tg-glow: rgba(42, 171, 238, 0.2);
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --r: 16px;
  --r-sm: 10px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient glow blobs */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.glow--1 {
  width: 420px; height: 420px;
  background: var(--accent);
  top: -120px; left: -100px;
}
.glow--2 {
  width: 350px; height: 350px;
  background: var(--tg-blue);
  bottom: -80px; right: -80px;
  opacity: 0.2;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 72px 0 48px;
}

.hero__badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(124, 92, 252, 0.12);
  border: 1px solid rgba(124, 92, 252, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero__accent {
  background: linear-gradient(135deg, var(--accent), var(--tg-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  font-size: 16px;
  color: var(--text-2);
  max-width: 360px;
  margin: 0 auto;
}

/* ========== Status bar ========== */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-2);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--fresh { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.status-dot--stale { background: var(--yellow); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.status-dot--empty { background: var(--text-3); }

/* ========== Section ========== */
.section { margin-bottom: 32px; }

.section__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 14px;
  padding-left: 2px;
}

/* ========== Proxy list & cards ========== */
.proxy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proxy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  transition: border-color 0.25s, background 0.25s;
}
.proxy-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.proxy-card__actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.proxy-card__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}
.proxy-card__toggle:hover { color: var(--text-2); }
.proxy-card__toggle svg {
  width: 14px; height: 14px;
  transition: transform 0.25s;
}
.proxy-card__toggle--open svg { transform: rotate(180deg); }

.proxy-card__details {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.proxy-card__details--open { display: block; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.detail-row + .detail-row {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.detail-row__label {
  font-size: 13px;
  color: var(--text-3);
}
.detail-row__value {
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-2);
  word-break: break-all;
  text-align: right;
  max-width: 65%;
}

.proxy-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.proxy-card__badge span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
  flex: 1;
}
.btn--primary:hover {
  box-shadow: 0 6px 28px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  flex: 1;
}
.btn--ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn--telegram {
  background: linear-gradient(135deg, #2AABEE, #1e96cc);
  color: #fff;
  box-shadow: 0 4px 16px var(--tg-glow);
  padding: 12px 28px;
  white-space: nowrap;
}
.btn--telegram:hover {
  box-shadow: 0 6px 24px rgba(42, 171, 238, 0.35);
  transform: translateY(-1px);
}

.btn--full { width: 100%; }

/* ========== CTA Card (bot) ========== */
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
}

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

.cta-card__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cta-card__desc {
  font-size: 13px;
  color: var(--text-3);
}

/* ========== Empty state ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty-state__icon { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }
.empty-state__text { font-size: 15px; line-height: 1.6; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e1e2e;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 28px;
  border-radius: var(--r-sm);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 28px 0;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.footer span { font-weight: 600; color: var(--text-2); }

/* ========== Skeleton ========== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r);
  height: 140px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== Responsive ========== */
@media (max-width: 520px) {
  .hero { padding: 52px 0 36px; }
  .hero__title { font-size: 30px; }
  .hero__desc { font-size: 15px; }

  .proxy-card__actions { flex-direction: column; }

  .cta-card__inner { flex-direction: column; text-align: center; }
  .cta-card__inner .btn--telegram { width: 100%; }

  .glow--1 { width: 260px; height: 260px; }
  .glow--2 { width: 200px; height: 200px; }
}

/* ====================== */
/* ===  Admin styles  === */
/* ====================== */

.admin-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.login-card {
  max-width: 380px;
  margin: 120px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px;
  text-align: center;
}

.login-card__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--tg-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card__subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group { margin-bottom: 16px; text-align: left; }
.form-group__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  min-height: 100px;
}
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-text { color: var(--red); font-size: 13px; margin-top: 8px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-header__title { font-size: 20px; font-weight: 700; }

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}
.admin-section__title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.admin-proxy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
}
.admin-proxy-item:last-child { margin-bottom: 0; }
.admin-proxy-item__info { flex: 1; min-width: 0; }
.admin-proxy-item__name { font-weight: 500; font-size: 14px; }
.admin-proxy-item__details {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'SF Mono', 'Fira Code', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn--danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--red);
  padding: 6px 12px;
  font-size: 13px;
}
.btn--danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn--secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn--secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.btn--small { padding: 6px 12px; font-size: 13px; }

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
@media (max-width: 600px) {
  .inline-form { grid-template-columns: 1fr; }
}
