/* ==========================================================================
   سئوی هر صفحه و متاتگ‌های دلخواه
   --------------------------------------------------------------------------
   `templates/seo/panel/meta_pages.html`، `meta_edit.html` و
   `templates/seo/_meta_rows.html` (که در هر دو صفحه‌ساز هم می‌آید).

   ⚠️ همهٔ کلاس‌ها با پیشوند `smt-`؛ `sm-*` مال صفحهٔ وضعیت سیستم است.
   ========================================================================== */
.smt-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.smt-page > * { margin: 0; }

/* ---------- سربرگ ---------- */
.smt-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 22px;
  background:
    radial-gradient(520px 170px at 92% -30%, color-mix(in srgb, #6366f1 18%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-sm);
}
.smt-top-ic {
  flex: none; width: 50px; height: 50px; display: grid; place-items: center;
  font-size: 1.45rem; border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  box-shadow: 0 10px 24px -10px #6366f1;
}
.smt-top-id { flex: 1; min-width: 220px; }
.smt-top-id h1 { margin: 0; font-size: 1.15rem; font-weight: 900; overflow-wrap: anywhere; }
.smt-top-id p { margin: 4px 0 0; font-size: .8rem; color: var(--slate); line-height: 1.9; }
.smt-top-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.smt-url { color: var(--green-text); font-weight: 700; overflow-wrap: anywhere; }

/* ---------- سراسری ---------- */
.smt-global, .smt-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.smt-global {
  background:
    radial-gradient(400px 120px at 100% 0%, color-mix(in srgb, var(--green) 14%, transparent), transparent 70%),
    var(--surface);
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
}
.smt-global:hover, .smt-item:hover { border-color: var(--green); box-shadow: var(--sh-md); transform: translateY(-1px); }
.smt-global-ic, .smt-item-ic {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; background: var(--bg-subtle); font-size: 1.2rem;
}
.smt-global-txt, .smt-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.smt-global-txt b, .smt-item-txt b { font-size: .92rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smt-global-txt small { font-size: .74rem; color: var(--slate); }
.smt-item-txt small { font-size: .72rem; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.smt-go { flex: none; color: var(--slate); transition: transform var(--dur-fast), color var(--dur-fast); }
.smt-global:hover .smt-go, .smt-item:hover .smt-go { color: var(--green-text); transform: translateX(-3px); }

.smt-badge {
  flex: none; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800;
  background: var(--bg-subtle); color: var(--slate); white-space: nowrap;
}
.smt-badge.is-on { background: color-mix(in srgb, #6366f1 14%, transparent); color: #4f46e5; }
[data-theme="dark"] .smt-badge.is-on { color: #a5b4fc; }
.smt-badge.is-ok { background: var(--success-bg); color: var(--success-text); }
.smt-badge.is-muted { background: var(--warn-bg); color: var(--warn-text); }

/* ---------- ابزار ---------- */
.smt-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.smt-tabs {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 14px;
  background: var(--bg-subtle); border: 1px solid var(--line);
}
.smt-tabs button {
  border: 0; background: none; cursor: pointer; font: inherit;
  padding: 7px 12px; border-radius: 11px; font-size: .78rem; font-weight: 800; color: var(--slate);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.smt-tabs button:hover { color: var(--ink); }
.smt-tabs button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.smt-search {
  flex: 1 1 280px; max-width: 420px; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.smt-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }
.smt-search-ic {
  flex: none; width: 16px; height: 16px; margin-inline: 12px 2px; background: var(--slate);
  -webkit-mask: var(--vsel-ic-search) center / contain no-repeat;
  mask: var(--vsel-ic-search) center / contain no-repeat;
}
.smt-search input {
  flex: 1; min-width: 0; height: 42px; border: 0 !important; outline: 0; background: none !important;
  box-shadow: none !important; padding: 0 8px !important; font: inherit; font-size: .86rem; color: var(--ink);
}
.smt-manual {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line); background: var(--bg-subtle);
  font-size: .8rem; color: var(--slate); font-weight: 700;
}
.smt-manual input {
  flex: 1 1 260px; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .84rem;
}
.smt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 420px) { .smt-list { grid-template-columns: 1fr; } }
.smt-none {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 16px; text-align: center; border-radius: 20px;
  border: 1.5px dashed var(--line); background: var(--bg-subtle); color: var(--slate); font-size: .86rem;
}
.smt-none span { font-size: 2rem; opacity: .6; }

/* ---------- ویرایش ---------- */
.smt-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .smt-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .smt-side { position: sticky; top: 96px; }
}
.smt-main, .smt-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.smt-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
}
.smt-page section.smt-card { padding: 18px; }
.smt-card-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.smt-card-h h2 { margin: 0; font-size: .95rem; font-weight: 900; }
.smt-card-h small { flex-basis: 100%; font-size: .74rem; color: var(--slate); }
.smt-size {
  margin-inline-start: auto; padding: 2px 9px; border-radius: 8px; font: 800 .72rem ui-monospace, monospace;
  background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green-text);
}
.smt-dim { font-size: .72rem; color: var(--slate); line-height: 1.8; }

.smt-f { display: flex; flex-direction: column; gap: 6px; }
.smt-f > span { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 800; }
.smt-f > span i { font-style: normal; font-weight: 700; font-size: .7rem; color: var(--slate); }
.smt-f > span i.is-ok { color: var(--success-text); }
.smt-f > span i.is-warn { color: var(--warn-text); }
.smt-f > span i.is-bad { color: var(--danger-text); }
.smt-f > small { font-size: .72rem; color: var(--slate); }
.smt-f input, .smt-f textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; line-height: 1.9; outline: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.smt-f input:focus, .smt-f textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }

.smt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: -4px; }
.smt-tags:empty { display: none; }
.smt-tags span { padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--green-100); color: var(--green-text); }

.smt-seg { display: flex; padding: 3px; border-radius: 14px; background: var(--bg-subtle); border: 1px solid var(--line); }
.smt-seg label { flex: 1; cursor: pointer; }
.smt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.smt-seg span { display: block; text-align: center; padding: 8px; border-radius: 11px; font-size: .78rem; font-weight: 800; color: var(--slate); }
.smt-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.smt-seg input:focus-visible + span { outline: 2px solid var(--green); }

.smt-sws { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.smt-sw { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .84rem; font-weight: 700; }
.smt-sw input { position: absolute; opacity: 0; pointer-events: none; }
.smt-sw-ui { flex: none; position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong, var(--line)); transition: background var(--dur-base); }
.smt-sw-ui::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: inset-inline-start var(--dur-base) var(--ease-spring);
}
.smt-sw input:checked + .smt-sw-ui { background: var(--danger); }
.smt-sw input:checked + .smt-sw-ui::after { inset-inline-start: 21px; }
.smt-sw input:focus-visible + .smt-sw-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }

/* پیش‌نمایش گوگل */
.smt-serp {
  padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid #e5e7eb;
  display: flex; flex-direction: column; gap: 4px; direction: rtl; text-align: right;
  font-family: arial, Vazirmatn, sans-serif;
}
.smt-serp-url { font-size: .74rem; color: #202124; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smt-serp-t { font-size: 1.05rem; font-weight: 500; color: #1a0dab; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.smt-serp-d { margin: 0; font-size: .8rem; color: #4d5156; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.smt-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.smt-checks li { position: relative; padding-inline-start: 22px; font-size: .76rem; color: var(--slate); line-height: 1.8; }
.smt-checks li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: .55em; width: 9px; height: 9px; border-radius: 50%;
  background: var(--slate); opacity: .5;
}
.smt-checks li.is-ok::before { background: var(--success); opacity: 1; }
.smt-checks li.is-warn::before { background: #f59e0b; opacity: 1; }
.smt-checks li.is-bad::before { background: var(--danger); opacity: 1; }
.smt-help ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .76rem; color: var(--slate); line-height: 1.9; }
.smt-save { width: 100%; justify-content: center; }

/* ---------- ردیف‌های متاتگ (پنل و صفحه‌سازها) ---------- */
.smt-box { display: flex; flex-direction: column; gap: 12px; }
.smt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.smt-head > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 220px; }
.smt-head b { font-size: .95rem; font-weight: 900; }
.smt-head small { font-size: .74rem; color: var(--slate); line-height: 1.8; }
.smt-add {
  flex: none; padding: 8px 14px; border-radius: 12px; cursor: pointer; border: 0;
  background: var(--green-btn); color: var(--on-green); font: inherit; font-size: .8rem; font-weight: 800;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.smt-add:hover { background: var(--green-btn-hover); transform: translateY(-1px); }
.smt-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.smt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--line); background: var(--bg-subtle); color: var(--ink);
  font: inherit; font-size: .74rem; font-weight: 700;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.smt-chip i { font-style: normal; font: 600 .66rem ui-monospace, monospace; color: var(--slate); }
.smt-chip:hover { border-style: solid; border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.smt-rows { display: flex; flex-direction: column; gap: 8px; }
.smt-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: 170px minmax(120px, 1fr) minmax(160px, 2fr) 36px;
  padding: 8px; border-radius: 14px; background: var(--bg-subtle); border: 1px solid transparent;
}
.smt-row.is-new { animation: smt-in .25s var(--ease-out); }
.smt-row.is-flash { animation: smt-flash .7s var(--ease-out); }
@keyframes smt-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes smt-flash { 0%, 100% { border-color: transparent; } 30% { border-color: var(--green); } }
.smt-row select, .smt-row input {
  width: 100%; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .82rem; outline: 0;
}
.smt-row .smt-key { font-family: ui-monospace, monospace; font-size: .8rem; }
.smt-row.is-title .smt-key { opacity: .4; }
.smt-row select:focus, .smt-row input:focus { border-color: var(--green); }
.smt-x {
  width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--slate); font-size: .8rem;
}
.smt-x:hover { background: var(--danger-bg); color: var(--danger-text); }
@media (max-width: 760px) {
  .smt-row { grid-template-columns: 1fr 36px; }
  .smt-row .smt-kind { grid-column: 1; }
  .smt-row .smt-x { grid-column: 2; grid-row: 1; }
  .smt-row .smt-key, .smt-row .smt-val { grid-column: 1 / -1; }
}
.smt-empty { margin: 0; padding: 16px; text-align: center; font-size: .78rem; color: var(--slate); border-radius: 14px; border: 1px dashed var(--line); }
.smt-empty[hidden] { display: none; }
.smt-code summary { cursor: pointer; font-size: .76rem; font-weight: 800; color: var(--slate); }
.smt-code pre {
  margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; overflow-x: auto;
  background: #0b1220; color: #cbd5e1; font: .76rem/1.9 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all;
}
.smt-code pre b { color: #86efac; font-weight: 700; }
