@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #0b1220;
  --bg-soft: #111a2b;
  --surface: rgba(10, 17, 29, 0.78);
  --surface-strong: rgba(13, 22, 37, 0.92);
  --surface-elevated: rgba(20, 32, 51, 0.96);
  --surface-glass: rgba(255, 255, 255, 0.06);
  --border: rgba(160, 182, 214, 0.16);
  --border-strong: rgba(160, 182, 214, 0.28);
  --text: #e8eef8;
  --text-soft: #a7b8d1;
  --text-dim: #7e90ab;
  --brand: #f0a34a;
  --brand-strong: #ffbf6b;
  --accent: #37c6a3;
  --accent-strong: #5fe0c1;
  --danger: #ff7b7b;
  --danger-soft: rgba(255, 123, 123, 0.14);
  --success: #65d48c;
  --success-soft: rgba(101, 212, 140, 0.14);
  --info-soft: rgba(240, 163, 74, 0.14);
  --shadow-xl: 0 32px 90px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(55, 198, 163, 0.18), transparent 24rem),
    radial-gradient(circle at 88% 14%, rgba(240, 163, 74, 0.18), transparent 22rem),
    radial-gradient(circle at 50% 100%, rgba(100, 125, 255, 0.16), transparent 30rem),
    linear-gradient(180deg, #09111d 0%, #0b1220 46%, #070d17 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 92%);
  opacity: 0.22;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 14, 24, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(95, 224, 193, 0.55);
  box-shadow:
    0 0 0 3px rgba(95, 224, 193, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

pre,
code {
  font-family: "Cascadia Code", "Consolas", monospace;
}

.admin-page {
  padding: 24px;
}

.admin-shell {
  width: min(1620px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.side-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
}

.content-stage {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel,
.auth-card,
.side-card,
.hero-panel,
.topbar {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.panel::before,
.auth-card::before,
.side-card::before,
.hero-panel::before,
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%, transparent 60%, rgba(95, 224, 193, 0.07));
  opacity: 0.8;
}

.panel,
.auth-card,
.side-card {
  padding: 24px;
}

.auth-card {
  width: min(34rem, 100%);
}

.topbar {
  width: min(1540px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.topbar h1,
.panel h2,
.hero-panel h2,
.auth-card h1,
.side-card h2 {
  margin: 0;
  line-height: 1.3;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.muted,
.section-subtitle,
.hero-text,
.side-description {
  color: var(--text-soft);
}

.side-card--brand {
  background:
    radial-gradient(circle at top right, rgba(240, 163, 74, 0.18), transparent 15rem),
    radial-gradient(circle at bottom left, rgba(55, 198, 163, 0.18), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--surface-strong);
}

.side-card--brand h1 {
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  margin-bottom: 0.9rem;
}

.status-ribbon {
  margin-top: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(95, 224, 193, 0.25);
  background: rgba(95, 224, 193, 0.1);
  color: #dffcf4;
  font-size: 0.92rem;
  font-weight: 600;
}

.status-ribbon::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 6px rgba(95, 224, 193, 0.15);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 1.15rem;
}

.section-heading.compact {
  margin-bottom: 0.9rem;
}

.section-heading h2 {
  font-size: 1.08rem;
}

.section-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 163, 74, 0.3);
  background: rgba(240, 163, 74, 0.08);
}

.hero-panel {
  padding: 28px 30px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.35rem);
  margin-bottom: 0.85rem;
}

.hero-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.95;
}

.hero-actions,
.topbar-actions,
.inline-actions,
.section-actions,
.toolbar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-actions {
  justify-content: flex-end;
  align-items: center;
  max-width: 420px;
}

.layout {
  width: min(1540px, calc(100% - 48px));
  margin: 20px auto 32px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.panel {
  min-width: 0;
}

.section-panel {
  border-radius: 24px;
}

.section-panel::after,
.hero-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 170px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-strong), var(--brand-strong));
}

.hero-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.stat-card {
  position: relative;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(11, 19, 31, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-card span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.stat-card strong {
  font-size: 1.35rem;
  color: #fff3dd;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field > span {
  color: #eff5ff;
  font-size: 0.9rem;
  font-weight: 600;
}

.field.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.grid {
  display: grid;
  gap: 14px;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: grid;
}

.gap-md {
  gap: 16px;
}

.gap-sm {
  gap: 10px;
}

.compact {
  margin-top: 0;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #15100a;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 12px 30px rgba(240, 163, 74, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 16px 36px rgba(240, 163, 74, 0.32);
}

.btn-secondary {
  color: #dcfff7;
  background: rgba(55, 198, 163, 0.12);
  border-color: rgba(55, 198, 163, 0.22);
}

.btn-secondary:hover {
  background: rgba(55, 198, 163, 0.18);
  border-color: rgba(95, 224, 193, 0.4);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  color: #ffe8e8;
  background: var(--danger-soft);
  border-color: rgba(255, 123, 123, 0.18);
}

.btn-danger:hover {
  background: rgba(255, 123, 123, 0.18);
}

.toolbar {
  align-items: center;
}

.toolbar input,
.toolbar select {
  flex: 1 1 14rem;
}

.list-grid,
.audit-list,
.tester-preset-groups,
.tester-group__items {
  display: grid;
  gap: 14px;
}

.list-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.item-card,
.tester-preset-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(10, 17, 28, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.item-card::after,
.tester-preset-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.item-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0.7rem;
}

.item-card__header strong {
  font-size: 1rem;
}

.item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0.65rem 0 0.95rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(95, 224, 193, 0.18);
  background: rgba(95, 224, 193, 0.1);
  color: #defdf5;
  font-size: 0.8rem;
  font-weight: 700;
}

.compact-pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.28)),
    rgba(7, 11, 18, 0.95);
  color: #d7e7ff;
}

.preview-box {
  min-height: 180px;
}

.hidden {
  display: none !important;
}

.message-panel {
  padding: 18px 20px;
  border-radius: 18px;
}

.panel.info,
.info {
  border-color: rgba(240, 163, 74, 0.2);
  background:
    linear-gradient(180deg, rgba(240, 163, 74, 0.12), rgba(240, 163, 74, 0.05)),
    var(--surface-strong);
  color: #ffeccd;
}

.panel.error,
.error,
.error-box {
  border-color: rgba(255, 123, 123, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 123, 123, 0.14), rgba(255, 123, 123, 0.06)),
    var(--surface-strong);
  color: #ffe1e1;
}

.panel.success,
.success {
  border-color: rgba(101, 212, 140, 0.22);
  background:
    linear-gradient(180deg, rgba(101, 212, 140, 0.15), rgba(101, 212, 140, 0.06)),
    var(--surface-strong);
  color: #e1ffe9;
}

.audit-layout {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.audit-card-button {
  text-align: inherit;
  font: inherit;
  cursor: pointer;
}

.audit-card-button:hover,
.tester-preset-card:hover {
  border-color: rgba(240, 163, 74, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
}

.audit-detail {
  margin-top: 0.35rem;
}

.audit-detail-grid {
  display: grid;
  gap: 14px;
}

.tester-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1.25fr);
}

.tester-sidebar,
.tester-main {
  align-self: start;
}

.tester-main {
  display: grid;
  gap: 20px;
}

.tester-group {
  display: grid;
  gap: 12px;
}

.tester-group__header {
  color: var(--brand-strong);
}

.tester-response-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.tester-stats {
  margin-bottom: 1rem;
}

.tester-label {
  margin-bottom: 0.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.tester-response-body {
  min-height: 20rem;
}

.kv-grid {
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
}

.kv-grid span {
  color: var(--text-dim);
}

.section-actions {
  margin-top: 0.4rem;
}

.topbar h1,
.auth-card h1 {
  font-size: clamp(1.45rem, 1.8vw, 2rem);
}

.topbar p:last-child,
.auth-card p:last-child {
  margin-bottom: 0;
}

.hero,
.panel.hero {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.35fr 1fr;
}

.panel,
.hero-panel,
.side-card,
.item-card,
.stat-card,
.tester-preset-card,
.topbar {
  animation: riseIn 480ms ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .topbar,
  .hero,
  .panel.hero {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .tester-layout {
    grid-template-columns: 1fr;
  }

  .tester-response-grid,
  .three-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .admin-page,
  .auth-page {
    padding: 16px;
  }

  .topbar,
  .layout {
    width: 100%;
  }

  .topbar {
    margin-top: 0;
  }

  .two-cols,
  .section-nav,
  .side-rail,
  .list-grid,
  .compact-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .panel,
  .auth-card,
  .side-card,
  .hero-panel,
  .topbar {
    padding: 18px;
    border-radius: 22px;
  }
}
