[hidden] { display: none !important; }
@font-face { font-family: "BNazanin"; src: url("../fonts/BNazanin.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "BTitr"; src: url("../fonts/BTitr.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #1c2b39;
  --steel: #5b6b7a;
  --line: #d5dce3;
  --paper: #eef1f4;
  --surface: #ffffff;
  --amber: #f2b01e;
  --amber-deep: #8a5a00;
  --ok: #1f7a4d;
  --bad: #b3261e;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "BNazanin", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
}
h1, h2, h3, .titr, button, .btn { font-family: "BTitr", Tahoma, sans-serif; font-weight: normal; }
a { color: inherit; }
input, button, select { font: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

input[type=text], input[type=password], input[type=number] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: "BNazanin", Tahoma, sans-serif;
  font-size: 17px;
}
input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(242,176,30,.35); }
input.ltr { direction: ltr; text-align: left; font-family: Tahoma, sans-serif; font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #2c4157; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.amber:hover { background: #ffc43d; }
.btn[disabled] { opacity: .55; cursor: wait; }

.error { background: #fdecea; color: var(--bad); border-right: 4px solid var(--bad); padding: 10px 14px; border-radius: 4px; }

/* ---------- ورود ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, var(--ink) 0 38%, var(--paper) 38% 100%); }
.login-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(28,43,57,.18); overflow: hidden; }
.login-card header { padding: 26px 28px 8px; text-align: center; }
.login-card header h1 { margin: 0; font-size: 26px; }
.login-card header p { margin: 4px 0 0; color: var(--steel); }
.login-card form { padding: 16px 28px 28px; display: grid; gap: 14px; }
.login-card label { display: grid; gap: 4px; font-size: 16px; }
.captcha-row { display: grid; gap: 8px; }
.captcha-row input { letter-spacing: 3px; font-size: 20px; text-align: center; }
.captcha-img { display: flex; align-items: center; gap: 6px; }
.captcha-img img { height: 50px; max-width: calc(100% - 50px); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 38px; height: 44px; cursor: pointer; font-size: 18px; }
.login-card .submit { width: 100%; padding: 10px; font-size: 18px; }
.muted { color: var(--steel); font-size: 15px; }

/* ---------- سربرگ ---------- */
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 16px; }
.company-logo { width: 58px; height: 58px; border-radius: 8px; background: #fff; object-fit: contain; padding: 4px; }
.company-logo.empty { display: grid; place-items: center; color: var(--steel); font-size: 12px; text-align: center; line-height: 1.2; }
.company h1 { margin: 0; font-size: 28px; line-height: 1.3; }
.company .muted { color: #b8c4cf; }
.topbar .spacer { flex: 1; }
.topbar .btn.ghost { color: #fff; border-color: #6e8195; }
.topbar .btn.ghost:hover { background: #2c4157; }

/* ---------- محتوا ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 40px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar h2 { margin: 0 0 0 auto; font-size: 22px; }
.toolbar .count { width: 90px; text-align: center; }
.progress { flex-basis: 100%; display: none; align-items: center; gap: 12px; color: var(--steel); }
.progress.show { display: flex; }
.bar { flex: 1; max-width: 360px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .3s; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 700px) { .table-wrap { overflow-x: auto; } }
table { width: 100%; border-collapse: collapse; }
th { font-family: "BTitr", Tahoma, sans-serif; font-weight: normal; font-size: 14px; color: var(--steel);
  text-align: right; padding: 10px 12px; border-bottom: 2px solid var(--ink); background: #f7f9fa; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8fafb; }
td.num { direction: ltr; text-align: right; font-family: Tahoma, sans-serif; font-size: 14px; }

/* کد پیگیری: مثل پلاک فلزی حک‌شده */
.tag { display: inline-block; min-width: 58px; text-align: center; font-family: "BTitr", Tahoma, sans-serif;
  font-size: 18px; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 4px;
  background: repeating-linear-gradient(135deg, #fff 0 6px, #f6f8fa 6px 12px); letter-spacing: 1px; }

.status { display: inline-block; font-size: 14px; padding: 1px 10px; border-radius: 12px; background: #e6ebf0; white-space: nowrap; }
.status.done { background: #e2f3ea; color: var(--ok); }
.status.warn { background: #fff4d6; color: var(--amber-deep); }

.actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.actions .btn { padding: 4px 10px; font-size: 13px; }
.sent-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-start: 4px; }

/* آیکن i و کارت جزئیات */
.info { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--steel); color: var(--steel); font: italic bold 14px Georgia, serif; cursor: help; }
.info:hover, .info:focus { background: var(--ink); border-color: var(--ink); color: #fff; }
.info .card { display: none; position: absolute; top: -10px; right: 32px; z-index: 20;
  width: 360px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--amber);
  border-radius: 6px; box-shadow: 0 12px 30px rgba(28,43,57,.2); padding: 10px 14px; text-align: right;
  font: normal 15px/1.7 "BNazanin", Tahoma, sans-serif; cursor: default; }
tbody tr:nth-last-child(-n+4):not(:nth-child(-n+4)) .info .card { top: auto; bottom: -10px; }
.info:hover .card, .info:focus .card, .info:focus-within .card { display: block; }
.card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.card dt { color: var(--steel); white-space: nowrap; }
.card dd { margin: 0; word-break: break-word; }
.card dd.ltr { direction: ltr; text-align: right; font-family: Tahoma, sans-serif; font-size: 13px; }
.card .missing { color: var(--bad); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--steel); }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; padding: 4px 10px; text-align: center; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; text-decoration: none; }
.pager .current { background: var(--ink); color: #fff; border-color: var(--ink); }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; }
#toast div { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
#toast div.bad { background: var(--bad); }
#toast div.ok { background: var(--ok); }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; }
  .info .card { right: auto; left: -10px; top: 30px; transform: none; width: 300px; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
.latin { font-family: Tahoma, sans-serif; font-size: .85em; direction: ltr; unicode-bidi: isolate; }

/* ---------- انتخاب و به‌روزرسانی ---------- */
.chk { width: 34px; text-align: center; }
.chk input { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
tbody tr.selected { background: #fff8e3; }
.icon-act { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--steel); cursor: pointer; }
.icon-act:hover { color: var(--ink); border-color: var(--ink); }

@keyframes spin { to { transform: rotate(-360deg); } }
tr.flash td { background: #e2f3ea; transition: background 1.5s; }
.fa-num { font-family: "BNazanin", Tahoma, sans-serif; font-size: 18px; white-space: nowrap; }

.nav { display: flex; gap: 8px; }
.topbar .btn.ghost.on { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- صفحه تنظیمات ---------- */
.settings-page { max-width: 1280px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 20px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.panel label { display: grid; gap: 4px; font-size: 16px; }
.panel small { color: var(--steel); font-size: 14px; line-height: 1.5; }
.grid { display: grid; gap: 14px 18px; margin-bottom: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.wide { margin-bottom: 16px; }
.file-pick.light span { color: var(--ink); border-color: var(--steel); background: #f7f9fa; }
.plate-table { width: 100%; min-width: 0; border-collapse: collapse; margin: 6px 0 8px; }
.plate-table td { padding: 8px 6px; vertical-align: middle; }
.plate-table td.type { font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; width: 190px; }
.plate-table input.prefix { width: 90px; text-align: center; }
#preview { margin: 14px 0 0; padding: 12px; background: #f7f9fa; border: 1px dashed var(--steel); border-radius: 8px; text-align: center; }
#preview img { max-width: 100%; max-height: 420px; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--paper) 35%); text-align: left; }
.save-bar .btn { padding: 10px 28px; font-size: 17px; }
@media (max-width: 800px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .plate-table, .plate-table tbody, .plate-table tr, .plate-table td { display: block; width: 100%; }
  .plate-table thead { display: none; }
  .plate-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
}


.file-pick { position: relative; display: block; }
.file-pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-pick span { display: block; padding: 8px 12px; border: 1px dashed #6e8195; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-pick:focus-within span { outline: 3px solid var(--amber); }

/* ---------- قواعد پلاک ---------- */
.intro { margin: 0 0 12px; line-height: 1.7; }
.rule { border: 1px solid var(--line); border-right: 4px solid var(--ink); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; background: #fbfcfd; }
.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; }
.rule-grid .span2 { grid-column: span 2; }
.rule-grid select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-family: "BNazanin", Tahoma, sans-serif; font-size: 16px; }
.rule-grid .check { display: flex; align-items: center; gap: 8px; align-self: center; }
.rule-grid .check input { width: 18px; height: 18px; accent-color: var(--ink); }
.rule.ghab .only-plate { opacity: .35; pointer-events: none; }
.rule-actions { display: grid; gap: 6px; }
.btn.danger { color: var(--bad); border-color: #e3b4b0; }
.btn.danger:hover { background: #fdecea; }
.plate-table input.prefix, .rule input.prefix { text-align: center; }

/* ---------- مدیریت ---------- */
.admin-strip { background: var(--amber); color: var(--ink); text-align: center; padding: 5px 12px; font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; }
tr.blocked td { color: var(--steel); }
td.titr { font-family: "BTitr", Tahoma, sans-serif; font-size: 15px; }
@media (max-width: 900px) {
  .rule { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- فیلتر سر ستون ---------- */
tr.filters th { padding: 6px 8px 8px; background: #eef2f5; border-bottom: 2px solid var(--ink); }
thead tr:first-child th { border-bottom: 1px solid var(--line); }
tr.filters input, tr.filters select { width: 100%; min-width: 80px; padding: 4px 8px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 5px; background: #fff; font-family: "BNazanin", Tahoma, sans-serif; }
tr.filters input:focus, tr.filters select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 2px rgba(242,176,30,.4); }
tr.filters input:not(:placeholder-shown), tr.filters select:has(option:checked:not([value=""])) { border-color: var(--amber); background: #fffaf0; }
.btn.small { padding: 3px 10px; font-size: 12px; }
.pager .gap { border: none; background: none; min-width: 20px; }

/* ---------- آیکن‌ها (Lucide، فایل‌ها در static/icons) ---------- */
.ico { display: inline-block; width: 18px; height: 18px; background: currentColor; flex: none;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-file-text { --i: url("../icons/file-text.svg"); }
.ico-zap { --i: url("../icons/zap.svg"); }
.ico-truck { --i: url("../icons/truck.svg"); }
.ico-send { --i: url("../icons/send.svg"); }
.ico-refresh-cw { --i: url("../icons/refresh-cw.svg"); }
.ico-package { --i: url("../icons/package.svg"); }
.ico-info { --i: url("../icons/info.svg"); }
.ico-settings { --i: url("../icons/settings.svg"); }
.ico-share-2 { --i: url("../icons/share-2.svg"); }

/* ---------- منوی تنظیمات ---------- */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.settings-menu { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 4px; }
.settings-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; text-decoration: none;
  font-family: "BTitr", Tahoma, sans-serif; font-size: 15px; color: var(--steel); }
.settings-menu a:hover { background: var(--paper); color: var(--ink); }
.settings-menu a.on { background: var(--ink); color: #fff; }
.panel.channel h2 .check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.panel.channel h2 input { width: 20px; height: 20px; accent-color: var(--ink); }
@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { position: static; grid-auto-flow: column; }
}

/* ---------- دکمه‌های آیکنی سفارش ---------- */
.actions { align-items: center; gap: 4px; }
.actions .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.icon-act { position: relative; width: 34px; height: 32px; color: var(--ink); }
.icon-act:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-act[disabled] { cursor: wait; opacity: .7; }
.icon-act.busy .ico { animation: pulse .8s ease-in-out infinite alternate; }
.icon-act.busy .ico-refresh-cw { animation: spin .9s linear infinite; }
@keyframes pulse { from { opacity: 1; } to { opacity: .25; } }
.icon-act.sent::after { content: ""; position: absolute; top: 3px; left: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* راهنمای کوچک هنگام نگه داشتن موس */
[data-tip]::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 0; display: none;
  background: var(--ink); color: #fff; font: 13px/1.4 "BNazanin", Tahoma, sans-serif; white-space: nowrap;
  padding: 4px 10px; border-radius: 5px; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 30; }
[data-tip]:hover::before, [data-tip]:focus-visible::before { display: block; opacity: 1; }

/* آیکن‌های جزئیات و تجهیزات */
td .info { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--steel); font: inherit; }
td .info + .info { margin-inline-start: 4px; }
td .info:hover, td .info:focus { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.equip b { display: block; font-family: "BTitr", Tahoma, sans-serif; font-weight: normal; font-size: 14px; margin-bottom: 4px; }
.card.equip ul { margin: 0; padding: 0 18px 0 0; }
.card.equip li { margin: 2px 0; }
@media (prefers-reduced-motion: reduce) { .icon-act.busy .ico { animation: none; } [data-tip]::before { transition: none; } }
td.icons { white-space: nowrap; width: 84px; }
.card.equip .qty { color: var(--steel); white-space: nowrap; }

/* ---------- کنترل کیفیت (QC) ---------- */
.ico-clipboard-check { --i: url("../icons/clipboard-check.svg"); }
a.icon-act { text-decoration: none; }
.icon-act.qc-done { color: var(--ok); border-color: var(--ok); }
.icon-act.qc-done::after { content: "✓"; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok); color: #fff; font: bold 11px/16px Tahoma, sans-serif; text-align: center; }
.qc-photos { display: inline-flex; gap: 3px; margin-inline-start: 4px; }
.qc-photos a { position: relative; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px;
  border: 1px solid var(--ok); border-radius: 4px; color: var(--ok); text-decoration: none; font-size: 14px; background: #f1f9f4; }
.qc-photos a:hover { background: var(--ok); color: #fff; }

.qc-page { max-width: 760px; }
.qc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.qc-head h2 { margin: 0; font-size: 22px; }
.qc-badge { margin-inline-start: auto; background: #e2f3ea; color: var(--ok); padding: 3px 12px; border-radius: 14px; font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; }
.qc-products { margin: -4px 0 10px; line-height: 1.8; }
.qc-item { display: flex !important; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line);
  cursor: pointer; font-size: 18px !important; border-radius: 6px; }
.qc-item:last-child { border-bottom: none; }
.qc-item input { width: 24px; height: 24px; flex: none; accent-color: var(--ok); }
.qc-item.on { background: #f1f9f4; }
.qc-photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.qc-slot { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fbfcfd; }
.qc-thumb { height: 150px; display: grid; place-items: center; background: var(--paper); border-radius: 6px; overflow: hidden; color: var(--steel); }
.qc-thumb img { width: 100%; height: 150px; object-fit: cover; display: block; }
.qc-thumb.new { outline: 3px solid var(--amber); }
.qc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.qc-pick label.btn { position: relative; display: inline-flex !important; overflow: hidden; }
.qc-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qc-bar { display: flex; align-items: center; gap: 10px; }
.qc-bar .muted { margin-inline-end: auto; }
.rule-grid .span3 { grid-column: span 3; }
.rule-grid .span4 { grid-column: 1 / -1; }
.rule textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; font: 16px/1.8 "BNazanin", Tahoma, sans-serif; resize: vertical; }
.qc-rule { grid-template-columns: 1fr auto; }
@media (max-width: 600px) {
  .qc-page { padding: 12px 10px 30px; }
  .qc-photos-grid { grid-template-columns: 1fr 1fr; }
  .qc-thumb, .qc-thumb img { height: 120px; }
  .rule-grid .span3 { grid-column: 1 / -1; }
}

/* ---------- کاربران و دسترسی‌ها ---------- */
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 28px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.login-tabs a { text-align: center; padding: 8px 6px; text-decoration: none; font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; color: var(--steel); }
.login-tabs a.on { background: var(--ink); color: #fff; }
.user-card .perm-groups { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.perm-groups fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px 10px; margin: 0; background: #fff; }
.perm-groups legend { padding: 0 6px; font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; }
.perm-groups .check, .user-card .check { display: flex !important; align-items: center; gap: 8px; font-size: 16px; cursor: pointer; padding: 2px 0; }
.perm-groups input, .user-card .check input { width: 17px; height: 17px; flex: none; accent-color: var(--ink); }
@media (max-width: 900px) { .user-card .perm-groups { grid-template-columns: 1fr; } }

/* ---------- بکاپ ---------- */
.backup-parts { display: grid; gap: 6px; margin-bottom: 14px; }
.backup-parts .check { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.backup-parts input { width: 18px; height: 18px; accent-color: var(--ink); }
.backup-bar { max-width: none; margin-top: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn.busy { opacity: .6; pointer-events: none; }
.backup-modes { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.backup-modes .check { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.backup-modes input { width: 18px; height: 18px; accent-color: var(--ink); }
.backup-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--steel); }
#restore-dialog { max-width: 520px; width: calc(100% - 32px); border: none; border-top: 4px solid var(--amber); border-radius: 10px;
  padding: 18px 22px; box-shadow: 0 18px 40px rgba(28,43,57,.3); direction: rtl; font: 17px/1.8 "BNazanin", Tahoma, sans-serif; color: var(--ink); }
#restore-dialog::backdrop { background: rgba(28,43,57,.45); }
#restore-dialog h3 { margin: 0 0 8px; font-size: 18px; word-break: break-all; }
#restore-dialog p { margin: 6px 0; }
#restore-dialog .rd-codes { color: var(--steel); font-size: 15px; }
#restore-dialog .rd-warn { color: var(--bad); font-size: 15px; }
#restore-dialog .rd-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; margin-top: 14px; }
#restore-dialog .dlg-checks { display: grid; gap: 4px; margin: 8px 0; }
#restore-dialog .check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 16px; }
#restore-dialog .check input { width: 17px; height: 17px; margin-top: 5px; flex: none; accent-color: var(--ink); }
#restore-dialog .confirm-in { display: grid; gap: 4px; margin-top: 10px; font-size: 16px; }
#restore-dialog .confirm-in input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 17px; }

/* ---------- بکاپ تنظیمات و حذف داده‌ها ---------- */
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.panel.danger-panel { border-top: 4px solid var(--bad); }
.panel .sub-h { margin: 16px 0 6px; font-size: 15px; color: var(--steel); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: #8f1d17; }
.purge-codes { display: grid; gap: 4px; margin-bottom: 12px; }
.purge-status { margin: 4px 0 8px; }
.purge-status summary { cursor: pointer; color: var(--steel); }
.purge-status .status-list { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 8px 4px; }
.purge-status .check, .purge-rows-opts .check, .reset-opt { display: flex !important; align-items: flex-start; gap: 8px; cursor: pointer; }
.purge-status input, .reset-opt input { width: 18px; height: 18px; margin-top: 4px; flex: none; accent-color: var(--ink); }
.reset-opt { margin: 10px 0; color: var(--bad); }
.deleted-table td { vertical-align: top; }
.deleted-table .codes { max-width: 320px; word-break: break-word; color: var(--steel); font-size: 15px; }

/* ---------- پانویس مالک سامانه ---------- */
.site-footer { max-width: 1320px; margin: 10px auto 0; padding: 14px 24px 22px; display: flex; align-items: center; justify-content: center;
  gap: 12px; text-align: center; font-size: 15px; color: var(--steel); border-top: 1px solid var(--line); line-height: 1.7; }
.site-footer b { color: var(--ink); font-weight: normal; font-family: "BTitr", Tahoma, sans-serif; font-size: 14px; }
.site-footer a { text-decoration: none; }
.site-footer .muted { font-size: 14px; }
.login-page .site-footer { border: none; color: var(--steel); padding-top: 18px; }
.brand-mark { display: block; width: 110px; height: auto; margin: 0 auto 6px; }
.login-wrap { width: 100%; max-width: 410px; }
.site-footer .ltr-num { white-space: nowrap; direction: ltr; unicode-bidi: isolate; }

/* ---------- طراح پلاک ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-head h2 { margin: 0; flex: 1; }
.design-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.design-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.design-card .thumb { background: #2b3440; padding: 14px; display: flex; justify-content: center; align-items: center; height: 170px; }
.design-card .thumb img { max-width: 100%; max-height: 100%; background: #fff; }
.design-card .meta { padding: 10px 12px 4px; }
.design-card .meta h3 { margin: 0; font-size: 17px; }
.design-card .acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; }
.design-card .acts form { margin: 0; }
.design-card .acts .btn { padding: 4px 10px; font-size: 14px; }
.grid.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.grid.three .span2 { grid-column: span 2; }
.design-new .check { display: flex !important; align-items: center; gap: 8px; margin: 4px 0; }
.design-new .check input { width: 18px; height: 18px; }
.field-table { width: 100%; border-collapse: collapse; }
.field-table th { font-family: "BTitr", Tahoma, sans-serif; font-weight: normal; text-align: right; color: var(--steel); font-size: 14px; padding: 4px; }
.field-table td { padding: 4px; border-top: 1px solid var(--line); }
.field-table td input[type=text] { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.field-table td input[type=checkbox] { width: 18px; height: 18px; }
.badge { display: inline-block; font-size: 11px; background: #e8eef5; color: var(--steel); border-radius: 8px; padding: 0 7px; margin-inline-start: 4px; }
.rule-designs { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 8px; }
.rule-designs .rd-head { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--steel); }
.rd-row { display: grid; grid-template-columns: 2fr 70px 1.4fr 1.6fr auto; gap: 8px; margin-top: 6px; align-items: center; }
.rd-row select, .rd-row input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: 15px "BNazanin", Tahoma, sans-serif; }
.rd-row .btn { padding: 4px 10px; }
@media (max-width: 900px) { .grid.three { grid-template-columns: 1fr 1fr; } .rd-row { grid-template-columns: 1fr 1fr; } }
.tozie-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tozie-add input[type=text] { flex: 1; min-width: 240px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font: 16px "BNazanin", Tahoma, sans-serif; }
.tozie-add .file-pick { flex: 1; min-width: 200px; }
.tozie-thumb { height: 48px; max-width: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 2px; }
.settings-menu a.sub { padding-right: 38px; font-size: 14px; position: relative; }
.settings-menu a.sub::before { content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 1px; background: currentColor; opacity: .6; }
.settings-layout.no-menu { grid-template-columns: 1fr; }
.card.equip .brand { color: var(--brass, #a67c1a); white-space: nowrap; font-size: 14px; margin-inline-start: 6px; }
.qc-brand { color: var(--ink); }
.qc-sub { font-size: 16px; margin: 14px 0 4px; color: var(--steel); border-top: 1px dashed var(--line); padding-top: 10px; }
.qc-part { display: grid !important; grid-template-columns: 1fr minmax(160px, 45%); align-items: center; gap: 10px; padding: 8px; font-size: 17px !important; border-bottom: 1px solid var(--line); }
.qc-part select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: 16px "BNazanin", Tahoma, sans-serif; background: #fff; }
.qc-lock { background: #fff6e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
#qc-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#qc-form.readonly .qc-pick { display: none; }
.qc-history ul { margin: 0; padding-inline-start: 20px; color: var(--steel); line-height: 1.9; }
.qc-items-edit { grid-column: 1 / -1; }
.qc-items-edit .qi-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-top: 6px; }
.qc-items-edit input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font: 15px "BNazanin", Tahoma, sans-serif; }
.qc-bar { flex-wrap: wrap; }
@media (max-width: 600px) {
  .qc-bar .muted { flex-basis: 100%; margin: 0; }
  .qc-bar .btn { flex: 1 1 auto; padding-inline: 10px; }
}

/* ---------- رفع بیرون‌زدن متن برند از کارت تجهیزات ---------- */
td.icons .card { white-space: normal; }
.card.equip { width: max-content; min-width: 260px; max-width: min(440px, 80vw); }
.card.equip li { overflow-wrap: anywhere; }
.card.equip .brand { white-space: normal; display: inline-block; max-width: 100%; }

/* ---------- لوگوی پانویس ---------- */
.site-footer .footer-logo { width: 60px; height: 60px; flex: none; object-fit: contain; }

/* ---------- انتخاب ستون‌ها ---------- */
.col-picker { position: relative; }
.col-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 290px; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--amber); border-radius: 8px; padding: 10px 14px 12px;
  box-shadow: 0 12px 30px rgba(28,43,57,.2); }
.col-panel[hidden] { display: none; }
.col-panel > b { font-family: "BTitr", Tahoma, sans-serif; font-weight: normal; font-size: 14px; }
.col-panel p { margin: 2px 0 8px; font-size: 14px; }
.col-panel ul { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.col-panel li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.col-panel li:last-child { border-bottom: none; }
.col-panel label { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; }
.col-panel input[type=checkbox] { width: 17px; height: 17px; }
.col-move { display: flex; gap: 2px; }
.col-move button { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff;
  color: var(--steel); font-size: 10px; cursor: pointer; }
.col-move button:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.col-actions { display: flex; gap: 6px; margin-top: 10px; }
td.missing { color: var(--bad); }

/* ---------- جدول همیشه در عرض صفحه بماند (هر تعداد ستون) ---------- */
th { white-space: normal; }
th, td { padding-inline: 8px; }
td { overflow-wrap: anywhere; }
td.num { word-break: break-all; }
.status { white-space: normal; }
tr.filters input, tr.filters select { min-width: 0; }
.actions { flex-wrap: wrap; row-gap: 4px; }

/* ---------- نوار انتخاب سفارش‌ها ---------- */
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; padding: 8px 12px;
  background: #fffaf0; border: 1px solid var(--amber); border-radius: 8px; }
.select-bar[hidden] { display: none; }
.sel-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; max-height: 74px; overflow-y: auto; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 0 10px; font: inherit; font-size: 14px;
  cursor: pointer; direction: ltr; }
.chip:hover { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ---------- تب نمایش ستون‌ها در تنظیمات ---------- */
.col-list { list-style: none; margin: 0; padding: 0; max-width: 460px; }
.col-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.col-list li:last-child { border-bottom: none; }

/* ---------- انبار ---------- */
.inv-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-tabs .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.col-pick { position: relative; }
.col-menu { position: absolute; top: 110%; left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 14px; display: grid; gap: 4px; min-width: 200px; box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.col-menu[hidden] { display: none; }
.col-menu .check { display: flex; gap: 8px; align-items: center; white-space: nowrap; cursor: pointer; }
.notice { background: #fff4d6; border: 1px solid #f2d48a; border-radius: 8px; padding: 8px 14px; margin: 0 0 12px; }
td.bad-num, .bad-num { color: var(--bad); font-weight: bold; }
td.warn-num { color: var(--amber-deep); font-weight: bold; }
.ok-num { color: var(--ok); }
.mini-link { font-size: 13px; margin-right: 6px; }
.inv-page .actions { display: flex; gap: 4px; flex-wrap: nowrap; }
table.lines { margin: 12px 0; }
table.lines td, table.lines th { padding: 4px 6px; }
table.lines input { width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
table.lines td:first-child { width: 45%; }
.bad-input { border-color: var(--bad) !important; background: #fdeceb !important; }
ul.plain { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 4px; }
.inv-edit-wrap { overflow-x: auto; margin-top: 10px; }
table.inv-edit td { padding: 3px 4px; }
table.inv-edit input, table.inv-edit select { width: 100%; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 14px; }
table.inv-edit input.narrow { min-width: 80px; }
table.inv-edit input.wide { min-width: 240px; }
table.inv-edit tr.dirty td { background: #fffaf0; }
.nowrap { white-space: nowrap; }
.dlg-field { display: grid; gap: 4px; margin: 8px 0; }
.dlg-field input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
#restore-dialog .tag { min-width: 0; }

/* ---------- صفحه سفارش‌ها: ستون‌ها، تعداد در صفحه ---------- */
th.filters-tools { white-space: nowrap; }
th.filters-tools .col-pick { display: inline-block; vertical-align: middle; }
th.filters-tools .col-menu { text-align: right; font-weight: normal; min-width: 280px; }
.col-menu .col-list { max-width: none; margin-bottom: 8px; }
.col-menu .col-move button { border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; padding: 0 6px; }
.pager-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.pager-row .pager { margin-top: 0; }
.page-size { display: flex; align-items: center; gap: 6px; color: var(--steel); font-size: 15px; }
.page-size select { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* ---------- چیدمان پلاک‌ها ---------- */
.nest-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .nest-layout { grid-template-columns: 1fr; } }
.nest-side .panel { padding: 12px 14px; margin-bottom: 12px; }
.nest-side h3 { margin: 0 0 8px; font-size: 17px; }
.nest-side label { display: grid; gap: 3px; margin-bottom: 8px; font-size: 15px; }
.nest-side label.check { display: flex; gap: 6px; align-items: center; }
.nest-side input[type=number], .nest-side select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; width: 100%; }
.nest-side .btn { width: 100%; margin-top: 4px; }
.nest-sel-actions { display: flex; gap: 6px; margin-bottom: 6px; }
.nest-sel-actions .btn { width: auto; }
.nest-groups { list-style: none; padding: 0; margin: 0; max-height: 46vh; overflow: auto; }
.nest-groups > li { border-bottom: 1px solid var(--line); padding: 4px 0; }
.nest-groups summary { cursor: pointer; list-style-position: inside; }
.nest-groups summary label { display: inline-flex !important; margin: 0; }
.nest-groups ul.plain { padding-right: 22px; }
.small-note { font-size: 13px; margin: 6px 0 0; }
.nest-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.nest-tabs .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.nest-canvas-wrap { background: #dfe5ea; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
#sheet-svg { width: 100%; height: auto; max-height: 75vh; display: block; touch-action: none; user-select: none; }
.nest-sheet { fill: #fff; stroke: #445; stroke-width: .4; }
.nest-margin { fill: none; stroke: #9ab; stroke-width: .2; stroke-dasharray: 2 2; }
.nest-plate { cursor: move; }
.nest-outline { fill: none; stroke: #c0392b; stroke-width: .3; }
.nest-plate.active .nest-outline { stroke: #f2b01e; stroke-width: .8; }
.nest-plate.bad .nest-outline { stroke: #e00; stroke-width: 1; fill: rgba(255,0,0,.12); }
.nest-status { margin-top: 8px; color: var(--steel); }
.nest-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.small-select { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; }
.manual-tag { font-size: 12px; margin-right: 4px; color: var(--amber-deep); white-space: nowrap; }
.rule-specs { grid-column: 1 / -1; }
.rule-specs .specs-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.rule-specs .specs-fields[hidden] { display: none; }
/* ---------- طراحی فرم QC ---------- */
.qc-tpl-table { width: 100%; }
.qc-tpl-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.qc-tpl-table input { width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.qd-list { padding-right: 22px; display: grid; gap: 6px; }
.qd-list li { display: flex; gap: 6px; align-items: center; }
.qd-list li input, .qd-item input { flex: 1; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.qd-item { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px; margin-bottom: 6px; }
.qd-btns { display: inline-flex; gap: 3px; }
.qd-btns button { border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; padding: 1px 7px; }
.qd-btns button.danger { color: var(--bad); }
.qd-add { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.qd-add textarea { width: 100%; min-width: 300px; margin: 6px 0; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
/* ---------- کلید روشن/خاموش انبار، کشو، جدول کالاها ---------- */
.switch-row { display: flex; gap: 16px; align-items: center; }
.switch-title { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.switch-state { font-size: 13px; padding: 2px 10px; border-radius: 12px; }
.switch-state.on { background: #e2f4e6; color: var(--ok); }
.switch-state.off { background: #eef0f2; color: var(--steel); }
.switch { position: relative; display: inline-block; width: 58px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: #c9d0d6; border-radius: 32px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 26px; height: 26px; top: 3px; right: 3px; background: #fff;
  border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(-26px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--amber); outline-offset: 2px; }
details.drawer > summary { cursor: pointer; list-style: none; display: flex; align-items: center; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > summary::before { content: "◂"; margin-left: 10px; color: var(--steel); transition: transform .2s; }
details.drawer[open] > summary::before { transform: rotate(-90deg); }
details.drawer > summary h2 { margin: 0; }
details.drawer[open] > summary { margin-bottom: 12px; }
table.inv-edit { font-size: 13px; }
table.inv-edit input, table.inv-edit select { font-size: 13px; }
table.inv-edit td:first-child, table.inv-edit th:first-child { white-space: nowrap; min-width: 92px; }
table.inv-edit td:first-child .tag { font-size: 12px; }
/* ---------- پنجره‌ی بارگذاری اکسل ---------- */
dialog.xl-dialog { border: none; border-radius: 10px; padding: 0; width: min(980px, 96vw); max-height: 90vh; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
dialog.xl-dialog::backdrop { background: rgba(20,30,40,.45); }
.xl-body { padding: 18px 20px; max-height: calc(90vh - 70px); overflow: auto; }
.xl-body h3 { margin: 0 0 10px; }
.xl-actions { display: flex; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); background: #f7f9fa; }
.xl-table-wrap { overflow: auto; }
.xl-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.xl-table td, .xl-table th { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: right; }
.xl-table tr.xl-new td { background: #f1faf3; }
.xl-table tr.xl-error td { background: #fdeceb; }
.xl-table select, .xl-all select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.xl-all { display: block; margin: 8px 0; }
/* ستون کد در جدول‌های انبار: یک خط */
table.inv-edit td:first-child, table.inv-edit th:first-child { min-width: 104px; }
table.inv-edit td:first-child .tag, #inv-table td[data-col=code] .tag { font-size: 11px; white-space: nowrap; padding: 1px 5px; }
#inv-table td[data-col=code], #inv-table th[data-col=code] { white-space: nowrap; min-width: 84px; }
/* کادرهای جدول کالاهای انبار هم‌تراز (کلاس عمومی .wide حاشیه‌ی پایین دارد) */
table.inv-edit input, table.inv-edit select { margin: 0; vertical-align: middle; box-sizing: border-box; height: 30px; }

/* ---------- محصولات پلاک‌دار: کشویی ---------- */
.plate-rule .rule-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; width: 100%; padding: 2px 0;
  background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink); text-align: right; }
.plate-rule .rh-name { font: 16px "BTitr", Tahoma, sans-serif; }
.plate-rule .rh-sub { color: var(--steel); font: 15px "BNazanin", Tahoma, sans-serif; }
.plate-rule .rh-arrow { display: inline-block; font-size: 12px; transition: transform .15s; transform: rotate(-90deg); }
.plate-rule.closed .rh-arrow { transform: none; }
.plate-rule.closed > .rule-grid, .plate-rule.closed > .rule-actions { display: none; }
.plate-rule.closed { padding-top: 8px; padding-bottom: 8px; }
.plate-rule .rule-head:hover .rh-name { text-decoration: underline; }
.plate-rule .rule-warn { grid-column: 1 / -1; margin: 0; color: #b42318; font-size: 15px; line-height: 1.8; }
.plate-rule.conflict { border-right-color: #b42318; }
.inv-multi { display: grid; gap: 6px; }
.inv-multi .muted { font-size: 13px; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-chips:empty { display: none; }
.inv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 4px; border: 1px solid var(--line);
  border-radius: 14px; background: #eef3f7; font-size: 15px; }
.inv-chip.missing { border-color: var(--bad); background: #fdeceb; }
.inv-chip button { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--steel); padding: 0 4px; }
/* جمع ستون‌های مبلغ (به‌جای کادر جستجو) */
th.col-sum { text-align: center; white-space: nowrap; line-height: 1.3; }
th.col-sum b { display: block; font: 15px Tahoma, sans-serif; color: var(--ink); direction: ltr; }
th.col-sum small { display: block; font-size: 12px; color: var(--steel); }
th.col-sum.partial b { color: #b45309; }
th small.unit { font-size: 12px; color: var(--steel); font-weight: normal; }
.designer-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.designer-entry h2 { margin-bottom: 4px; }
.designer-entry p { margin: 0; }
/* تقویم شمسی فیلتر تاریخ */
input[data-jcal] { cursor: pointer; background-color: #fff; }
.jcal { position: absolute; z-index: 60; width: 250px; padding: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); direction: rtl; }
.jcal[hidden] { display: none; }
.jcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.jcal-head b { font: 15px "BTitr", Tahoma, sans-serif; }
.jcal-head button { border: 0; background: #eef3f7; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; font-size: 18px; }
.jcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jcal-w { font-size: 12px; color: var(--steel); padding: 2px 0; }
.jcal-d { border: 0; background: none; border-radius: 6px; padding: 5px 0; cursor: pointer; font: 14px "BNazanin", Tahoma, sans-serif; color: #98a2ad; }
.jcal-d.has { color: var(--ink); font-weight: bold; background: #eef3f7; }
.jcal-d.today { outline: 1px solid var(--ink); }
.jcal-d.on { background: var(--ink); color: #fff; }
.jcal-d:hover { background: #dbe4ec; }
.jcal-foot { display: flex; gap: 6px; margin-top: 8px; }
.jcal-foot button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 0; cursor: pointer; font: 13px "BNazanin", Tahoma, sans-serif; }
/* فیلتر چندتایی وضعیت (داخل ردیف فیلترها؛ قواعد عمومی tr.filters input نباید روی تیک‌ها اثر کند) */
.multi-pick { position: relative; }
tr.filters .multi-btn { width: 100%; min-width: 120px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font: 15px "BNazanin", Tahoma, sans-serif; color: var(--ink); text-align: right; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.filters .multi-btn::after { content: " ▾"; color: var(--steel); }
tr.filters .multi-btn.on { border-color: var(--amber); background: #fffaf0; }
tr.filters .multi-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; min-width: 230px; max-height: 320px;
  overflow: auto; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  font: 15px "BNazanin", Tahoma, sans-serif; color: var(--ink); text-align: right; white-space: nowrap; }
tr.filters .multi-menu[hidden] { display: none; }
tr.filters .multi-menu label.check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px;
  font: 15px "BNazanin", Tahoma, sans-serif; cursor: pointer; border-radius: 4px; }
tr.filters .multi-menu label.check:hover { background: #eef3f7; }
tr.filters .multi-menu input[type=checkbox] { width: 16px; height: 16px; min-width: 0; flex: none; margin: 0; padding: 0;
  accent-color: var(--ink); background: none; box-shadow: none; }
tr.filters .multi-menu .btn { margin-top: 6px; font-family: "BNazanin", Tahoma, sans-serif; }
/* QC: قفل و نمایش عکس داخل صفحه */
.qc-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qc-lock.reopen { background: #fffaf0; border-color: var(--amber); }
.qc-thumb img[data-view] { cursor: zoom-in; }
.photo-view { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 32, .88); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 16px; cursor: zoom-out; }
.photo-view[hidden] { display: none; }
.photo-view img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; background: #fff; }
.photo-view .btn { background: #fff; }
/* آیکن‌های جلوی سفارش: دو ردیف سه‌تایی هم‌تراز */
.actions.act-grid { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 4px 6px; justify-content: end;
  align-items: center; flex-wrap: nowrap; white-space: nowrap; }
