/* فونت فارسی همراه برنامه (Vazirmatn، مجوز OFL) تا روی هر کامپیوتری یکسان و زیبا دیده شود، به‌خصوص ارقام */
@font-face { font-family: "Vazirmatn"; font-weight: 100 500; font-style: normal; font-display: swap;
  src: url("fonts/Vazirmatn-Regular.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn"; font-weight: 600 900; font-style: normal; font-display: swap;
  src: url("fonts/Vazirmatn-Bold.ttf") format("truetype"); }
:root {
  --bg: #f3f6fb;            /* پس‌زمینهٔ صفحه: خاکستری روشن؛ کارت‌ها سفیدند */
  --panel: #f7f9fd;         /* پس‌زمینه بخش‌های فرم */
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #6b7a90;
  --line: #e4eaf3;
  --brand: #2563eb;
  --brand-soft: #eaf1ff;
  --brand-ink: #ffffff;
  --side: #ffffff;
  --side-ink: #475569;
  --ok-bg: #e6f6ec; --ok-ink: #166534;
  --err-bg: #fdecec; --err-ink: #9b1c1c;
  --info-bg: #e8f0fe; --info-ink: #1e3a8a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Vazirmatn, Tahoma, "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.7;
}
h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; margin: 0; }
.muted, small.hint { color: var(--muted); }

/* ---------- قالب کلی ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand-box { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.brand-box .logo { height: 40px; }
.brand-box .brand-text { line-height: 1.3; }
.brand-box .brand-text strong { display: block; font-size: 1rem; }
.brand-box .brand-text small { color: var(--muted); font-size: .78rem; }
.search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.search input {
  background: var(--bg); border: 1px solid transparent; border-radius: 999px; padding: 9px 18px 9px 44px;
}
.search input:focus { background: #fff; border-color: var(--brand); outline: none; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.user-menu { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700;
}
.user-menu .who { line-height: 1.25; }
.user-menu .who small { display: block; color: var(--muted); font-size: .78rem; }
.user-menu form { margin: 0; }
.logout {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 6px 12px; font: inherit; font-size: .85rem; color: var(--ink); cursor: pointer;
}
.logout:hover { border-color: var(--brand); color: var(--brand); }
.logout svg { width: 16px; height: 16px; }

.body { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--side); border-inline-end: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; color: var(--side-ink); text-decoration: none;
  padding: 11px 14px; border-radius: 12px; border-inline-start: 3px solid transparent;
}
.sidebar nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; border-inline-start-color: var(--brand); }
.sidebar .foot { margin-top: auto; padding: 12px 8px; color: var(--muted); font-size: .78rem; }
.btn-link {
  background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit;
}
.content { flex: 1; min-width: 0; padding: 24px 28px 40px; background: var(--bg); }
.content.centered { margin: 0 auto; padding-top: 10vh; max-width: 440px; flex: none; background: transparent; }
body.plain { background: linear-gradient(160deg, #eaf1ff 0%, var(--bg) 55%); min-height: 100vh; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card.pad { padding: 18px 20px; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; max-width: 1100px; }
.login-card { display: flex; flex-direction: column; gap: 8px; padding: 28px; }
.logo { height: 56px; width: auto; display: block; }
.login-logo { margin: 0 auto 10px; }
h1 { letter-spacing: -.2px; }

/* ---------- فیلدها و دکمه‌ها ---------- */
label { font-weight: 600; font-size: .92rem; }
.req { color: #d33; }
input, select, textarea {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #eef1f6; opacity: .75; cursor: not-allowed; }
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
.btn {
  display: inline-block; font: inherit; padding: 9px 22px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.small { padding: 5px 14px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  border: 0; background: transparent; color: var(--err-ink); cursor: pointer; font-size: 1rem; padding: 4px 8px;
}

.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.success { background: var(--ok-bg); color: var(--ok-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }
.flash.info { background: var(--info-bg); color: var(--info-ink); }
.flash ul { margin: 6px 0 0; padding-inline-start: 20px; }

/* ---------- داشبورد ---------- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: min-content; align-items: start; gap: 16px; margin-top: 16px; max-width: 980px;
}
.tile {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.tile .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.tile .ico svg { width: 24px; height: 24px; }
.tile .txt { display: flex; flex-direction: column; line-height: 1.4; }
.tile .step { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.tile strong { font-size: 1.02rem; }
.tile.active:hover { border-color: var(--brand); box-shadow: 0 6px 20px rgba(37,99,235,.15); }
.tile.locked { opacity: .55; cursor: not-allowed; border-style: dashed; box-shadow: none; }
.tile.locked .ico { background: #eef1f6; color: var(--muted); }

/* ---------- فرم پرونده ---------- */
.form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.form-head h1 { margin: 0; font-size: 1.35rem; }
.case-form { display: flex; flex-direction: column; gap: 14px; max-width: 1040px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field.wide { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.case-form.locked .panel:not(:first-of-type) { opacity: .6; }

.table-wrap { overflow-x: auto; }
.subtable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.subtable th { background: #f1f5fb; color: var(--ink); font-size: .85rem; padding: 8px 8px; text-align: right; }
.subtable td { padding: 6px 6px; border-bottom: 1px solid var(--line); min-width: 110px; }
.subtable td.center { text-align: center; min-width: 70px; }
.subtable td.center input { width: 20px; height: 20px; }
.subtable td.rowtool { min-width: 44px; width: 44px; text-align: center; }
.subtable tbody:empty::after { content: "ردیفی ثبت نشده است."; display: block; padding: 10px; color: var(--muted); }

.actionbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 0; background: linear-gradient(to top, #fff 75%, rgba(255,255,255,0));
}

/* ---------- لیست و فیلتر ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; max-width: 700px; }
.filters select { width: 160px; }
.filters input { flex: 1; min-width: 200px; }
.table-wrap.card { padding: 0; overflow: hidden; }
.table-wrap.card table { margin: 0; }
table { width: 100%; border-collapse: collapse; }
.card table th, .card table td { text-align: right; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.card table th { color: var(--muted); font-weight: 600; font-size: .85rem; background: #f8fafd; }
.card table tbody tr:hover td { background: #fafcff; }
.card table td.actions { display: flex; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }
.card table tbody tr:last-child td { border-bottom: 0; }
a { color: var(--brand); }

/* ---------- مدیریت گزینه‌ها ---------- */
.option-group { margin-bottom: 14px; max-width: 760px; }
.option-group h2 { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--line); }
.chip.off { opacity: .55; text-decoration: line-through; }
.chip-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font: inherit; font-size: .8rem; text-decoration: none; }
.add-options { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.add-options textarea { max-width: 420px; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .body { flex-direction: column; }
  .sidebar { width: 100%; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar .foot { display: none; }
  .content { padding: 16px; }
  .field.wide { grid-column: auto; }
}

/* ---------- تقویم شمسی ---------- */
input.jdate {
  cursor: pointer;
  padding-left: 34px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7587' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M16 3v4M8 3v4M3 10h18'/></svg>") no-repeat left 10px center;
}
input.jdate:disabled { background-color: #eef1f6; cursor: not-allowed; }
.jdp {
  position: absolute; z-index: 1000; width: 280px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 33, 61, .18);
}
.jdp[hidden] { display: none; }
.jdp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.jdp-head select { padding: 4px 6px; flex: 1; min-width: 0; }
.jdp-nav {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 32px; height: 32px;
  font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.jdp-nav:hover { border-color: var(--brand); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-wd { font-size: .78rem; color: var(--muted); padding: 4px 0; }
.jdp-day {
  border: 0; background: transparent; border-radius: 8px; height: 34px; cursor: pointer;
  font: inherit; font-size: .92rem; color: var(--ink);
}
.jdp-day:hover { background: #e8f0fe; }
.jdp-fri { color: #c0392b; }
.jdp-today { outline: 1px solid var(--brand); }
.jdp-sel, .jdp-sel:hover { background: var(--brand); color: #fff; }
.jdp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.jdp-foot button { border: 0; background: none; color: var(--brand); cursor: pointer; font: inherit; padding: 4px 8px; }

/* ---------- ویژگی‌های نسخه ۲.۲ ---------- */
[hidden] { display: none !important; }
.grid.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .grid.cols4 { grid-template-columns: 1fr; } }
input[type="time"] { direction: ltr; text-align: right; }
.cond-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.small-note { font-size: .85rem; margin: 0 0 8px; }
a.sort { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
a.sort:hover, a.sort.on { color: var(--brand); }
a.sort .arrow { font-size: .75rem; opacity: .7; }
.case-table .note-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.card table td .btn.small { padding: 3px 12px; }
.cards-2 { max-width: none; }
input[type="file"] { width: auto; border: 0; padding: 4px 0; background: transparent; }
.add-options label { margin-top: 4px; }

/* ---------- کمبوباکس قابل جستجو ---------- */
.ss { position: relative; }
.ss-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: right;
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); cursor: pointer; min-height: 42px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px;
}
.ss-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ss-btn.empty span { color: #9aa6b8; }
.ss-btn:disabled { background-color: #eef1f6; opacity: .75; cursor: not-allowed; }
.ss-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ss-btn:hover:not(:disabled) { border-color: var(--brand); }
.ss-pop {
  position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, .18); padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.ss-pop[hidden] { display: none !important; }
.ss-q { background: var(--bg); border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; }
.ss-q:focus { background: #fff; border-color: var(--brand); outline: none; }
.ss-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; position: relative; }
.ss-list li { padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.ss-list li.hot, .ss-list li:hover { background: var(--brand-soft); }
.ss-list li.cur { font-weight: 700; color: var(--brand); }
.ss-list li.none { color: var(--muted); }
.ss-list li.empty { color: var(--muted); cursor: default; }
.ss-list li.empty:hover { background: none; }

/* ---------- لیبل‌های کوچک‌تر + دکمهٔ + + پنجرهٔ افزودن گزینه ---------- */
label { font-weight: 500; font-size: .8rem; color: #475569; }
.panel-title h2, .panel h2 { font-size: .95rem; }
.field { gap: 4px; }
.ss { display: flex; gap: 6px; align-items: stretch; }
.ss .ss-btn { flex: 1; min-width: 0; width: auto; }
.ss-add {
  flex: 0 0 40px; border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 10px;
  font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.ss-add:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
.ss-add:disabled { background: #eef1f6; color: #a9b4c4; cursor: not-allowed; }
.ss-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .35); display: grid; place-items: center; }
.ss-modal[hidden] { display: none !important; }
.ss-box { background: #fff; border-radius: 14px; padding: 18px 20px; width: min(380px, 92vw); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); display: flex; flex-direction: column; gap: 10px; }
.ss-box h3 { margin: 0; font-size: .98rem; }
.ss-err { color: var(--err-ink); font-size: .82rem; margin: 0; min-height: 1.2em; }
.ss-acts { display: flex; gap: 8px; }
.subtable td { min-width: 150px; }

/* مداد ویرایش کنار + */
.ss-edit {
  flex: 0 0 40px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 10px;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.ss-edit:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.ss-edit:disabled { background: #eef1f6; color: #c2cad6; cursor: not-allowed; }
.ss-note { margin: 0; font-size: .8rem; color: var(--muted); }
.ss-note:empty { display: none; }

/* ---------- نسخه ۲.۱۱: فرم عریض‌تر و فشرده‌تر تا در یک مانیتور جا شود ---------- */
.case-form { max-width: 1700px; }
.content { padding: 14px 22px 8px; }
.panel { padding: 12px 16px; }
.case-form { gap: 10px; }
.grid.cols5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.cols5 .newrow { grid-column-start: 1; }
@media (max-width: 1250px) { .grid.cols5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .grid.cols5 { grid-template-columns: 1fr; } }
.ss-add, .ss-edit { flex: 0 0 34px; }
.ss { gap: 4px; }
.subtable.fixed { table-layout: fixed; }
.subtable.fixed td { min-width: 0; }
.subtable.fixed td.rowtool { width: auto; min-width: 0; }
.subtable.fixed th { white-space: nowrap; }
.case-form .table-wrap { overflow-x: visible; }

/* ---------- نسخه ۲.۱۲: پاپ‌آپ اطلاعات شناسنامه ---------- */
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pf-open[disabled] { opacity: .55; cursor: not-allowed; }
.pf-modal { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .4); display: grid; place-items: center; padding: 16px; }
.pf-box { background: #fff; border-radius: 16px; width: min(1100px, 100%); max-height: 94vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); }
.pf-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pf-head h2 { margin: 0; font-size: 1.05rem; }
.pf-form { padding: 14px 20px 0; overflow-y: auto; }
.grid.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.cols3 { grid-template-columns: 1fr; } }
.pf-sub { margin: 16px 0 6px; font-size: .95rem; }
.pf-prices td { min-width: 0; }
.pf-msg { min-height: 1.4em; margin-top: 8px; font-size: .88rem; }
.pf-msg.ok { color: #15803d; } .pf-msg.bad { color: var(--err-ink); }
.pf-actions { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 12px 0 14px; background: #fff; }
body.pf-lock { overflow: hidden; }
.badge-ok { background: #dcfce7; color: #15803d; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
td.center { text-align: center; }

/* ---------- نسخه ۲.۱۳: مدیریت گزینه‌ها منظم و تمام‌عرض ---------- */
.opt-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.opt-jump a { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .82rem; }
.opt-jump a:hover { border-color: var(--brand); color: var(--brand); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.opt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
.opt-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.opt-card h2 { margin: 0; font-size: .95rem; }
.opt-count { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.opt-filter { padding: 6px 10px; border-radius: 8px; font-size: .85rem; }
.opt-list { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.opt-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.opt-list li:last-child { border-bottom: 0; }
.opt-list li[hidden] { display: none; }
.opt-list li.off .opt-label { opacity: .5; text-decoration: line-through; }
.opt-list li.empty { justify-content: center; padding: 14px; }
.opt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.opt-list form { margin: 0; flex-shrink: 0; }
.opt-add { display: flex; gap: 6px; align-items: flex-start; }
.opt-add textarea { flex: 1; min-height: 34px; padding: 6px 10px; font-size: .85rem; resize: vertical; }
.opt-add .btn { white-space: nowrap; }

/* ---------- نسخه ۲.۱۴: دسترسی کاربران و ویرایش همزمان ---------- */
.flash.warn { background: #fef3c7; color: #92400e; }
.seat-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .8rem; white-space: nowrap; border: 1px solid var(--line); }
.seat-chip.mine { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.dot.live, .seat-chip.mine .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.us-top { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.4fr); gap: 14px; margin-bottom: 14px; align-items: start; }
@media (max-width: 1000px) { .us-top { grid-template-columns: 1fr; } }
.us-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.us-top .us-card { margin-bottom: 0; }
.us-card header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.us-card h2 { margin: 0; font-size: .98rem; }
.us-big { font-size: 1.8rem; font-weight: 700; color: var(--brand); line-height: 1; }
.us-big small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.us-count { color: var(--muted); font-size: .8rem; }
.us-seats { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.us-seats li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .88rem; }
.us-seats li form { margin-inline-start: auto; }
.us-max { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.us-max input { width: 70px; padding: 6px 8px; }
.us-caps, .us-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.us-caps th, .us-caps td, .us-table th, .us-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.us-caps td.c { text-align: center; color: #15803d; font-weight: 700; }
.us-caps td.c:is(:empty) { color: var(--muted); }
.us-caps thead th, .us-table thead th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.role { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.r-admin { background: #ede9fe; color: #5b21b6; } .r-entry { background: #dbeafe; color: #1d4ed8; } .r-viewer { background: #f1f5f9; color: #475569; }
.us-table tr.off td { opacity: .55; }
.us-table input, .us-table select { padding: 5px 8px; font-size: .85rem; border-radius: 8px; min-width: 0; }
.us-name input { width: 150px; }
.us-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.us-pw summary { cursor: pointer; color: var(--brand); font-size: .82rem; list-style: none; }
.us-pw form { display: flex; gap: 6px; margin-top: 6px; }
.us-pw input { width: 140px; }
.badge-soft, .badge-off { border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-soft { background: #f1f5f9; color: #475569; } .badge-off { background: #fee2e2; color: #b91c1c; }
.badge-ok .dot { margin-inline-end: 6px; }
.us-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; }
@media (max-width: 700px) { .seat-chip { display: none; } }

/* موبایل: منوی افقی بدون شکستن متن */
@media (max-width: 760px) { .sidebar nav a { white-space: nowrap; } }

/* ---------- گزارش فعالیت‌ها ---------- */
.lg-filter { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; padding: 12px 14px; margin-bottom: 10px; }
.lg-filter label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.lg-filter label.grow { flex: 1 1 220px; }
.lg-filter input, .lg-filter select { min-width: 130px; }
.lg-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lg-table td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.lg-act { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: #eef2fb; color: #2b4a8b; white-space: nowrap; }
.lg-login_fail, .lg-backup_restore, .lg-user_password { background: #fdecec; color: #b42318; }
.lg-case_create, .lg-login { background: #e7f7ee; color: #17803d; }
.lg-case_edit, .lg-profile_edit { background: #fff4de; color: #9a5b00; }
.lg-det { margin-top: 6px; }
.lg-det summary { cursor: pointer; color: var(--brand); font-size: .84rem; }
.lg-diff { border-collapse: collapse; margin-top: 6px; font-size: .84rem; }
.lg-diff td { padding: 3px 10px; border-bottom: 1px dashed var(--line); }
.lg-diff .old { color: #b42318; text-decoration: line-through; }
.lg-diff .new { color: #17803d; font-weight: 600; }
.lg-diff .arrow { color: var(--muted); }
.lg-pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 14px 0; }

/* ---------- پاپ‌آپ خوش‌آمدگویی و نسخه ---------- */
.wl-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; animation: wlfade .25s ease; }
.wl-box { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 28px 26px 20px; text-align: center; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); animation: wlpop .3s ease; }
.wl-logo { height: 56px; max-width: 100%; object-fit: contain; margin-bottom: 8px; }
.wl-box h2 { margin: 6px 0 2px; font-size: 1.25rem; }
.wl-hello { margin: 10px 0 2px; font-weight: 700; font-size: 1.05rem; }
.wl-text { margin: 0 0 18px; color: var(--muted); line-height: 1.9; }
.wl-box .btn { min-width: 150px; }
.wl-ver { display: block; margin-top: 12px; color: var(--muted); font-size: .72rem; }
.login-ver { display: block; text-align: center; margin-top: 10px; color: var(--muted); }
@keyframes wlfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wlpop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wl-modal, .wl-box { animation: none; } }

/* ---------- دکمه‌های ابتدای ردیف محصول، تاریخ دستی ---------- */
.rowtool-lead { white-space: nowrap; width: 1%; }
.rt-btns { display: flex; gap: 4px; justify-content: center; direction: ltr; }
.rt-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; font: inherit; font-size: .95rem; line-height: 1; padding: 0; display: inline-grid; place-items: center; }
.rt-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.rt-btn.rt-del { border-color: #f1b6b0; color: #c0392b; font-size: .8rem; }
.rt-btn.rt-del:hover { background: #fdecec; border-color: #c0392b; color: #c0392b; }
.jdate-bad { border-color: #dc2626 !important; background-color: #fff5f5 !important; }
.jdate-msg { display: block; color: #b42318; font-size: .78rem; margin-top: 4px; line-height: 1.6; }
.jdate-msg[hidden] { display: none; }

/* فیلد قفل‌شده (فقط خواندنی و پر شدن خودکار) */
.locked-field, input[readonly].locked-field { background: var(--bg); color: var(--muted); cursor: not-allowed; }

/* ---- پاپ‌آپ‌های شیشه‌ای */
.wl-modal, .pf-modal, .ss-modal { background: rgba(15, 23, 42, .28); -webkit-backdrop-filter: blur(7px) saturate(140%); backdrop-filter: blur(7px) saturate(140%); }
.wl-box, .pf-box, .ss-box {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .8);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wl-box, .pf-box, .ss-box { background: rgba(255, 255, 255, .96); }
}
.sv-box { padding-top: 24px; }
.sv-ico { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  color: #15803d; background: rgba(34, 197, 94, .18); border: 1px solid rgba(34, 197, 94, .35); }
.sv-text { color: var(--ink); font-weight: 700; font-size: 1.02rem; margin-bottom: 18px; }
.jdp, .ss-pop { -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
.jdp, .ss-pop { background: rgba(255, 255, 255, .84); }
.sv-box { width: min(460px, 100%); }

/* =====================================================================
   قالب «شیشه‌ای بنفش» — فقط ظاهر؛ هیچ منطقی به آن وابسته نیست.
   برای برگشت به قالب قبلی، همین بخش را تا انتهای فایل پاک کنید.
   ===================================================================== */
:root {
  --bg: #eeeafa;
  --panel: rgba(255, 255, 255, .5);
  --surface: rgba(255, 255, 255, .66);
  --ink: #1f1b3a;
  --muted: #7a7597;
  --line: rgba(124, 102, 214, .16);
  --brand: #6d4fe0;
  --brand-soft: rgba(109, 79, 224, .12);
  --side: rgba(255, 255, 255, .6);
  --side-ink: #4a4570;
  --radius: 20px;
  --glass-blur: blur(18px) saturate(170%);
  --shadow: 0 1px 2px rgba(60, 40, 140, .05), 0 10px 30px rgba(94, 70, 200, .10);
  --lav: linear-gradient(160deg, rgba(235, 228, 255, .75), rgba(246, 242, 255, .6));
}
body {
  background: radial-gradient(900px 520px at 85% -8%, #d9cffa 0%, transparent 62%),
              radial-gradient(800px 500px at 0% 105%, #cfd9fb 0%, transparent 60%),
              linear-gradient(160deg, #f3f0fd 0%, #e9e6f8 100%);
  background-attachment: fixed;
}
body.plain { background: radial-gradient(800px 500px at 80% 0%, #d9cffa 0%, transparent 60%), linear-gradient(160deg, #f3f0fd, #e6e2f7); }
.content { background: transparent; }

/* نوار بالا و منوی کناری: کارت‌های شیشه‌ای شناور */
.topbar {
  margin: 14px 18px 0; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}
.sidebar {
  margin: 14px 18px 18px 0; border-radius: 26px; border: 1px solid rgba(255, 255, 255, .75);
  background: var(--side); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow); align-self: flex-start; position: sticky; top: 86px; min-height: calc(100vh - 118px);
}
.sidebar nav a { border-inline-start: 0; border-radius: 14px; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: rgba(109, 79, 224, .08); }
.sidebar nav a.active { background: rgba(109, 79, 224, .14); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(109, 79, 224, .12); }
.search input { background: rgba(255, 255, 255, .7); border: 1px solid rgba(124, 102, 214, .14); }
.search input:focus { background: #fff; }
.avatar { background: linear-gradient(135deg, #e5dcff, #d3c6ff); color: #5a3fd0; }
.logout { background: rgba(255, 255, 255, .7); }

/* کارت‌ها و بخش‌ها */
.card, .panel, .dcard, .kpi, .dash-filters {
  background: var(--surface); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow);
}
/* باکس محصولات: بنفش خیلی کمرنگ (مثل کادر «پروفرم» در نمونه) */
.panel:has(#products) { background: linear-gradient(160deg, rgba(228, 219, 255, .62), rgba(242, 238, 255, .55)); border-color: rgba(167, 146, 240, .35); }
.panel:has(#products) .subtable { background: rgba(255, 255, 255, .55); }
.subtable { background: rgba(255, 255, 255, .6); border-radius: 12px; }
.subtable th { background: rgba(109, 79, 224, .09); color: #3d3470; }
.subtable td { border-bottom-color: rgba(124, 102, 214, .12); }
.cond-box { background: rgba(255, 255, 255, .55); border-color: rgba(124, 102, 214, .3); }
.seg { background: rgba(109, 79, 224, .09); }
.seg button.on { color: var(--brand); }
.fchip { border-color: rgba(109, 79, 224, .3); background: rgba(109, 79, 224, .1); color: #5238c4; }
.fchip:hover { background: rgba(109, 79, 224, .18); }
.kpi.warn { background: linear-gradient(180deg, rgba(255, 247, 222, .9), rgba(255, 255, 255, .7)); }
.dcard h2, .panel h2, h1 { color: #2d2457; }
h1 { color: #5b3fd0; }

/* فیلدها و دکمه‌ها */
input, select, textarea { background: rgba(255, 255, 255, .78); border-color: rgba(124, 102, 214, .2); border-radius: 12px; }
input:disabled, select:disabled, textarea:disabled { background: rgba(120, 110, 170, .1); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline-color: var(--brand); }
.btn { background: rgba(255, 255, 255, .75); border-color: rgba(124, 102, 214, .22); border-radius: 12px; }
.btn:hover:not(:disabled) { border-color: var(--brand); background: #fff; }
.btn.primary { background: linear-gradient(135deg, #8a63f0, #6d3fd8); border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px rgba(109, 63, 216, .32); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(135deg, #8a63f0, #6d3fd8); }
.ss-btn, .ss-add, .ss-edit { background: rgba(255, 255, 255, .75); }
.flash { border-radius: 14px; }
.actionbar { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .8); }
.table-wrap.card { background: rgba(255, 255, 255, .62); }
.case-table th, .data-table th { background: rgba(109, 79, 224, .08); }

/* موبایل و تبلت: منو و نوار بالا کم‌حاشیه */
@media (max-width: 760px) {
  .topbar { margin: 8px 8px 0; border-radius: 18px; }
  .sidebar { margin: 8px 8px 0; border-radius: 18px; position: static; min-height: 0; align-self: stretch; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .sidebar, .card, .panel, .dcard, .kpi, .dash-filters, .actionbar { background: rgba(255, 255, 255, .94); }
}
.actionbar { padding: 12px 16px; margin-top: 8px; }
html { background: #e9e6f8; }

.upd-dot { margin-inline-start: auto; background: linear-gradient(135deg, #8a63f0, #6d3fd8); color: #fff; font-size: .68rem; padding: 1px 8px; border-radius: 999px; }
.upd-dot[hidden] { display: none; }
.upd-box { max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
.upd-ver { display: flex; gap: 24px; flex-wrap: wrap; }
.upd-ver b { font-size: 1.3rem; }
.upd-notes { white-space: pre-line; background: rgba(109, 79, 224, .08); border-radius: 12px; padding: 10px 14px; }
.sv-bad .sv-ico { background: rgba(220,60,60,.15); color: #c0392b; }
.org-link { display:inline-block; margin-top:4px; font-size:.82rem; }

/* پنجرهٔ پیشرفت به‌روزرسانی */
.upd-pop { width: min(460px, 100%); text-align: center; }
.upd-bar { height: 16px; border-radius: 99px; background: rgba(120, 100, 190, .15); overflow: hidden; margin: 16px 0 6px; border: 1px solid rgba(120, 100, 190, .25); }
.upd-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #8b6cf0, #b79cff); transition: width .45s ease; }
.upd-pct { font-weight: 800; font-size: 1.5rem; color: var(--ink); margin-bottom: 8px; }
.upd-modal.bad .upd-fill { background: #c0392b; }
.nav-btn { background: none; border: 0; font: inherit; color: inherit; width: 100%; text-align: right; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.nw-box { width: min(520px, 100%); text-align: right; }
.nw-box h2 { text-align: center; }
.nw-list { margin: 10px 0 14px; padding-inline-start: 22px; line-height: 2; }
.nw-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; cursor: pointer; }
.nw-box .btn { display: block; margin: 0 auto; }
.upd-modal.waiting .upd-fill { background-size: 200% 100%; background-image: linear-gradient(90deg, #8b6cf0, #d4c4ff, #8b6cf0); animation: updshine 1.6s linear infinite; }
@keyframes updshine { from { background-position: 200% 0; } to { background-position: 0 0; } }
.search-row { margin: 0 0 12px; } .search-row input { width: 100%; max-width: 420px; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(120,100,190,.3); background: rgba(255,255,255,.8); font: inherit; }

/* بزرگ/کوچک‌نمایی برنامه */
.app { min-height: calc(100vh / var(--z, 1)); }
.zoom-ctl { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.7); border: 1px solid rgba(120,100,190,.25); border-radius: 12px; padding: 2px; }
.zoom-ctl button { border: 0; background: transparent; font: inherit; cursor: pointer; min-width: 30px; height: 30px; border-radius: 9px; color: var(--ink); }
.zoom-ctl button:hover { background: rgba(120,100,190,.14); }
#zm-val { min-width: 52px; font-size: .82rem; }
@media (max-width: 800px) { .zoom-ctl { display: none; } }
.org-link { border: 0; background: none; padding: 0; margin-top: 4px; font: inherit; font-size: .82rem; color: var(--brand, #6d4fd6); cursor: pointer; }
.org-link:hover { text-decoration: underline; }
.org-box { width: min(440px, 100%); text-align: right; }
.org-box h2 { text-align: center; margin-bottom: 14px; }
.org-box .field { margin-bottom: 12px; }
.org-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.subtable td.hid { display: none; } #contacts input { width: 100%; }
.org-box { width: min(980px, 100%) !important; max-height: 90vh; overflow: auto; } .org-box .subtable input { width: 100%; min-width: 90px; } .org-box h3 { margin: 0; }

/* v2.51 */
.dev-credit { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.08); font-size: .74rem; }
.dev-credit b { color: var(--brand); font-weight: 700; }
.login-dev { text-align: center; margin-top: 14px; font-size: .78rem; color: var(--muted); }
.login-dev b { color: var(--brand); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.st-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.08); color: inherit; text-decoration: none; }
.st-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.st-card svg { width: 26px; height: 26px; color: var(--brand); }
.st-card b { font-size: 1.02rem; }
.st-card small { color: var(--muted); }
.upd-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; background: #fff4d6; border: 1px solid #f0c050; color: #6a4a00; }
.upd-banner[hidden] { display: none; }
.upd-banner a { margin-inline-start: auto; }
.dash-hide-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.dash-hide-box label { display: flex; gap: 6px; align-items: center; }

#serial_no, .serial-bold { font-weight: 800 !important; font-size: 1.05rem; color: var(--text, #111) !important; opacity: 1; -webkit-text-fill-color: currentColor; }
.clock-center, input.clock-center { text-align: center !important; }
.upd-dot { margin-inline-start: auto; }
.ss-act { display: flex; gap: 6px; align-items: center; margin: 8px 0; font-size: .92rem; }
.ss-act[hidden] { display: none; }

/* ---- پاپ‌آپ پیام (سبز، بدون دکمه؛ با کلیک یا چند ثانیه بعد بسته می‌شود) */
.sv-toast { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .14); cursor: pointer; animation: wlfade .2s ease; }
.sv-toast .sv-card { display: flex; align-items: center; gap: 18px; width: min(680px, 100%); padding: 24px 28px; border-radius: 24px;
  background: #fff; border: 1.5px solid #bfe6c8; box-shadow: 0 24px 60px rgba(15, 23, 42, .22); animation: wlpop .25s ease; }
.sv-toast .sv-ico { flex: none; width: 62px; height: 62px; margin: 0; border-radius: 50%; display: grid; place-items: center; background: #4aa152; color: #fff; border: 0; }
.sv-toast .sv-ico svg { width: 32px; height: 32px; }
.sv-toast .sv-text { margin: 0; flex: 1; text-align: right; color: #1d5a2a; font-weight: 800; font-size: 1.12rem; line-height: 2; }
.sv-toast.sv-bad .sv-card { border-color: #efbdbd; }
.sv-toast.sv-bad .sv-ico { background: #d9534f; color: #fff; }
.sv-toast.sv-bad .sv-text { color: #8f2623; }

/* ---- مدیریت گزینه‌ها: لیست زیر هم، هر گروه با کلیک باز می‌شود */
.opt-top { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 6px 0 14px; }
.opt-top input { flex: 1; }
.opt-acc { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.opt-acc .opt-card { border-radius: 14px; background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.08); padding: 0; }
.opt-acc .opt-card[hidden] { display: none; }
.opt-acc .opt-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; font-weight: 700; }
.opt-acc .opt-card > summary::-webkit-details-marker { display: none; }
.opt-acc .opt-card > summary::before { content: "‹"; font-size: 1.3rem; color: var(--brand); transition: transform .15s; order: 3; }
.opt-acc .opt-card[open] > summary::before { transform: rotate(-90deg); }
.opt-acc .opt-card[open] > summary { border-bottom: 1px solid rgba(0,0,0,.07); }
.opt-acc .opt-count { margin-inline-start: auto; font-weight: 400; color: var(--muted); font-size: .85rem; }
.opt-acc .opt-body { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.opt-acc .opt-list { max-height: 360px; overflow: auto; }

/* ---- صفحهٔ بکاپ */
.bk-run { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.bk-h { margin: 6px 0 10px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bk-box { display: flex; flex-direction: column; gap: 6px; }
.bk-box h3 { margin: 0; }
.bk-on { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.bk-other { margin-top: 12px; }
.bk-other summary { cursor: pointer; color: var(--muted); }
.bk-other textarea { width: 100%; margin-top: 8px; }

/* نشانهٔ قرمز «۱» وقتی نسخهٔ تازه آماده است */
.upd-dot { background: #e5322d !important; color: #fff !important; min-width: 20px; height: 20px; padding: 0 !important; border-radius: 50% !important;
  display: inline-grid; place-items: center; font-size: .74rem !important; font-weight: 700; line-height: 1; box-shadow: 0 0 0 3px rgba(229, 50, 45, .18); }
.upd-dot[hidden] { display: none !important; }
.bk-on { flex-direction: row !important; justify-content: flex-start; }
.bk-on input[type=checkbox] { width: auto !important; min-width: 0; flex: none; }
.bk-path { display: flex; gap: 8px; align-items: center; }
.bk-path input { flex: 1; min-width: 0; }
.bk-path .btn { white-space: nowrap; }

/* ===== طرح تمیز و سفید (الهام از نمونهٔ حسابداری): بدون بنفش و شیشه ===== */
:root {
  --bg: #f4f6fa; --panel: #ffffff; --surface: #ffffff;
  --ink: #1f2937; --muted: #6b7280; --line: #e5e9f0;
  --brand: #2563eb; --brand-soft: #e8f0ff; --side: #ffffff; --side-ink: #374151;
  --radius: 16px; --glass-blur: none;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
}
html { background: #f4f6fa; }
body, body.plain { background: #f4f6fa; background-attachment: scroll; }
.topbar, .sidebar, .card, .panel, .dcard, .kpi, .dash-filters, .actionbar, .table-wrap.card {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.topbar { border-radius: 16px; }
.sidebar { border-radius: 16px; }
.sidebar nav a:hover { background: #f3f5f9; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.search input { background: #f6f8fb; border: 1px solid var(--line); }
.avatar { background: #2563eb; color: #fff; }
.logout { background: #fff; }
.panel:has(#products), .panel:has(#products) .subtable { background: #fff; border-color: var(--line); }
.subtable { background: #fff; }
.subtable th, .case-table th, .data-table th { background: #f6f8fb; color: #374151; }
.subtable td { border-bottom-color: var(--line); }
.cond-box { background: #fafbfd; border-color: var(--line); }
.seg { background: #eef2f7; }
.fchip { border-color: #cfe0ff; background: #eef4ff; color: #1d4ed8; }
.fchip:hover { background: #e0ebff; }
.dcard h2, .panel h2 { color: #111827; }
h1 { color: #111827; }
input, select, textarea { background: #fff; border-color: #d9dfe8; border-radius: 10px; }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f7; }
.btn { background: #fff; border-color: #d9dfe8; border-radius: 10px; }
.btn:hover:not(:disabled) { border-color: var(--brand); background: #f6f9ff; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: none; }
.btn.primary:hover:not(:disabled) { background: #1d4ed8; filter: none; }
.ss-btn, .ss-add, .ss-edit { background: #fff; }
.upd-dot { background: #dc2626; }
.upd-notes { background: #f3f6fb; }
.upd-fill { background: #2563eb; }
.upd-bar { background: #eef2f7; border-color: var(--line); }

/* ===== استاندارد یکسان فیلدها: ارتفاع ۴۰، فلش کمبوها، تاریخ کوتاه‌تر ===== */
:root {
  --ctl-h: 40px; --ctl-fs: .94rem;
  --chev: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, .ss-btn {
  height: var(--ctl-h); min-height: var(--ctl-h); padding-top: 0; padding-bottom: 0; font-size: var(--ctl-fs); line-height: 1.4;
}
.btn { min-height: var(--ctl-h); padding-top: 0; padding-bottom: 0; font-size: var(--ctl-fs); display: inline-flex; align-items: center; justify-content: center; }
.btn.small { min-height: 34px; font-size: .88rem; }
.ss-add, .ss-edit { height: var(--ctl-h); min-height: var(--ctl-h); width: var(--ctl-h); padding: 0; }
textarea { font-size: var(--ctl-fs); padding-top: 8px; padding-bottom: 8px; }
/* فلش پایین برای همهٔ کمبوها (قبلاً با background شورت‌هند پاک شده بود) */
select, .ss-btn {
  -webkit-appearance: none; appearance: none;
  background-color: #fff; background-image: var(--chev); background-repeat: no-repeat;
  background-position: left 12px center; padding-left: 34px;
}
select:disabled, .ss-btn:disabled { background-color: #f1f3f7; }
/* تاریخ و ساعت: کوتاه‌تر */
.field input.jdate, input.jdate { max-width: 190px; }
.field input.jtime { max-width: 130px; }
.subtable.fixed td { padding: 6px 4px; }
.subtable .ss-add, .subtable .ss-edit { width: 30px; flex: 0 0 30px; }
.subtable .ss { gap: 3px; }

/* آیکون دکمه‌ها */
.btn { gap: 7px; }
.btn-ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.small .btn-ico { width: 15px; height: 15px; }
/* باکس محصولات: کمی خاکستری */
.panel:has(#products) { background: #eef0f4; border-color: #dfe3ea; }
.panel:has(#products) .subtable, .panel:has(#products) .subtable td { background: transparent; }
.panel:has(#products) .subtable th { background: #e4e8ee; }
.panel:has(#products) .subtable td { border-bottom-color: #d9dee6; }
.subtable.fixed th { text-align: center; white-space: normal; line-height: 1.3; }
.subtable .ss-add, .subtable .ss-edit { width: 26px; flex: 0 0 26px; }
.subtable.fixed td input:not([type=checkbox]) { min-width: 0; width: 100%; }
/* ردیف تاریخ دریافت / منبع / سازمان: فاصلهٔ برابر، سازمان کمی بلندتر */
.grid.recv-row { grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1.25fr); }
.grid.recv-row:has([data-grp-hide][hidden]) { grid-template-columns: 190px minmax(0, 1fr); }
@media (max-width: 1000px) { .grid.recv-row, .grid.recv-row:has([data-grp-hide][hidden]) { grid-template-columns: 1fr; } }

/* ردیف تاریخ‌ها و ردیف منبع/سازمان */
.grid.dates-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.dates-row input.jdate { max-width: 100%; }
.grid.src-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
@media (max-width: 1000px) { .grid.dates-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.src-row { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid.dates-row { grid-template-columns: 1fr; } }
input.jdate-ro { background: #f1f3f7; color: var(--ink); cursor: default; max-width: 190px; text-align: center; }
/* پاپ‌آپ «این شرکت»: فیلدها در چند ستون */
.org-box .org-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 8px; }
.org-box .org-fields .field.full { grid-column: 1 / -1; }
@media (max-width: 700px) { .org-box .org-fields { grid-template-columns: 1fr; } }
/* دفترچه تلفن: هر هفت ستون در یک نگاه جا شود */
#contacts td, .org-box .subtable td { min-width: 0; padding: 6px 4px; }
#contacts th, .org-box .subtable th { font-size: .8rem; padding: 8px 4px; }
#contacts input { min-width: 0; }
.org-box .subtable input { min-width: 0 !important; }

/* منوی کناری: به رنگ لوگوی ایران انشعاب */
:root { --logo-blue: #2a559f; --logo-blue-dark: #214685; }
.sidebar { background: var(--logo-blue); border-color: var(--logo-blue-dark); color: #e8eefb; }
.sidebar nav a { color: #e8eefb; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, .22); color: #fff; font-weight: 700; box-shadow: none; }
.sidebar nav a svg { stroke: currentColor; }
.sidebar .foot { color: #cfdaf0; border-top-color: rgba(255, 255, 255, .22); }
.sidebar .foot a { color: #fff; }
.sidebar .foot b, .sidebar .foot strong { color: #fff; }
.sidebar .upd-dot { background: #ef4444; color: #fff; }
.perm-h { margin: 10px 0 4px; font-size: .85rem; color: var(--muted); }
.perm-locked, .perm-locked + .ss-btn { opacity: .7; }

/* ===== طرح شیشه‌ای (تاییدشده): پس‌زمینهٔ گرادیان آبی و کارت‌های نیمه‌شفاف ===== */
html, body { background: #dfe8f7; }
body { background:
  radial-gradient(700px 420px at 90% -5%, rgba(80,140,230,.55), transparent 65%),
  radial-gradient(640px 460px at 5% 8%, rgba(120,190,240,.50), transparent 62%),
  radial-gradient(760px 520px at 55% 105%, rgba(70,110,200,.45), transparent 60%),
  radial-gradient(520px 360px at 100% 80%, rgba(150,170,255,.40), transparent 60%),
  linear-gradient(160deg, #eaf1fc 0%, #d6e3f8 100%); background-attachment: fixed; }
.topbar, .card, .panel, .actionbar, .dcard, .kpi, .dash-filters {
  background: rgba(255,255,255,.50); border: 1px solid rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 8px 30px rgba(42,85,159,.12), inset 0 1px 0 rgba(255,255,255,.7); }
.sidebar { background: linear-gradient(180deg, rgba(42,85,159,.88), rgba(33,70,133,.82));
  border: 1px solid rgba(255,255,255,.35); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 34px rgba(33,70,133,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.panel:has(#products) { background: rgba(225,230,240,.50); }
input, select, textarea, .ss-btn { background-color: rgba(255,255,255,.62); border-color: rgba(255,255,255,.9); box-shadow: inset 0 1px 2px rgba(42,85,159,.08); }
input:disabled, select:disabled, .ss-btn:disabled { background-color: rgba(235,240,248,.55); }
.btn { background: rgba(255,255,255,.6); border-color: rgba(255,255,255,.9); }
.btn.primary { background: linear-gradient(135deg, #3b74d0, #2a559f); border-color: transparent; box-shadow: 0 8px 20px rgba(42,85,159,.35); }
.subtable th { background: rgba(42,85,159,.08); }
body.plain { background: radial-gradient(700px 420px at 90% -5%, rgba(80,140,230,.55), transparent 65%), radial-gradient(640px 460px at 5% 90%, rgba(120,190,240,.50), transparent 62%), linear-gradient(160deg, #eaf1fc 0%, #d6e3f8 100%); background-attachment: fixed; }
.content { background: transparent; }
.table-wrap.card { background: rgba(255,255,255,.55); }
.case-table th, .data-table th { background: rgba(42,85,159,.08); }
.case-table tbody tr:hover { background: rgba(255,255,255,.5); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .card, .panel, .actionbar, .dcard, .kpi, .dash-filters { background: rgba(255,255,255,.94); }
  .sidebar { background: #2a559f; }
}

/* ===== پیام‌ها و پاپ‌آپ‌ها به سبک شیشه‌ای (تاییدشده) ===== */
.sv-toast{background:rgba(30,60,120,.16);-webkit-backdrop-filter:blur(10px) saturate(150%);backdrop-filter:blur(10px) saturate(150%)}
.sv-toast .sv-card{background:rgba(255,255,255,.58);border:1px solid rgba(255,255,255,.75);-webkit-backdrop-filter:blur(22px) saturate(180%);backdrop-filter:blur(22px) saturate(180%);box-shadow:0 24px 60px rgba(30,60,130,.28),inset 0 1px 0 rgba(255,255,255,.8)}
.sv-toast .sv-ico{background:linear-gradient(145deg,#4fbf73,#2f9d57);box-shadow:0 6px 16px rgba(47,157,87,.35)}
.sv-toast.sv-bad .sv-ico{background:linear-gradient(145deg,#ee6b66,#d23f3a);box-shadow:0 6px 16px rgba(210,63,58,.35)}
.sv-toast.sv-bad .sv-card{border-color:rgba(255,255,255,.75)}
.flash{background:rgba(255,255,255,.55);border:1px solid rgba(255,255,255,.75);-webkit-backdrop-filter:blur(14px) saturate(170%);backdrop-filter:blur(14px) saturate(170%);box-shadow:0 4px 14px rgba(30,60,130,.10)}
.flash.success{color:#1d5a2a;border-right:4px solid #4aa152}
.flash.error{color:#8f2623;border-right:4px solid #d9534f}
.flash.info{color:#1e4f99;border-right:4px solid #2a559f}
.flash.warn{color:#8a5a00;border-right:4px solid #e0a100}
.org-box,.pf-box,.ss-box,.wl-box{background:rgba(255,255,255,.62);border:1px solid rgba(255,255,255,.75);-webkit-backdrop-filter:blur(22px) saturate(180%);backdrop-filter:blur(22px) saturate(180%);box-shadow:0 24px 60px rgba(30,60,130,.28)}

/* انتخاب فایل (پیوست تیکت) */
input[type=file] { height: auto; padding: 8px 10px; background: rgba(255,255,255,.6); border: 1px dashed rgba(42,85,159,.45); border-radius: 10px; font-family: inherit; font-size: .9rem; width: 100%; box-sizing: border-box; }
input[type=file]::file-selector-button { margin-inline-end: 12px; padding: 6px 14px; border: 0; border-radius: 8px; background: #2a559f; color: #fff; font-family: inherit; cursor: pointer; }
.file-status { margin: 6px 0 10px; font-size: .9rem; }
.file-status.ok { color: #1d5a2a; font-weight: 700; }
.file-status.bad { color: #8f2623; font-weight: 700; }

/* چک‌باکس زیر «نوع پرونده» (فراخوان ارزیابی کیفی / برآورد قیمت) */
.type-flag { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; cursor: pointer; }
.type-flag[hidden] { display: none; }
.type-flag input { width: 18px; height: 18px; }

/* چک‌باکس گرد (بخش ارسال) */
.rc { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.rc input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; padding: 0; margin: 0; flex: none; border-radius: 50%; border: 2px solid #2a559f; background: rgba(255,255,255,.85); display: inline-grid; place-content: center; cursor: pointer; }
.rc input[type=checkbox]::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #2a559f; transform: scale(0); transition: transform .12s; }
.rc input[type=checkbox]:checked::after { transform: scale(1); }
.rc input[type=checkbox]:disabled { border-color: #b8c3d8; background: #eef1f6; cursor: not-allowed; }
.rc.off { color: #9aa4b5; }
.sent-box { grid-column: 1 / -1; }
.sent-box[hidden] { display: none; }
.sent-row { display: flex; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.sent-row .field { width: 200px; margin: 0; }
.sent-row .rc { padding-bottom: 9px; }
.row-actions { white-space: nowrap; }

/* لیست پرونده‌ها: ستون‌ها فشرده‌تر تا دو دکمهٔ «ویرایش/نمایش» جا شوند؛ در صورت کمبود جا اسکرول افقی */
.table-wrap.card { overflow-x: auto; }
.case-table th, .case-table td { padding-inline: 8px; }
.case-table th { font-size: .82rem; }
.row-actions .btn.small { padding: 5px 10px; }
.sent-box { grid-column: span 3; }
.sent-row { gap: 20px; }
.sent-row .field { width: 170px; }
.card table.case-table th, .card table.case-table td { padding: 10px 7px; }
.card table.case-table th { white-space: normal; line-height: 1.5; }
.card table.case-table td { white-space: nowrap; }
.case-table .note-cell { max-width: 150px; }
.row-actions .btn.small { padding: 4px 8px; font-size: .85rem; }

/* v2.56: چیدمان تمیز پنل سوم؛ نتیجه کنار وضعیت می‌ماند و کادر ارسال در ردیف جدا و جمع‌وجور است */
.grid.cols5 #box-status { order: 1; }
.grid.cols5 #box-result { order: 2; }
.grid.cols5 #box-resultdate { order: 3; }
.grid.cols5 #box-sent { order: 4; grid-column: 1 / -1; }
.sent-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.sent-row .field { width: 170px; margin: 0; }
.sent-row .rc { padding-bottom: 9px; margin: 0 6px; }
.type-flag input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; padding: 0; margin: 0; flex: none; border-radius: 50%; border: 2px solid #2a559f; background: rgba(255,255,255,.85); display: inline-grid; place-content: center; cursor: pointer; }
.type-flag input[type=checkbox]::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #2a559f; transform: scale(0); transition: transform .12s; }
.type-flag input[type=checkbox]:checked::after { transform: scale(1); }
.type-flag input[type=checkbox]:disabled { border-color: #b8c3d8; background: #eef1f6; cursor: not-allowed; }

.grid.dates-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.dates-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.dates-row { grid-template-columns: 1fr; } }
/* ردیف وضعیت: وضعیت | نتیجه | تاریخ اعلام | کادر ارسال (دو ستون) در یک ردیف */
.grid.cols5 #box-sent { order: 4; grid-column: span 2; }
.sent-box .sent-row { flex-direction: column; align-items: stretch; gap: 8px; }
.sent-box .sent-row .field { width: 100%; }
.sent-box .sent-row .rcs { display: flex; gap: 14px; flex-wrap: wrap; }
.sent-row .rc { padding-bottom: 0; margin: 0; }
@media (max-width: 1250px) { .grid.cols5 #box-sent { grid-column: 1 / -1; } }
.grid.dates-row .jdate-ro, .grid.dates-row input.jtime { width: 100%; max-width: 100%; }
/* ترتیب نهایی: وضعیت | تاریخ ارسال + سه گزینه | نتیجه | تاریخ اعلام نتایج */
.grid.cols5 #box-status { order: 1; }
.grid.cols5 #box-sent { order: 2; grid-column: span 2; }
.grid.cols5 #box-result { order: 3; }
.grid.cols5 #box-resultdate { order: 4; }
@media (max-width: 1250px) { .grid.cols5 #box-sent { grid-column: span 2; } }

/* ---- صفحهٔ راهنما (v2.56) ---- */
.help-search { display: flex; gap: 8px; align-items: center; margin: 12px 0 16px; }
.help-search input { flex: 1; max-width: 560px; height: 44px; padding: 0 14px; border-radius: 12px; }
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.7); max-height: calc(100vh - 40px); overflow: auto; }
.help-toc a { padding: 7px 10px; border-radius: 10px; color: #1d3a6e; text-decoration: none; font-size: 14px; }
.help-toc a:hover { background: rgba(42,85,159,.12); }
.help-adm { font-size: 11px; color: #fff; background: #5b6f95; border-radius: 8px; padding: 1px 7px; margin-inline-start: 4px; }
.help-sec { padding: 16px 18px; margin-bottom: 14px; }
.help-sec h2 { margin: 0 0 10px; font-size: 18px; }
.help-item { border-top: 1px solid rgba(42,85,159,.12); padding: 4px 0; }
.help-item:first-of-type { border-top: 0; }
.help-item summary { cursor: pointer; padding: 9px 4px; font-weight: 600; list-style-position: inside; }
.help-item[open] > summary { color: #2a559f; }
.help-a { padding: 2px 8px 12px; line-height: 2; }
.help-a ul, .help-a ol { margin: 6px 0; padding-inline-start: 22px; }
.help-a code { direction: ltr; unicode-bidi: embed; background: rgba(42,85,159,.08); padding: 1px 6px; border-radius: 6px; }
.help-none { padding: 18px; text-align: center; margin-bottom: 14px; }
[hidden].help-sec, .help-item[hidden], .help-toc a[hidden] { display: none !important; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; } }
.help-item, .help-sec { scroll-margin-top: 90px; }
