:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa7b8;
  --accent: #3b82f6;
  --accent2: #22c55e;
  --danger: #ef4444;
  --border: #2a3648;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[lang="fa"], body.lang-fa {
  font-family: "Vazirmatn", "Tahoma", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #1e3a5f55, transparent), var(--bg);
  color: var(--text); min-height: 100vh;
}
.top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.4rem; border-bottom: 1px solid var(--border);
  background: #0c1118cc; backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; flex-direction: column; min-width: 140px; }
.logo { font-weight: 800; letter-spacing: 0.02em; }
.sub { color: var(--muted); font-size: 0.8rem; }
nav { display: flex; gap: 0.4rem; flex: 1; }
.nav, button {
  border: 1px solid var(--border); background: #121a24; color: var(--text);
  border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer;
}
.nav.active, .primary { background: var(--accent); border-color: transparent; color: white; }
.secondary { background: #243247; }
.ghost { background: transparent; }
.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.lang-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; background: #0e1520;
}
.lang-btn {
  border: none; border-radius: 0; padding: 0.35rem 0.65rem; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em;
}
.lang-btn.active { background: var(--accent); color: #fff; }
#btn-apply { background: var(--accent2); border-color: transparent; color: #04140a; font-weight: 700; }
main { max-width: 980px; margin: 1.4rem auto; padding: 0 1rem 3rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: 0 10px 40px #0004;
}
.hidden { display: none !important; }
h1, h2 { margin: 0 0 0.8rem; font-size: 1.25rem; }
.muted { color: var(--muted); }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
label { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.55rem 0; font-size: 0.9rem; color: var(--muted); }
label.chk { flex-direction: row; align-items: center; }
input, textarea, select {
  background: #0e1520; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 0.55rem 0.7rem; font: inherit;
}
.list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.8rem; }
.item {
  display: flex; justify-content: space-between; gap: 0.8rem; align-items: center;
  padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: #121a25;
}
.item .meta { color: var(--muted); font-size: 0.85rem; }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem;
  background: #334155; color: #e2e8f0;
}
.badge.block { background: #7f1d1d; }
.badge.bypass { background: #14532d; }
.err { color: var(--danger); min-height: 1.2rem; }
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: #0b1220; border: 1px solid var(--border); padding: 0.7rem 1.1rem;
  border-radius: 999px; z-index: 50; max-width: 90vw;
}
.toast.ok { border-color: #166534; }
.toast.bad { border-color: #991b1b; }
dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  padding: 1.1rem; width: min(420px, 92vw);
}
dialog::backdrop { background: #000a; }

.logo-link { color: inherit; text-decoration: none; }
.whoami { font-size: 0.8rem; margin-inline-end: 0.35rem; }
.app-body .top { gap: 0.75rem; }
