@font-face { font-family: Vazirmatn; src: url(Vazirmatn.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --ink: #1d2030;
  --muted: #6b7086;
  --line: #e6e8f0;
  --soft: #f0f1f7;
  --brand: #553ab5;
  --brand-ink: #ffffff;
  --brand-soft: #efebfb;
  --red: #e0262d;
  --red-soft: #fdecec;
  --green: #138a5a;
  --green-soft: #e5f6ee;
  --amber: #a86400;
  --amber-soft: #fff4e0;
  --blue: #1f63c6;
  --blue-soft: #e8f0fc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .05), 0 4px 16px rgba(20, 22, 40, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.7; direction: rtl; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
h1 { font-size: 20px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 8px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-left: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.side .logo img { height: 34px; }
.side .logo span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.nav-title { font-size: 11px; color: var(--muted); padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav .count { margin-inline-start: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .who { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.top .menu-btn { display: none; }
.page { padding: 22px 24px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 2px; }
.kpi a { color: inherit; }
.kpi.alert .value { color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty .ic { width: 36px; height: 36px; color: #b9bdd0; margin-bottom: 6px; }

/* ---------- alerts */
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid transparent; }
.flash.success { background: var(--green-soft); color: var(--green); border-color: #bfe6d3; }
.flash.error { background: var(--red-soft); color: #b3141a; border-color: #f6c6c8; }
.flash.warning { background: var(--amber-soft); color: var(--amber); border-color: #f5ddb0; }
.flash.info { background: var(--blue-soft); color: var(--blue); border-color: #c9dbf6; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 13px; }
.note b { color: var(--ink); }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #4a30a3; }
.btn.danger { color: var(--red); border-color: #f3c3c5; }
.btn.danger:hover { background: var(--red-soft); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.linkbtn.danger { color: var(--red); }
form.inline { display: inline; }

/* ---------- forms */
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; color: var(--ink);
}
textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #cdc2f3; border-color: var(--brand); }
input[type=file] { font: inherit; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; margin-bottom: 10px; cursor: pointer; }
.check input { margin-top: 5px; accent-color: var(--brand); }
.check .hint { display: block; }
.input-group { display: flex; gap: 8px; }
.input-group > * { flex: 1; }
.input-group > .btn { flex: none; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfd; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfbfe; }
td.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td.thumb img, .thumb-sm { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); }
.chk { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- chips & tags */
.chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.gray { background: var(--soft); color: var(--muted); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: #b3141a; }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.violet { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; font-size: 11px; border-radius: 6px; padding: 0 6px; font-weight: 700; }
.tag.new { background: #e8f7ef; color: var(--green); }
.tag.upd { background: var(--blue-soft); color: var(--blue); }
.issues { color: #b3141a; font-size: 12px; margin: 2px 0 0; padding: 0; list-style: none; }
.issues li::before { content: "• "; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.dot.on { background: var(--green); }
.dot.off { background: #c3c6d4; }
.dot.warn { background: #e09a00; }

/* ---------- tabs & pager */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.tabs a .n { background: var(--soft); color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 11px; margin-inline-start: 4px; }
.tabs a.active .n { background: var(--brand-soft); color: var(--brand); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.bulkbar { position: sticky; bottom: 12px; z-index: 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; margin-top: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.bulkbar .btn { height: 32px; }
.bulkbar select { height: 32px; width: auto; max-width: 240px; }

/* ---------- import mapping */
.map-table td:first-child { width: 200px; }
.map-table select { min-width: 160px; }
.req { color: var(--red); }
.preview th { background: var(--brand-soft); color: var(--brand); }
.preview td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.preview tr.header-row td { background: var(--amber-soft); font-weight: 700; }

/* ---------- item edit */
.gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery .im { position: relative; width: 110px; }
.gallery .im img { width: 110px; height: 110px; object-fit: contain; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.gallery .im.first img { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.gallery .im .ops { display: flex; justify-content: space-between; font-size: 12px; margin-top: 2px; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.cand { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.cand img { width: 100%; height: 130px; object-fit: contain; background: var(--soft); border-radius: 8px; }
.cand .t { font-size: 12px; line-height: 1.5; height: 36px; overflow: hidden; }
.cand .score { font-size: 11px; color: var(--muted); }
.attrs-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 8px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.ai-box { background: linear-gradient(135deg, #f4f0ff, #fff4f4); border: 1px solid #e3dcfb; border-radius: var(--radius); padding: 14px; }
.ai-box h3 { display: flex; gap: 6px; align-items: center; color: var(--brand); }

/* ---------- runner */
.runner { position: fixed; left: 16px; bottom: 16px; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(20, 22, 40, .15); padding: 10px 14px; min-width: 240px; font-size: 13px; }
.runner .bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.runner .bar i { display: block; height: 100%; width: 30%; background: var(--brand); border-radius: 99px; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(260%); } 100% { transform: translateX(-120%); } }

/* ---------- guest pages */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(circle at 20% 10%, #efe9ff 0, transparent 40%), radial-gradient(circle at 90% 90%, #ffeaea 0, transparent 40%), var(--bg); }
.guest .box { width: 100%; max-width: 400px; }
.guest .box.wide { max-width: 760px; }
.guest .brand { text-align: center; margin-bottom: 18px; }
.guest .brand img { height: 52px; }
.guest .brand div { color: var(--muted); font-size: 13px; margin-top: 4px; }
.checks { list-style: none; padding: 0; margin: 0; columns: 2; font-size: 13px; }
.checks li { break-inside: avoid; }
.checks .ok { color: var(--green); }
.checks .bad { color: var(--red); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  html, body { overflow-x: hidden; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; right: 0; left: auto; width: 260px; z-index: 30; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0, 0, 0, .1); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 25; }
  .top { padding: 10px 16px; }
  .top .menu-btn { display: inline-flex; }
  .page { padding: 16px 16px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .checks { columns: 1; }
  .kv { grid-template-columns: 110px 1fr; }
  .runner { left: 8px; right: 8px; bottom: 8px; }
  .top .who .name { display: none; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 20px; }
  .attrs-row { grid-template-columns: 1fr 1fr 32px; }
}
ol { list-style: persian; }

.tab-row { display: grid; gap: 6px; margin-bottom: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.tab-row .btn { justify-self: start; }
.dk-box { border-color: #f6c6c8; background: linear-gradient(135deg, #fff, #fff6f6); }
details > summary { cursor: pointer; }

.spec-preview { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.spec-preview .sg { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.spec-preview .sg > label { font-weight: 700; }
.spec-preview .sk { display: flex; gap: 6px; font-size: 12px; margin: 4px 0; align-items: flex-start; }
.spec-preview .sk em { color: var(--muted); font-style: normal; }
.specs-box .sgroup { margin-bottom: 12px; }
.specs-box .sgroup h3 { font-size: 13px; color: var(--brand); margin: 6px 0; }
.specs-box .srow { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.specs-box .srow label { margin: 0; font-weight: 500; font-size: 12px; }
.specs-box .srow input.dk-filled { border-color: #8fd4b4; background: #f3fbf7; }
.dk-preview-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dk-preview-imgs label { position: relative; margin: 0; }
.dk-preview-imgs img { width: 90px; height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.dk-preview-imgs input { position: absolute; top: 4px; right: 4px; }
@media (max-width: 520px) { .specs-box .srow { grid-template-columns: 1fr; } }

/* Digikala matching page (Excel) */
.stat b { display: block; font-size: 1.6rem; margin-top: 4px; }
.dk-cands { display: grid; gap: 6px; }
.dk-cand { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line, #e6e6ea); border-radius: 10px; cursor: pointer; }
.dk-cand:has(input:checked) { border-color: var(--brand, #e6123d); background: var(--soft, #f7f7f9); }
.dk-cand img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.dk-cand .sub { display: block; }
.dk-newcat { margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--amber, #c77700); border-radius: 10px; }
.dk-newcat .btn { margin-top: 6px; }

/* product form: lookup (site → Digikala → AI) */
.lookup-box > input { font-size: 1.05rem; padding: 12px 14px; }
.lookup-results:empty { display: none; }
.lookup-results { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel, #fff); }
.lk-sec + .lk-sec { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.lk-head { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.lk-item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: start; background: none; border: 1px solid transparent; border-radius: 10px; padding: 6px; cursor: pointer; font: inherit; color: inherit; }
.lk-item:hover:not([disabled]) { border-color: var(--brand); background: var(--soft, #f6f6fb); }
.lk-item[disabled] { opacity: .5; cursor: not-allowed; }
.lk-item img, .lk-item .thumb-sm { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.lk-item .sub, .site-pick .sub { display: block; font-size: .8rem; color: var(--muted); }
.site-pick { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--green, #1a7f4b); border-radius: 12px; margin-top: 8px; }
.site-pick img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.site-pick > div { flex: 1; }
form.mode-site [data-new-only] { display: none !important; }

/* Excel worksheet */
.worksheet td { vertical-align: top; }
.worksheet .ws-name { min-width: 200px; max-width: 280px; }
.worksheet .ws-step { min-width: 340px; }
.worksheet .ws-price { min-width: 150px; }
.worksheet .ws-price label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.worksheet .ws-price input { width: 100%; padding: 6px 8px; font-size: .9rem; }
.ws-new { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: .85rem; color: var(--green, #1a7f4b); }
.ws-new img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; }
.ws-sec + .ws-sec { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ws-head { font-weight: 600; font-size: .82rem; margin-bottom: 4px; }
.ws-tools { margin-top: 6px; }
.ws-tools input { min-width: 0; }
.ws-site .sub, .ws-done .sub { display: block; }
.ws-cat { margin-top: 6px; max-width: 100%; }
tr.ws-working { opacity: .55; }
tr.ws-site td:first-child { box-shadow: inset -3px 0 0 var(--green, #1a7f4b); }
tr.ws-ready td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
tr.ws-need td:first-child { box-shadow: inset -3px 0 0 var(--amber, #c77700); }
.ws-more { margin-top: 6px; font-size: .85rem; }
.ws-more summary { cursor: pointer; color: var(--muted); }
.ws-more .dk-cands { margin-top: 6px; }

/* import page */
.import-tabs { display: inline-flex; gap: 4px; background: var(--soft, #f2f2f7); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.import-tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font: inherit; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.import-tabs button.active { background: var(--panel, #fff); color: var(--text, #111); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.dropzone.has-file { border-style: solid; border-color: var(--green, #1a7f4b); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon svg { width: 34px; height: 34px; color: var(--brand); }

/* loading overlay */
.bss-loading { position: fixed; inset: 0; background: rgba(20, 18, 40, .38); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .25s; }
.bss-loading.on { opacity: 1; pointer-events: auto; }
.bl-box { background: var(--panel, #fff); border-radius: 20px; padding: 26px 30px; min-width: 280px; max-width: 90vw; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 8px; align-items: center; transform: translateY(8px); transition: transform .25s; }
.bss-loading.on .bl-box { transform: none; }
.bl-box [data-bl-step] { color: var(--muted); font-size: .88rem; min-height: 1.3em; }
.bl-spin { display: flex; gap: 6px; margin-bottom: 6px; }
.bl-spin i { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); animation: blBounce 1.1s infinite ease-in-out; }
.bl-spin i:nth-child(2) { animation-delay: .15s; }
.bl-spin i:nth-child(3) { animation-delay: .3s; }
@keyframes blBounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.bl-bar { width: 100%; height: 4px; border-radius: 4px; background: var(--soft, #eee); overflow: hidden; margin-top: 6px; }
.bl-bar i { display: block; width: 40%; height: 100%; background: var(--brand); border-radius: 4px; animation: blSlide 1.4s infinite ease-in-out; }
@keyframes blSlide { 0% { transform: translateX(160%); } 100% { transform: translateX(-260%); } }

/* ---------- single-product wizard */
.wizard { max-width: 1000px; padding-top: 18px; }
.wz-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; justify-content: space-between; position: relative; --wz-progress: 0; }
.wz-steps::before, .wz-steps::after { content: ""; position: absolute; top: 17px; right: 30px; left: 30px; height: 3px; border-radius: 3px; background: var(--line); }
.wz-steps::after { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #fff)); left: auto; width: calc((100% - 60px) * var(--wz-progress) / 100); transition: width .45s cubic-bezier(.4, 0, .2, 1); }
.wz-steps li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; cursor: default; color: var(--muted); font-size: .82rem; }
.wz-steps li.reachable { cursor: pointer; }
.wz-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel, #fff); border: 2px solid var(--line); font-weight: 700; transition: all .3s; }
.wz-dot svg { display: none; width: 18px; height: 18px; }
.wz-steps li.active .wz-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 14%, transparent); transform: scale(1.06); }
.wz-steps li.active { color: var(--text, #111); font-weight: 600; }
.wz-steps li.done .wz-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-steps li.done .wz-dot b { display: none; }
.wz-steps li.done .wz-dot svg { display: block; }
.wz-steps li.skipped { opacity: .4; }
.wz-steps li.skipped .wz-label { text-decoration: line-through; }
.wz-panel { display: none; }
.wz-panel.active { display: block; }
.wz-in-next { animation: wzIn .38s cubic-bezier(.2, .7, .3, 1); }
.wz-in-prev { animation: wzInBack .38s cubic-bezier(.2, .7, .3, 1); }
@keyframes wzIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes wzInBack { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.wz-foot .invisible { visibility: hidden; }
.wz-foot .btn svg { width: 16px; height: 16px; }
.wz-big-label { font-size: 1.05rem; font-weight: 700; }
.wz-search { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 14px; padding: 4px 14px; transition: border-color .2s, box-shadow .2s; background: var(--panel, #fff); }
.wz-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.wz-search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.wz-search input { border: 0 !important; box-shadow: none !important; font-size: 1.1rem; padding: 10px 0; width: 100%; background: transparent; outline: none; }
.wz-alt { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; }
.wz-alt .input-group { flex: 1; min-width: 280px; }
.wz-h { margin: 6px 0 10px; font-size: 1rem; }
.wz-source { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft, #f6f6fb); }
.wz-source:empty { display: none; }
.lk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lk-cols .lk-sec + .lk-sec { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 760px) { .lk-cols { grid-template-columns: 1fr; } .wz-label { display: none; } }
.lk-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .72rem; margin-left: 6px; }
.lk-site { background: color-mix(in srgb, var(--green, #1a7f4b) 6%, transparent); border-radius: 10px; padding: 8px; }
.ai-btn { background: linear-gradient(90deg, var(--brand), #8a5cf6); color: #fff; border: 0; }
.skel { display: flex; gap: 8px; align-items: center; padding: 6px; }
.skel i { display: block; height: 44px; border-radius: 8px; background: linear-gradient(90deg, var(--soft, #eee) 25%, #f7f7fb 50%, var(--soft, #eee) 75%); background-size: 200% 100%; animation: skel 1.2s infinite; }
.skel i:first-child { width: 44px; flex: none; }
.skel i:last-child { flex: 1; height: 16px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.brand-field { display: flex; gap: 8px; align-items: center; }
.brand-field input { flex: 1; }
.brand-logo { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; overflow: hidden; flex: none; }
.brand-logo.has { display: grid; place-items: center; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
[data-en-suggest].loading { opacity: .6; }
.dk-preview-imgs label { position: relative; }
.img-n { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; border-radius: 6px; padding: 0 5px; }
.wz-summary .wz-sum { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.wz-sum img, .wz-sum .thumb-sm { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; flex: none; }
.wz-sum .sub { display: block; font-size: .82rem; color: var(--muted); }
.grid.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .grid.g3 { grid-template-columns: 1fr; } }
/* rich editor */
.rich-editor .ql-toolbar.ql-snow { border-radius: 10px 10px 0 0; border-color: var(--line); direction: ltr; text-align: right; }
.rich-editor .ql-container.ql-snow { border-radius: 0 0 10px 10px; border-color: var(--line); min-height: 200px; font-family: inherit; font-size: .95rem; }
.rich-editor .ql-editor { direction: rtl; text-align: right; min-height: 200px; line-height: 1.9; }
.rich-editor .ql-editor li { padding-right: 1.5em; padding-left: 0; }
.rich-editor .ql-editor li > .ql-ui:before { margin-left: .3em; margin-right: -1.5em; text-align: left; }
.rich-editor .ql-editor.ql-blank::before { right: 15px; left: auto; font-style: normal; }
.rich-editor .ql-snow .ql-picker.ql-header { width: 112px; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: 'متن عادی'; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'تیتر بزرگ'; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'تیتر کوچک'; }
.rich-editor .ql-snow .ql-picker-label { padding-right: 18px; }

/* variants editor */
.grid > * { min-width: 0; }
.variants-box { grid-column: 1 / -1; min-width: 0; max-width: 100%; margin: 10px 0 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }
.var-dims { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 10px; }
.var-dims .chip .linkbtn { padding: 0 2px; }
.var-newdim { display: inline-flex; max-width: 260px; }
.var-table td, .var-table th { padding: 4px 6px; vertical-align: middle; }
.var-table input, .var-table select { width: 100%; min-width: 90px; padding: 6px 8px; font-size: .88rem; }
.var-table td:first-child { white-space: nowrap; }
.var-table .sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; margin-left: 4px; }
.var-table td:has(> .sw + select) { display: flex; align-items: center; gap: 4px; }
.var-fixed td { white-space: nowrap; }
.var-fixed { background: color-mix(in srgb, var(--green, #1a7f4b) 5%, transparent); }

/* Digikala category tree (categories_digikala.php) */
.dkc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.dkc-search { flex: 1 1 280px; }
.dkc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.dkc-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dkc-legend .dot.green { background: #1a7f4b; } .dkc-legend .dot.blue { background: #2563eb; } .dkc-legend .dot.red { background: #c0392b; }
.dkc-tree { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.dkc-node { display: flex; align-items: center; gap: 8px; min-height: 34px; border-bottom: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); flex-wrap: wrap; }
.dkc-node .check { margin: 0; }
.dkc-node.on-site > .check span { color: #1a7f4b; }
.dkc-caret { border: 0; background: none; width: 22px; cursor: pointer; color: var(--muted, #888); font-size: .9rem; padding: 0; }
.dkc-caret.empty { cursor: default; opacity: .5; }
.dkc-acts { margin-inline-start: auto; display: inline-flex; gap: 8px; opacity: .35; }
.dkc-node:hover .dkc-acts { opacity: 1; }
.dkc-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 12px; position: sticky; bottom: 0; background: var(--card, #fff); padding: 10px 0 4px; }
.dkc-foot [data-dkc-add] { margin-inline-start: auto; }
