:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7683;
  --line: #e2e6ec;
  --brand: #1f6feb;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #b42318;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  font-size: 15px; line-height: 1.7;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.top {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 17px; color: var(--ink); }
.brand span { color: var(--brand); }
.top nav { display: flex; gap: 14px; margin-inline-start: auto; font-size: 14px; }
main { max-width: 1180px; margin: 22px auto 60px; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.card.narrow { max-width: 420px; margin: 60px auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: block; font-size: 13px; color: var(--muted); }
input, select, button, textarea { font: inherit; }
input[type=text], input[type=password], input[type=number], input:not([type]), select {
  width: 100%; padding: 8px 10px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input[type=file] { margin-top: 6px; font-size: 13px; }
button, .button {
  display: inline-block; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; font-size: 14px;
}
button:hover, .button:hover { border-color: #c7cfda; text-decoration: none; }
.button.primary, button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.link { border: none; background: none; color: var(--brand); padding: 0; }
button:disabled { opacity: .55; cursor: progress; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td {
  text-align: start; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.grid th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.grid.tight td, table.grid.tight th { padding: 5px 8px; }
td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bad-text { color: var(--bad); }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: #fff8e6; border: 1px solid #f0d999; }
.banner.bad { background: #fdf1f0; border: 1px solid #f3c0bc; }
.banner.ok { background: #eef8f0; border: 1px solid #bfe3c8; }
.bad-list { margin: 6px 0 0; padding-inline-start: 20px; }
.pill { padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: #e7f6ea; color: var(--ok); }
.pill.warn { background: #fff4e0; color: var(--warn); }
.dropzone {
  margin-top: 12px; padding: 26px 16px; text-align: center;
  border: 2px dashed #cfd8e3; border-radius: var(--radius); background: #fbfcfe;
}
.dropzone.over { border-color: var(--brand); background: #eef4ff; }
.inline { display: inline; }
.inline-check { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--muted); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb-card {
  width: 150px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: #fff;
}
.thumb-card img { width: 100%; height: 110px; object-fit: cover; display: block; background: #f2f4f7; }
.thumb-card .cap { padding: 6px 8px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.thumb-card.sel { outline: 2px solid var(--brand); }
.label-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 860px) { .label-wrap { grid-template-columns: 1fr; } }
.preview img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.toast {
  position: fixed; inset-block-end: 18px; inset-inline-start: 50%; transform: translateX(50%);
  background: #1c2430; color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; z-index: 50; max-width: 90vw;
}
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
details summary { cursor: pointer; margin-top: 10px; }
tr.row-deleted td { opacity: .45; text-decoration: line-through; }
.spin::after { content: " ⏳"; }