@font-face {
  font-family: "Vazirmatn Admin";
  src: url("/admin/fonts/vazirmatn-arabic-400-normal.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn Admin";
  src: url("/admin/fonts/vazirmatn-arabic-700-normal.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #edf1f6;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-soft: #f4f8fb;
  --surface-strong: #ffffff;
  --line: #d8e1eb;
  --line-strong: #bcc9d7;
  --ink: #102235;
  --ink-soft: #1c3954;
  --muted: #607289;
  --muted-soft: #8b9aab;
  --accent: #0b8c86;
  --accent-strong: #08635f;
  --accent-soft: #d8f3f0;
  --accent-soft-2: #eef9f8;
  --secondary: #1f5eff;
  --secondary-soft: #e7eeff;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --warning-soft: #fff7d6;
  --shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 18px 42px rgba(15, 23, 42, 0.07);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(11, 140, 134, 0.18), transparent 18%),
    radial-gradient(circle at top left, rgba(31, 94, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Vazirmatn Admin", Tahoma, sans-serif;
  line-height: 1.7;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

code {
  font-family: Consolas, Monaco, monospace;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

#login-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 500px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  padding: 32px;
  background:
    radial-gradient(circle at top right, rgba(11, 140, 134, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 253, 0.98));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-card h1 {
  margin: 10px 0;
  font-size: 2.1rem;
  line-height: 1.2;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.mini-badge,
.tiny-badge,
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
}

.mini-badge,
.tiny-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.hero-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #f4fdff;
  backdrop-filter: blur(10px);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.section-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(11, 140, 134, 0.48);
  box-shadow: 0 0 0 4px rgba(11, 140, 134, 0.08);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.hint {
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.8;
}

.primary-btn,
.ghost-btn,
.soft-btn,
.danger-btn,
.link-btn,
.field-helper-btn,
.field-helper-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #14968b 100%);
  box-shadow: 0 18px 34px rgba(11, 140, 134, 0.24);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.soft-btn {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.link-btn,
.field-helper-link {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.field-helper-btn {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
}

.field-helper-link {
  padding: 9px 12px;
  font-size: 12px;
}

.danger-btn,
.ghost-btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.primary-btn:hover,
.ghost-btn:hover,
.soft-btn:hover,
.danger-btn:hover,
.link-btn:hover,
.field-helper-btn:hover,
.field-helper-link:hover {
  transform: translateY(-1px);
}

#app-screen {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(120, 255, 246, 0.16), transparent 20%),
    linear-gradient(180deg, #081827 0%, #10263a 45%, #123752 100%);
  color: #edf7ff;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.brand {
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  align-items: start;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  font-size: 15px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 1.26rem;
}

.brand p {
  margin: 6px 0 0;
  color: rgba(237, 247, 255, 0.7);
  line-height: 1.9;
  font-size: 13px;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-left: 4px;
}

.nav-btn {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #eff6ff;
  text-align: right;
  backdrop-filter: blur(12px);
}

.nav-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(93, 167, 255, 0.12));
  border-color: rgba(159, 214, 255, 0.35);
  box-shadow: 0 18px 30px rgba(4, 13, 24, 0.22);
}

.nav-btn small {
  color: rgba(237, 247, 255, 0.62);
}

.sidebar-footer {
  position: absolute;
  right: 22px;
  left: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
}

.main-shell {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar h2 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.locale-switch {
  display: inline-flex;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.locale-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.locale-btn.active {
  background: var(--ink);
  color: #fff;
}

.status-bar {
  min-height: 26px;
  margin-bottom: 16px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.content-area {
  display: grid;
  gap: 20px;
}

.card,
.editor-panel,
.panel-grid-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(11, 140, 134, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.96));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.card,
.editor-panel,
.resource-panel,
.hero-panel {
  padding: 24px;
}

.overview-strip {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.3fr 1fr;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(110, 255, 246, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(31, 94, 255, 0.15), transparent 24%),
    linear-gradient(135deg, #0d2335 0%, #134160 58%, #0b8c86 100%);
  color: #f3fbff;
  box-shadow: 0 28px 60px rgba(10, 22, 37, 0.18);
}

.hero-panel h3 {
  margin: 10px 0 12px;
  font-size: 2rem;
  line-height: 1.12;
}

.hero-panel p {
  margin: 0;
  max-width: 60ch;
  color: rgba(243, 251, 255, 0.82);
}

.hero-badges,
.quick-links,
.inline-actions,
.field-helpers,
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges,
.quick-links {
  margin-top: 18px;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.quick-links a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.resource-panel h3,
.panel-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.resource-panel p,
.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 14px;
}

.resource-list,
.repeat-list,
.editor-grid,
.content-stack {
  display: grid;
  gap: 16px;
}

.resource-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.resource-item strong {
  display: block;
  margin-bottom: 6px;
}

.resource-item code,
.path-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  direction: ltr;
  text-align: left;
  word-break: break-all;
}

.dashboard-grid,
.media-grid,
.section-links {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  border-radius: 26px;
  background: linear-gradient(180deg, #f6fbff 0%, #fff 100%);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.stat-card span {
  display: block;
  color: var(--muted-soft);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.editor-grid.two,
.slug-grid,
.array-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.repeat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.repeat-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.repeat-card-header strong {
  display: block;
  font-size: 1rem;
}

.repeat-card-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted-soft);
  font-size: 12px;
}

.section-link-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--accent-soft-2) 0%, #fff 100%);
  border: 1px solid rgba(11, 140, 134, 0.12);
}

.section-link-card span {
  display: block;
  color: var(--muted-soft);
  font-size: 12px;
  margin-bottom: 8px;
}

.section-link-card a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}

.field-helpers {
  margin-top: 10px;
}

.field-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.field-preview-list a {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  direction: ltr;
  text-align: left;
  border: 1px solid var(--line);
}

.field-preview-list a:hover,
.section-link-card a:hover {
  color: var(--secondary);
}

.media-item {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: white;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.media-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #dde8ef;
}

.media-body {
  padding: 14px;
}

.media-body code {
  display: block;
  margin: 10px 0;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  direction: ltr;
  text-align: left;
  word-break: break-all;
}

.json-box {
  min-height: 340px;
  direction: ltr;
  text-align: left;
  font-family: Consolas, Monaco, monospace;
}

.notice {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--warning-soft);
  color: #73510d;
  line-height: 1.9;
  font-size: 13px;
}

@media (max-width: 1100px) {
  #app-screen {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar-footer {
    position: static;
    margin-top: 20px;
  }

  .overview-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .main-shell,
  .sidebar,
  .card,
  .editor-panel,
  .resource-panel,
  .hero-panel {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .editor-grid.two,
  .slug-grid,
  .array-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar h2 {
    font-size: 1.8rem;
  }
}
