/* ═══════════════════════════════════════════
   SpinTuN Panel — Neon Dark Theme
   ═══════════════════════════════════════════ */

:root {
  --bg: #050510;
  --bg2: #0a0a1a;
  --card: rgba(15, 15, 35, 0.7);
  --card-hover: rgba(25, 20, 55, 0.85);
  --border: rgba(140, 100, 255, 0.15);
  --border-hover: rgba(180, 120, 255, 0.4);

  --text: #e8e8ff;
  --muted: #7a7a9e;

  --purple: #a05cff;
  --purple-glow: rgba(160, 92, 255, 0.5);
  --green: #2ed573;
  --green-glow: rgba(46, 213, 115, 0.5);

  --accent: var(--purple);
  --accent2: var(--green);

  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(160, 92, 255, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ─── Animated Background ─── */
.bg-orbs {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(700px circle at 10% 15%, rgba(160,92,255,0.22), transparent 65%),
    radial-gradient(600px circle at 90% 85%, rgba(46,213,115,0.15), transparent 65%),
    radial-gradient(500px circle at 50% 50%, rgba(108,140,255,0.1), transparent 60%);
  filter: blur(30px);
  animation: orbsFloat 20s ease-in-out infinite;
}

@keyframes orbsFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.98); }
}

.bg-grid {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(160,92,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160,92,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ─── Top Bar ─── */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  background: rgba(5, 5, 16, 0.6);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  font-size: 32px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px var(--purple-glow));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px var(--purple-glow)); }
  50% { filter: drop-shadow(0 0 20px var(--green-glow)); }
}

.brand h1 { margin: 0; font-size: 20px; letter-spacing: 1.5px; }
.brand-gradient {
  background: linear-gradient(135deg, var(--purple), var(--green), var(--purple));
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradientMove 4s ease infinite;
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─── Pills ─── */
.status-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
  transition: all 0.3s ease;
}
.pill:hover { border-color: var(--border-hover); }
.pill.ok {
  color: var(--green);
  border-color: rgba(46,213,115,0.5);
  background: rgba(46,213,115,0.08);
  box-shadow: 0 0 15px rgba(46,213,115,0.2);
  animation: pillGlow 2s ease-in-out infinite;
}
.pill.bad {
  color: #ff4757;
  border-color: rgba(255,71,87,0.5);
  background: rgba(255,71,87,0.08);
}
.pill-logout {
  cursor: pointer;
  border-color: rgba(255,71,87,0.4) !important;
  color: #ff4757 !important;
  font-family: inherit;
}
.pill-logout:hover {
  background: rgba(255,71,87,0.15);
}

@keyframes pillGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(46,213,115,0.2); }
  50% { box-shadow: 0 0 25px rgba(46,213,115,0.4); }
}

/* ─── Wrap ─── */
.wrap {
  position: relative; z-index: 2;
  max-width: 1240px; margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex; flex-direction: column; gap: 24px;
}

/* ─── Card ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--green), transparent);
  animation: cardShine 5s linear infinite;
  opacity: 0.6;
}

@keyframes cardShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.card h2 {
  margin: 0 0 20px; font-size: 17px;
  color: var(--text);
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 10px;
}

/* ─── Grid & KV ─── */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.kv {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.kv:hover {
  background: rgba(160,92,255,0.05);
  border-color: rgba(160,92,255,0.3);
  transform: translateY(-2px);
}
.kv span {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 500;
}
.kv code {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--purple);
  word-break: break-all;
}
.kv code.code-ok {
  color: var(--green);
  text-shadow: 0 0 10px var(--green-glow);
}

/* ─── Input ─── */
.input {
  background: rgba(10, 10, 25, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.input:hover {
  border-color: rgba(160,92,255,0.3);
  background: rgba(15, 15, 35, 0.8);
}
.input:focus {
  border-color: var(--purple);
  background: rgba(20, 15, 40, 0.9);
  box-shadow: 0 0 0 4px rgba(160,92,255,0.15), 0 0 20px rgba(160,92,255,0.2);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a05cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 34px;
  cursor: pointer;
}
select.input option {
  background: #0a0a1a;
  color: var(--text);
  padding: 10px;
}

textarea.input {
  resize: vertical;
  min-height: 110px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.8;
  direction: ltr;
  text-align: left;
  padding: 12px 14px;
}

/* ─── Hint Box ─── */
.hint-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(160,92,255,0.08), rgba(46,213,115,0.08));
  border: 1px solid rgba(160,92,255,0.2);
  font-size: 12px;
  color: var(--muted);
}
.hint-box code {
  color: var(--green);
  font-family: ui-monospace, monospace;
  font-weight: 600;
  text-shadow: 0 0 8px var(--green-glow);
}

/* ─── Checkboxes ─── */
.checkboxes {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}
.chk {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid var(--border);
  font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chk:hover {
  background: rgba(160,92,255,0.08);
  border-color: rgba(160,92,255,0.35);
  transform: translateY(-2px);
}
.chk:has(input:checked) {
  background: linear-gradient(135deg, rgba(160,92,255,0.15), rgba(46,213,115,0.1));
  border-color: var(--purple);
  color: var(--text);
  box-shadow: 0 0 20px rgba(160,92,255,0.25);
}
.chk input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--purple);
  cursor: pointer;
  transition: transform 0.2s;
}
.chk:has(input:checked) input[type="checkbox"] {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px var(--purple-glow));
}
.chk input[type="checkbox"]:checked + span { color: var(--text); font-weight: 600; }

/* ─── Actions ─── */
.actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.btn {
  position: relative;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: 0.5px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(160,92,255,0.3);
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--green), var(--purple));
  opacity: 0;
  transition: opacity 0.4s;
}
.btn:hover::before { opacity: 1; }
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(160,92,255,0.5), 0 0 40px rgba(46,213,115,0.3);
}
.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(160,92,255,0.4);
}
.btn > * { position: relative; z-index: 1; }

.btn.ghost {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost::before { display: none; }
.btn.ghost:hover {
  background: rgba(160,92,255,0.1);
  border-color: var(--purple);
  box-shadow: 0 0 25px rgba(160,92,255,0.3);
  color: var(--text);
}

.btn.btn-neon {
  background: linear-gradient(135deg, #a05cff, #6c8cff, #2ed573);
  background-size: 200% 200%;
  animation: gradientMove 3s ease infinite;
}

.btn.btn-green {
  background: linear-gradient(135deg, var(--green), #26a65b);
  box-shadow: 0 4px 20px rgba(46,213,115,0.35);
}
.btn.btn-green:hover {
  box-shadow: 0 8px 30px rgba(46,213,115,0.5), 0 0 40px rgba(46,213,115,0.3);
}

/* ─── Row Between ─── */
.row-between {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
  flex-wrap: wrap;
}

.count-badge {
  font-size: 12px;
  color: var(--purple);
  background: rgba(160,92,255,0.15);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(160,92,255,0.3);
  margin-right: 8px;
}

/* ─── Search ─── */
.search {
  background: rgba(10, 10, 25, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 16px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; min-width: 220px;
  transition: all 0.3s;
}
.search:hover { border-color: rgba(160,92,255,0.3); }
.search:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(160,92,255,0.15);
}

/* ─── Links ─── */
.links {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.link-card {
  padding: 16px; border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.link-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(160,92,255,0.05), transparent);
  transition: left 0.6s;
}
.link-card:hover::before { left: 100%; }
.link-card:hover {
  border-color: var(--purple);
  background: rgba(160,92,255,0.05);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(160,92,255,0.2);
}

.link-head {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
  position: relative; z-index: 1;
}
.link-tag {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  word-break: break-all;
  letter-spacing: 0.3px;
}
.link-tag::before {
  content: '◈ ';
  color: var(--purple);
  text-shadow: 0 0 8px var(--purple-glow);
}
.link-badge {
  font-size: 10px; padding: 4px 10px;
  border-radius: 999px;
  background: rgba(108,140,255,0.15);
  color: #6c8cff;
  border: 1px solid rgba(108,140,255,0.3);
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.link-badge.tls {
  background: rgba(46,213,115,0.15);
  color: var(--green);
  border-color: rgba(46,213,115,0.4);
  box-shadow: 0 0 12px rgba(46,213,115,0.2);
}
.link-uri {
  font-family: ui-monospace, monospace;
  font-size: 10px; color: var(--muted);
  word-break: break-all;
  background: rgba(0,0,0,0.4);
  padding: 10px; border-radius: 10px;
  max-height: 62px; overflow: hidden;
  margin-bottom: 12px;
  direction: ltr; text-align: left;
  border: 1px solid rgba(255,255,255,0.05);
  transition: max-height 0.3s;
  position: relative; z-index: 1;
}
.link-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.link-actions button {
  flex: 1; padding: 8px 10px; font-size: 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.03); color: var(--text);
  cursor: pointer; font-family: inherit;
  font-weight: 500;
  transition: all 0.3s;
}
.link-actions button:hover {
  background: rgba(160,92,255,0.15);
  border-color: var(--purple);
  transform: translateY(-1px);
}
.link-actions button.primary {
  background: linear-gradient(135deg, rgba(160,92,255,0.2), rgba(46,213,115,0.15));
  color: var(--purple);
  border-color: rgba(160,92,255,0.4);
}
.link-actions button.primary:hover {
  background: linear-gradient(135deg, rgba(160,92,255,0.3), rgba(46,213,115,0.25));
  color: var(--text);
  box-shadow: 0 0 20px rgba(160,92,255,0.3);
}

/* ─── Source Buttons ─── */
.source-buttons {
  display: flex; gap: 12px;
  flex-wrap: wrap;
}
.src-btn {
  position: relative;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.src-btn:hover {
  background: rgba(160,92,255,0.1);
  border-color: rgba(160,92,255,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(160,92,255,0.2);
}
.src-btn.active {
  background: linear-gradient(135deg, rgba(160,92,255,0.25), rgba(46,213,115,0.2));
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 30px rgba(160,92,255,0.4), inset 0 0 20px rgba(46,213,115,0.15);
  animation: activePulse 2s ease-in-out infinite;
}
.src-btn.active::before {
  content: '✓ ';
  color: var(--green);
  text-shadow: 0 0 8px var(--green-glow);
}

@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 30px rgba(160,92,255,0.4), inset 0 0 20px rgba(46,213,115,0.15); }
  50% { box-shadow: 0 0 45px rgba(160,92,255,0.6), inset 0 0 25px rgba(46,213,115,0.25); }
}

/* ─── Steps ─── */
.step {
  margin: 16px 0; padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.step:hover { border-color: rgba(160,92,255,0.2); }
.step-title {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 10px;
}
.step-num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  color: #fff;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 0 15px var(--purple-glow);
}

/* ─── Port Grid ─── */
.port-grid {
  display: flex; flex-wrap: wrap;
  gap: 10px; align-items: center;
}
.port-chk {
  display: flex; align-items: center;
  gap: 8px; padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: ui-monospace, monospace;
  color: var(--text);
  cursor: pointer; user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.port-chk:hover {
  background: rgba(160,92,255,0.1);
  border-color: rgba(160,92,255,0.4);
  transform: translateY(-2px);
}
.port-chk:has(input:checked) {
  background: linear-gradient(135deg, rgba(160,92,255,0.2), rgba(46,213,115,0.15));
  border-color: var(--purple);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(160,92,255,0.3);
}
.port-chk input[type="checkbox"] {
  accent-color: var(--purple);
  cursor: pointer; margin: 0;
  width: 16px; height: 16px;
}

/* ─── Login ─── */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 80px rgba(160,92,255,0.3);
  display: flex; flex-direction: column; gap: 16px;
  animation: loginAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--green), var(--purple));
  background-size: 200% 100%;
  animation: gradientMove 3s linear infinite;
}

@keyframes loginAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  font-size: 60px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px var(--purple-glow));
  animation: logoPulse 3s ease-in-out infinite;
  line-height: 1;
}
.login-box h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 2px;
}
.login-sub {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.login-error {
  color: #ff4757;
  font-size: 12px;
  margin: 0;
  min-height: 18px;
  font-weight: 500;
}

/* ─── Subs List ─── */
.subs-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 18px;
}
.sub-card {
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.sub-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--purple), var(--green));
  opacity: 0.6;
}
.sub-card:hover {
  border-color: var(--purple);
  background: rgba(160,92,255,0.05);
  transform: translateX(-4px);
  box-shadow: 0 5px 30px rgba(160,92,255,0.15);
}
.sub-card-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}
.sub-card-head strong {
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.5px;
}
.sub-count {
  font-size: 11px;
  color: var(--green);
  background: rgba(46,213,115,0.12);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(46,213,115,0.3);
  font-weight: 600;
}
.sub-url-box {
  display: flex; gap: 8px; align-items: center;
}
.sub-input {
  flex: 1; font-size: 11px;
  direction: ltr; text-align: left;
}
.btn-icon {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer; color: var(--text);
  font-size: 14px;
  transition: all 0.3s;
}
.btn-icon:hover {
  background: rgba(160,92,255,0.15);
  border-color: var(--purple);
  transform: scale(1.05);
}
.btn-icon.danger {
  border-color: rgba(255,71,87,0.3);
  color: #ff4757;
}
.btn-icon.danger:hover {
  background: rgba(255,71,87,0.15);
  box-shadow: 0 0 15px rgba(255,71,87,0.3);
}
.sub-date {
  margin-top: 8px; font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ─── Warning ─── */
.warning-box {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,165,2,0.1), rgba(255,71,87,0.05));
  border: 1px solid rgba(255,165,2,0.4);
  border-radius: 14px;
  color: #ffa502;
  font-size: 13px;
  line-height: 1.7;
  animation: warningPulse 2s ease-in-out infinite;
}
@keyframes warningPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,165,2,0); }
  50% { box-shadow: 0 0 25px rgba(255,165,2,0.2); }
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 35, 0.95);
  border: 1px solid var(--purple);
  padding: 12px 24px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 30px rgba(160,92,255,0.3);
  animation: toastAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  letter-spacing: 0.5px;
}
.toast.hidden { display: none; }

@keyframes toastAppear {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hidden { display: none !important; }
.muted-text {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0;
}
.center-text { text-align: center; padding: 20px; }

/* ─── Health Grid ─── */
.health-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.health-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.health-card:hover {
  border-color: var(--purple);
  background: rgba(160,92,255,0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(160,92,255,0.15);
}

.health-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}
.health-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 6px var(--purple-glow));
}

.health-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px dashed rgba(120,140,200,0.08);
}
.health-row:last-child { border-bottom: none; }
.health-row > span:first-child {
  color: var(--muted);
}

.health-value {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}
.status-badge.ok {
  background: rgba(46,213,115,0.15);
  color: var(--green);
  border: 1px solid rgba(46,213,115,0.4);
  box-shadow: 0 0 12px rgba(46,213,115,0.2);
}
.status-badge.bad {
  background: rgba(255,71,87,0.15);
  color: #ff4757;
  border: 1px solid rgba(255,71,87,0.4);
}

.health-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(120,140,200,0.1);
}

/* ─── Subs Mini List ─── */
.subs-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sub-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  font-size: 12px;
  transition: all 0.3s;
}
.sub-mini:hover {
  background: rgba(160,92,255,0.08);
  border-color: var(--purple);
}
.sub-mini strong { color: var(--text); }
.sub-mini-count {
  font-size: 11px;
  color: var(--green);
  background: rgba(46,213,115,0.12);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.sub-mini-date {
  font-size: 10px;
  color: var(--muted);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--purple), var(--green));
  border-radius: 5px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--green), var(--purple));
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .top {
    padding: 14px 18px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .brand h1 { font-size: 17px; }
  .wrap { padding: 20px 14px 60px; }
  .card { padding: 18px; }
  .links { grid-template-columns: 1fr; }
  .source-buttons { flex-direction: column; }
  .src-btn { width: 100%; }
  .search { min-width: 0; width: 100%; }
  .row-between { flex-direction: column; align-items: stretch; }
  .sub-url-box { flex-direction: column; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .login-box { padding: 30px 24px; }
  .health-grid { grid-template-columns: 1fr; }
}
