/* هما — استایل پایه (آفلاین، بدون CDN) */
@font-face { font-family: "Yekan"; src: url("/assets/fonts/Yekan.woff") format("woff"); font-display: swap; }
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #14532d; --brand-2: #1b8a3a; --bg: #f4f6f4; --card: #fff;
  --line: #dde3dd; --text: #1c2420; --muted: #64716a;
  --shadow: 0 1px 2px rgba(20,40,30,.06), 0 4px 16px rgba(20,40,30,.06);
}
body {
  font-family: "Yekan", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column; font-size: 15px;
}
.topbar {
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 10px 20px;
}
.topbar .brand { font-size: 20px; font-weight: 700; }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar a { color: #d9efe0; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .who { opacity: .85; font-size: 13px; }
.topbar .logout { background: #ffffff22; padding: 4px 10px; border-radius: 6px; }
main { flex: 1; width: min(1180px, calc(100% - 32px)); margin: 22px auto; }
footer { text-align: center; color: var(--muted); padding: 14px; font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
h1 { font-size: 20px; margin-bottom: 14px; }
h2 { font-size: 16px; margin: 14px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #e5f5ea; color: #14532d; border: 1px solid #b7e0c3; }
.flash.err { background: #fdeaea; color: #8f1d1d; border: 1px solid #f2c4c4; }

.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.step {
  padding: 8px 16px; background: #e8ede8; border-radius: 20px; text-decoration: none;
  color: var(--muted); font-size: 13px;
}
.step.on { background: var(--brand); color: #fff; }

label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; background: var(--brand-2); color: #fff; border: 0; cursor: pointer;
  padding: 10px 22px; border-radius: 8px; font-family: inherit; font-size: 14px; margin-top: 14px;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.gray { background: #6b7570; }
.btn.small { padding: 4px 10px; font-size: 12px; margin: 0; }
.btn.danger { background: #c62828; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
table.list th { background: #eef2ee; font-weight: 600; }
table.list tr:hover td { background: #f7faf7; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; color: #fff; font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { padding: 8px 14px; border-radius: 8px 8px 0 0; background: #e8ede8; text-decoration: none; color: var(--muted); font-size: 13px; }
.tab.on { background: var(--brand-2); color: #fff; }

.checkline { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.checkline input { width: auto; }

@media print {
  .topbar, .steps, .btn, footer, .noprint { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

/* ---- عمومی ---- */
.topbar { position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,.12); flex-wrap: wrap; gap: 8px; }
.topbar nav { flex-wrap: wrap; }
.head-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head-row h1 { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.step { transition: background .15s; }
.step:hover { background: #d7e3d9; color: var(--text); }
details > summary { list-style: none; border-radius: 8px; padding: 8px 10px !important; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "◂"; display: inline-block; margin-left: 8px; color: var(--brand-2); transition: transform .15s; }
details[open] > summary::before { transform: rotate(-90deg); }
details > summary:hover { background: #f1f6f2; }
.tree-g1 { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: #fbfdfb; }
.tree-g1 > summary { font-size: 15px; }
.tree-g2 { border-right: 3px solid #cfe3d4; margin: 4px 14px 4px 6px; }
.tree-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; padding: 4px 14px 10px; }
.tree-items .checkline { border-radius: 8px; padding: 6px 8px; }
.tree-items .checkline:hover { background: #eef6f0; }
.tree-items input:checked + label { color: var(--brand); font-weight: 700; }
.quota { color: #9a5b00; font-size: 12px; }
.sticky-add { position: sticky; bottom: 0; background: linear-gradient(to top, #fff 70%, transparent); padding: 12px 0 4px; }

/* ---- استان‌ها ---- */
.prov-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .prov-wrap { grid-template-columns: 1fr; } }
.map-box { position: relative; background: #f3f8f4; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.iranmap { width: 100%; height: auto; display: block; }
.iranmap path[data-k] { fill: #dfe9e1; stroke: #fff; stroke-width: 1.6; cursor: pointer; transition: fill .15s; }
.iranmap path[data-k]:hover { fill: #b9d7c0; }
.iranmap path[data-k].on { fill: #1b8a3a; }
.iranmap path[data-k].on:hover { fill: #14632b; }
.iranmap .sea path, .iranmap .lake path { fill: #cfe3f2; stroke: none; pointer-events: none; }
.iranmap .ranks { pointer-events: none; }
.iranmap .ranks circle { fill: #fff; stroke: #14532d; stroke-width: 2.5; }
.iranmap .ranks text { fill: #14532d; font: 700 20px "Yekan", Tahoma, sans-serif; text-anchor: middle; dominant-baseline: central; }
.map-tip { position: absolute; display: none; background: #1c2420; color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.prov-side h2 { display: flex; align-items: center; gap: 8px; }
.count { background: var(--brand-2); color: #fff; border-radius: 12px; padding: 0 10px; font-size: 13px; }
.order { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; padding-left: 4px; }
.order li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: grab; }
.order li.drag { opacity: .4; }
.order li.over { border-color: var(--brand-2); background: #f1f8f3; }
.order .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.order .nm { flex: 1; }
.order .acts button { border: 0; background: #eef2ee; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: var(--muted); }
.order .acts button:hover { background: #d9e6dc; color: var(--text); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--brand-2); }
.chip.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }

/* ---- کارنامه ---- */
.mojaz { gap: 14px 20px; margin-bottom: 8px; }
.mojaz-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fbfdfb; }
.mojaz-col h3 { font-size: 14px; margin-bottom: 6px; color: var(--brand); }
.mojaz-col.off { opacity: .45; }

.iranmap path.z-home { fill: #f6d9a8; }
.iranmap path.z-nah { fill: #fbe9c9; }
.iranmap path.z-qot { fill: #dcebf8; }
.iranmap path[data-k].on { fill: #1b8a3a; }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; padding: 8px 6px 2px; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-left: 6px; vertical-align: -2px; border: 1px solid #0001; }
.sw.home { background: #f6d9a8; } .sw.nah { background: #fbe9c9; } .sw.qot { background: #dcebf8; }

/* ---- چیدمان‌ها ---- */
button.tab { border: 0; font: inherit; font-size: 13px; cursor: pointer; }
.algo-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.algo-bar .mix { display: flex; align-items: center; gap: 4px; }
.algo-bar form { margin-right: auto; }
.algo-bar .btn { margin: 0; }
.tozih { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.7; }
table.list td { vertical-align: top; }

table.res td:nth-child(5), table.res td:nth-child(6), table.res td:nth-child(7), table.res td:nth-child(8), table.list .badge { white-space: nowrap; }

tr.love-head td { background: #f1f6f2; color: var(--brand); font-weight: 700; font-size: 13px; }

/* ---- بهینه‌سازی حذفی ---- */
.behine { border: 1px solid #f0d9c8; background: #fffaf6; border-radius: 12px; margin-top: 12px; }
.behine > summary { font-weight: 700; }
.behine form { padding: 4px 14px 14px; }
.bh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; }
.bh-grid h3 { font-size: 13px; color: var(--brand); margin: 8px 0 4px; }
.bh-grid .checkline { margin: 0; font-size: 13px; color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- جابه‌جایی دسته‌ای ---- */
.bulkbar { display: none; position: sticky; top: 58px; z-index: 5; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #14532d; color: #fff; padding: 10px 14px; border-radius: 12px; margin-top: 12px; box-shadow: var(--shadow); }
.bulkbar.show { display: flex; }
.bulkbar .muted { color: #cfe3d4; }
.bulkbar .btn { margin: 0; background: #fff; color: #14532d; }
.bulkbar .btn.gray { background: #ffffff33; color: #fff; }
.bulkbar input { padding: 4px 6px; }
#ft td.sel { white-space: nowrap; width: 56px; }
#ft .grip { cursor: grab; color: #9aa89f; margin-left: 6px; user-select: none; }
#ft tr.picked td { background: #eaf5ed; }
#ft tr.dragging { opacity: .4; }
#ft tr.drop-before td { box-shadow: inset 0 3px 0 #1b8a3a; }
.behine .or { color: var(--muted); }

/* ---- دسته‌های لیست نهایی ---- */
.bulkbar .gsep { opacity: .4; }
.bulkbar select, .bulkbar input[name=grp_name] { padding: 4px 6px; border-radius: 8px; }
.groups { margin-top: 12px; border: 1px solid #dfe7e2; border-radius: 12px; padding: 8px 14px; background: #fbfdfc; }
.groups h3 { font-size: 14px; margin: 4px 0 8px; }
.grow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px 8px 0; border-top: 1px dashed #e3e9e5; border-right: 4px solid var(--gc); }
.grow form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.grow .gname input { width: 150px; padding: 4px 6px; font-weight: 700; color: var(--gc); }
.grow .gmove select, .grow .gmove input { padding: 4px 6px; }
.gdot { width: 12px; height: 12px; border-radius: 50%; background: var(--gc); display: inline-block; }
.grow .warn { color: #c2410c; }
#ft tr.ing td:first-child { box-shadow: inset -4px 0 0 var(--gc); }
.gtag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--gc); color: #fff; margin-right: 6px; vertical-align: middle; }

/* ---- پنل کار گروهی (سمت چپ) ---- */
.sidepanel { display: none; position: fixed; left: 16px; top: 90px; width: 230px; max-height: calc(100vh - 110px); overflow-y: auto; z-index: 20;
  background: #fff; border: 1px solid #cfe0d4; border-top: 4px solid #14532d; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px #0002; font-size: 13px; }
.sidepanel.show { display: block; }
.sidepanel .sp-head { display: flex; justify-content: space-between; align-items: center; color: #14532d; }
.sidepanel .sp-x { border: 0; background: #eef3ef; border-radius: 8px; width: 26px; height: 26px; cursor: pointer; }
.sidepanel h4 { margin: 12px 0 6px; font-size: 12px; color: var(--muted); border-bottom: 1px dashed #e3e9e5; padding-bottom: 3px; }
.sidepanel p.muted { margin: 4px 0; font-size: 11px; }
.sidepanel .sp-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.sidepanel .sp-row input { width: 58px; padding: 4px 6px; }
.sidepanel select, .sidepanel input[name=grp_name] { width: 100%; padding: 5px 6px; margin-bottom: 6px; box-sizing: border-box; }
.sidepanel .btn { margin: 0; }
.sidepanel > .btn { width: 100%; }
@media (max-width: 700px) { .sidepanel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 60vh; } }
@media (min-width: 701px) { body.sp-on main { padding-left: 262px; transition: padding .15s; } }
/* جدول لیست نهایی: کلمه‌ها نشکنند؛ وقتی پنل چپ باز است فونت کوچک‌تر شود */
#ft td, #ft th { word-break: normal; overflow-wrap: normal; }
#ft td:nth-child(2), #ft td:nth-child(3), #ft td:nth-child(4), #ft td:nth-child(8), #ft td:nth-child(9), #ft td:nth-child(10), #ft td:nth-child(11),
#ft th { white-space: nowrap; }
body.sp-on #ft { font-size: 12px; }
body.sp-on #ft td { padding: 6px 6px; }
body.sp-on #ft .tozih { font-size: 11px; }
body.sp-on #ft .badge { font-size: 11px; padding: 3px 8px; }
body.sp-on #ft .btn.small { padding: 4px 8px; min-width: 0; }
#ft td.old { color: #8a978f; font-size: .92em; }
#ft td.old .mv { font-size: 10px; color: #b45309; }

/* ---- نوار چیپ دسته‌ها ---- */
.gbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.gbar-t { font-weight: 700; font-size: 13px; color: var(--muted); margin-left: 4px; }
.gbar-h { font-size: 11px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--gc) 10%, #fff); border: 1px solid color-mix(in srgb, var(--gc) 35%, #fff); font-size: 12px; transition: box-shadow .15s; }
.gchip:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 20%, transparent); }
.gchip form { margin: 0; display: inline; }
.gchip .gren input { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--gc); padding: 0; width: auto; cursor: text; }
.gchip .gren input:focus { outline: 1px dashed var(--gc); background: #fff; }
.gchip small { color: #6b7a71; white-space: nowrap; }
.gchip .warn { color: #c2410c; font-size: 11px; }
.gchip .gdel button { border: 0; background: transparent; color: #9aa89f; cursor: pointer; font-size: 12px; width: 20px; height: 20px; border-radius: 50%; }
.gchip .gdel button:hover { background: #fee2e2; color: #b91c1c; }
.sidepanel .sp-sel { flex: 1; min-width: 0; padding: 4px 6px; }

/* ---- پنل کار گروهی، نسخهٔ ۲ ---- */
.bpanel { display: none; position: fixed; left: 16px; top: 90px; width: 236px; z-index: 20; max-height: calc(100vh - 110px); overflow-y: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 12px 32px #0f2a1a26, 0 0 0 1px #e2ebe5; font-size: 13px; }
.bpanel.show { display: block; }
.bp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #14532d; color: #fff; border-radius: 16px 16px 0 0; }
.bp-n { font-size: 22px; font-weight: 800; margin-left: 6px; }
.bp-l { font-size: 12px; opacity: .85; }
.bp-x { border: 0; background: #ffffff22; color: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.bp-x:hover { background: #ffffff40; }
.bp-body { padding: 4px 14px 12px; }
.bp-sec { padding: 10px 0; border-bottom: 1px solid #eef2ef; }
.bp-sec > label { display: block; font-size: 11px; font-weight: 700; color: #7b8a81; margin-bottom: 8px; }
.bpanel button, .bpanel input, .bpanel select { font: inherit; height: 34px; box-sizing: border-box; margin: 0; }
.bp-seg { display: flex; border: 1px solid #cfe0d4; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.bp-seg button { flex: 1; border: 0; background: #f4f8f5; color: #14532d; cursor: pointer; font-weight: 600; font-size: 12px; }
.bp-seg button + button { border-right: 1px solid #cfe0d4; }
.bp-seg button:hover, .bp-grp button:hover { background: #14532d; color: #fff; }
.bp-grp { display: flex; align-items: stretch; border: 1px solid #cfe0d4; border-radius: 10px; overflow: hidden; margin-bottom: 8px; background: #fff; }
.bp-grp:last-child { margin-bottom: 0; }
.bp-pre { display: flex; align-items: center; padding: 0 10px; background: #f4f8f5; color: #5b6b61; font-size: 12px; white-space: nowrap; border-left: 1px solid #cfe0d4; }
.bp-grp input, .bp-grp select { flex: 1; min-width: 0; border: 0; padding: 0 8px; background: transparent; border-radius: 0; outline: none; }
.bp-grp button { border: 0; border-right: 1px solid #cfe0d4; background: #f4f8f5; color: #14532d; padding: 0 12px; cursor: pointer; font-weight: 700; }
.bp-grp:focus-within { border-color: #1b8a3a; box-shadow: 0 0 0 3px #1b8a3a22; }
.bp-del { width: 100%; margin-top: 12px !important; border: 1px solid #f3c4c4; background: #fff5f5; color: #b91c1c; border-radius: 10px; cursor: pointer; font-weight: 700; }
.bp-del:hover { background: #b91c1c; color: #fff; }
.bp-hint { margin: 8px 0 0; font-size: 10.5px; color: #98a59d; text-align: center; }
@media (max-width: 700px) { .bpanel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 60vh; } }

/* ---- رنگ دوره و ستارهٔ علاقه در لیست نهایی ---- */
#ft tr[data-id] td { background: var(--dc, #fff); }
#ft tr.picked td { background: #dcefe2; }
#ft .dpill { display: inline-block; padding: 1px 8px; border-radius: 8px; background: color-mix(in srgb, var(--dc) 40%, #0000000d); font-size: .92em; }
#ft .love { display: inline-block; margin-left: 6px; font-size: 13px; letter-spacing: -1px; color: #f59e0b; white-space: nowrap; }
#ft .love i { font-style: normal; color: #d8dcd9; }
#ft .love-key { font-weight: 400; font-size: 10.5px; color: #98a59d; margin-right: 6px; }
/* ---- لیست نهایی جمع‌وجور ---- */
#ft { font-size: 13px; }
#ft th { padding: 6px 6px; font-size: 12px; }
#ft td { padding: 4px 6px; line-height: 1.5; vertical-align: middle; }
#ft .tozih { font-size: 11px; line-height: 1.4; margin-top: 1px; color: #7b8a81;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; cursor: help; }
#ft tr:hover .tozih { -webkit-line-clamp: unset; }
#ft .badge { font-size: 11px; padding: 2px 8px; }
#ft .dpill { padding: 0 6px; font-size: 11.5px; }
#ft .btn.small { padding: 2px 7px; font-size: 11px; min-width: 0; line-height: 1.6; border-radius: 6px; }
#ft td:last-child form { display: inline-flex; gap: 3px; }
#ft .gtag { font-size: 10px; padding: 0 6px; }
#ft .love { font-size: 11px; }
body.sp-on #ft { font-size: 12px; }
/* هر سطر یک‌خطی؛ متن کامل در tooltip. ارتفاع با موس عوض نمی‌شود */
#ft tr:hover .tozih { -webkit-line-clamp: 1; }
#ft td { white-space: nowrap; }
#ft td.uni, #ft td:nth-child(5) { max-width: 1px; width: 38%; overflow: hidden; text-overflow: ellipsis; }
#ft td:nth-child(5) { width: 22%; }
#ft td.uni .tozih { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
#ft td { padding: 3px 6px; }
/* دکمه‌های هر سطر: بی‌رنگ و کم‌رنگ، روی سطر پررنگ می‌شوند؛ ارتفاع همهٔ سطرها یکی */
#ft td:last-child .btn.small { background: transparent; color: #9aa89f; box-shadow: none; border: 0; padding: 0 5px; font-size: 12px; opacity: .35; transition: opacity .1s; }
#ft tr:hover td:last-child .btn.small { opacity: 1; }
#ft td:last-child .btn.small:hover { background: #e7efe9; color: #14532d; }
#ft td:last-child .btn.small.danger:hover { background: #fee2e2; color: #b91c1c; }
#ft td.uni .tozih { display: inline; margin: 0 8px 0 0; font-size: 11px; }
#ft td.uni .tozih::before { content: "— "; }
#ft td { height: 30px; }
/* چیپ دسته‌ها: فونت خوانا */
.gchip { font-family: inherit; font-size: 13px; padding: 5px 8px 5px 12px; }
.gchip .gren input { font-family: inherit; font-size: 13px; }
.gchip small { font-size: 12px; color: #5b6b61; }
.gchip .gsep2 { margin: 0 6px; opacity: .35; }
.gchip .warn { font-size: 12px; }
.gbar-t { font-size: 14px; }
.gbar-h { font-size: 12px; }

/* ---- بهینه‌سازی حذفی، نسخهٔ ۲ ---- */
.behine { background: #fffaf6; border: 1px solid #f1e0d3; border-radius: 12px; margin-top: 12px; font-size: 13px; }
.behine > summary { padding: 10px 14px; cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.behine > summary::-webkit-details-marker { display: none; }
.behine > summary::after { content: "▾"; margin-right: auto; color: #b08a6e; }
.behine[open] > summary::after { content: "▴"; }
.behine .bh-t { font-weight: 700; color: #7c2d12; }
.behine > summary .muted { font-size: 12px; }
.behine form { padding: 0 14px 12px; }
.bh-rows { border-top: 1px dashed #f1e0d3; }
.bh-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #f1e0d3; }
.bh-k { width: 44px; flex: none; font-weight: 700; font-size: 12px; color: #7b6a5d; }
.bh-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { position: relative; margin: 0; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 3px 11px; border-radius: 999px; background: #fff; border: 1px solid #e7d6c8; color: #5b4a3e; font-size: 12px; transition: all .12s; user-select: none; }
.pill span b { font-weight: 400; color: #a8927f; margin-right: 3px; }
.pill:hover span { border-color: #d9b99e; }
.pill input:checked + span { background: #7c2d12; border-color: #7c2d12; color: #fff; }
.pill input:checked + span b { color: #fcd9c2; }
.pill input:focus-visible + span { box-shadow: 0 0 0 3px #7c2d1233; }
.bh-note { font-size: 11px; color: #a8927f; }
.bh-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.bh-act button, .bh-act select { font: inherit; font-size: 12.5px; height: 32px; margin: 0; border-radius: 8px; cursor: pointer; }
.bh-del { background: #b91c1c; color: #fff; border: 0; padding: 0 16px; font-weight: 700; }
.bh-mv { display: inline-flex; border: 1px solid #d6c3b3; border-radius: 8px; overflow: hidden; }
.bh-mv button { border: 0; border-radius: 0 !important; background: #fff; color: #5b4a3e; padding: 0 12px; }
.bh-mv select { border: 0; border-right: 1px solid #d6c3b3; border-radius: 0 !important; padding: 0 8px; background: #fbf5f0; width: auto; }
.bh-rest { margin-right: auto !important; background: transparent; border: 1px solid #cfd8d2; color: #4b5b51; padding: 0 12px; }
.bh-rest:hover { background: #eef3ef; }
.bh-act button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- بهینه‌سازی حذفی: یک کارت برای هر دوره ---- */
.bh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding-top: 10px; border-top: 1px dashed #f1e0d3; }
.bh-card { background: #fff; border: 1px solid #eadbcf; border-radius: 12px; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.bh-card.on { border-color: #7c2d12; box-shadow: 0 0 0 2px #7c2d1222; }
.bh-on { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; cursor: pointer; background: #fbf5f0; border-bottom: 1px solid #f1e0d3; }
.bh-card.on .bh-on { background: #7c2d12; color: #fff; }
.bh-on input { accent-color: #7c2d12; margin: 0; }
.bh-name { font-weight: 700; font-size: 13px; }
.bh-cnt { margin-right: auto; font-size: 11px; color: #a8927f; white-space: nowrap; }
.bh-card.on .bh-cnt { color: #fcd9c2; }
.bh-cnt b { font-size: 13px; }
.bh-card.on .bh-cnt b { color: #fff; }
.bh-opts { padding: 6px 10px 10px; opacity: .45; pointer-events: none; transition: opacity .12s; }
.bh-card.on .bh-opts { opacity: 1; pointer-events: auto; }
.bh-sub { font-size: 11px; color: #7b6a5d; font-weight: 700; margin: 6px 0 4px; }
.bh-sub i { font-style: normal; font-weight: 400; color: #b8a291; margin-right: 4px; }
.bh-card .bh-pills { gap: 4px; }
.bh-card .pill span { padding: 2px 9px; font-size: 11.5px; }

/* کارت دوره: هر گزینه در یک خط */
.bh-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bh-line { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.bh-line .bh-sub { width: 36px; flex: none; margin: 0; cursor: help; }
.bh-line .bh-pills { flex-wrap: nowrap; gap: 3px; }
.bh-card .pill span { padding: 2px 8px; font-size: 11px; white-space: nowrap; }
.pill.eh span { border-color: color-mix(in srgb, var(--ec) 45%, #fff); color: var(--ec); }
.pill.eh input:checked + span { background: var(--ec); border-color: var(--ec); color: #fff; }
.bh-cards { grid-template-columns: repeat(auto-fill, minmax(345px, 1fr)); }

/* بهینه‌سازی: حالت حذف / برگرداندن */
.bh-mode { display: inline-flex; border: 1px solid #e7d6c8; border-radius: 10px; overflow: hidden; margin: 2px 0 10px; }
.bh-mode label { margin: 0; cursor: pointer; }
.bh-mode input { position: absolute; opacity: 0; pointer-events: none; }
.bh-mode span { display: inline-block; padding: 6px 14px; font-size: 12.5px; background: #fff; color: #5b4a3e; }
.bh-mode label + label span { border-right: 1px solid #e7d6c8; }
.bh-mode input:checked + span { background: #7c2d12; color: #fff; font-weight: 700; }
.bh-mode input:disabled + span { opacity: .4; cursor: not-allowed; }
.bh-mode b { font-weight: 400; opacity: .75; }
#bf.restore .bh-mode input:checked + span { background: #14532d; }
#bf.restore .bh-card.on { border-color: #14532d; box-shadow: 0 0 0 2px #14532d22; }
#bf.restore .bh-card.on .bh-on { background: #14532d; }
#bf.restore .pill input:checked + span { background: #14532d; border-color: #14532d; }
#bf .bh-card.empty { opacity: .45; }
.bh-back { background: #14532d; color: #fff; border: 0; padding: 0 16px; font-weight: 700; }
.bh-cnt i { font-style: normal; }
#bf [hidden] { display: none !important; }
/* جدول لیست نهایی: عرض ستون‌ها ثابت؛ هیچ‌وقت از صفحه بیرون نمی‌زند و ستون دانشگاه له نمی‌شود */
#ft { table-layout: fixed; width: 100%; }
#ft td, #ft th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ft td.uni, #ft td:nth-child(5) { max-width: none; width: auto; }
#ft th .love-key { display: none; }
@media print { #ft { table-layout: auto; } }
body.sp-on #ft td { padding: 3px 6px; }
/* ---- بهینه‌سازی: هر دوره یک سطر جمع‌وجور ---- */
.bh-cards { display: flex; flex-direction: column; gap: 4px; grid-template-columns: none; }
.bh-card { display: flex; align-items: center; border-radius: 9px; }
.bh-on { width: 150px; flex: none; align-self: stretch; padding: 4px 10px; border-bottom: 0; border-left: 1px solid #f1e0d3; }
.bh-name { font-size: 12.5px; }
.bh-cnt { font-size: 10.5px; }
.bh-cnt b { font-size: 12px; }
.bh-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; padding: 3px 10px; }
.bh-line { margin: 0; gap: 5px; }
.bh-line .bh-sub { width: auto; font-size: 10.5px; color: #a8927f; font-weight: 400; }
.bh-card .pill span { padding: 1px 7px; font-size: 10.5px; line-height: 1.6; }
.bh-mode span { padding: 4px 12px; font-size: 12px; }
.bh-on { width: 175px; } .bh-name { white-space: nowrap; }

.bh-mv .bh-back { border-radius: 0 !important; }
.bh-mv input { border: 0; border-right: 1px solid #d6c3b3; width: 64px; padding: 0 8px; font: inherit; font-size: 12.5px; height: 32px; outline: none; }
.bh-stat { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; background: #fff; border: 1px solid #e7d6c8; font-size: 12.5px; color: #5b4a3e; }
.bh-stat b { font-size: 14px; }
.bh-stat .arr { color: #c4ae9c; }
.bh-stat .after { color: #a8927f; }
.bh-stat.chg .after { color: #7c2d12; font-weight: 700; }
#bf.restore .bh-stat.chg .after { color: #14532d; }
/* ---- شمارندهٔ ثابت ردیف‌ها: پایین وسط صفحه ---- */
#rowStat { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40; height: 38px; padding: 0 18px; gap: 10px;
  background: #14532d; border: 0; border-radius: 999px; color: #d1fae5; box-shadow: 0 8px 24px #0f2a1a40; font-size: 13px; white-space: nowrap; }
#rowStat b { color: #fff; font-size: 16px; }
#rowStat .arr, #rowStat .after { display: none; }
#rowStat.chg .arr, #rowStat.chg .after { display: inline; }
#rowStat .arr { color: #86efac; }
#rowStat.chg .after { color: #fde68a; font-weight: 700; animation: statBlink 1.1s ease-in-out infinite; }
#rowStat.chg .after b { color: #fcd34d; }
@keyframes statBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
#bf.restore ~ * #rowStat, #rowStat.rest { }
main { padding-bottom: 70px; }
@media print { #rowStat { display: none; } }

/* ---- چاپ لیست نهایی، مثل همای قدیم: # | کد رشته | عنوان رشته | دانشگاه (دوره - نحوهٔ پذیرش) | استان ---- */
.print-head, .print-title, .print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm 10mm; }
  main { padding: 0 !important; max-width: none; }
  .print-head { display: flex; gap: 8px; margin-bottom: 6mm; font-size: 10pt; color: #000; }
  .ph-box { flex: 1; border: 1px solid #000; padding: 3mm 4mm; line-height: 1.9; }
  .print-title { display: block; text-align: center; font-weight: 700; font-size: 12pt; margin-bottom: 4mm; }
  .print-only { display: inline; }
  .gbar, .behine, #rowStat, .bpanel, .flash, .card > p.muted, .head-row .muted, .noprint { display: none !important; }
  #ft { table-layout: auto !important; font-size: 9pt; border-collapse: collapse; width: 100%; }
  #ft col { width: auto !important; }
  #ft th, #ft td { background: #fff !important; color: #000 !important; border: 1px solid #000; padding: 1.2mm 2mm !important; height: auto;
    white-space: normal !important; overflow: visible !important; text-overflow: clip !important; box-shadow: none !important; animation: none !important; }
  #ft th { background: #eee !important; text-align: center; }
  #ft td:nth-child(2), #ft td:nth-child(4), #ft td:nth-child(8) { text-align: center; }
  /* ستون‌هایی که در چاپ نیستند: شمارهٔ قدیم، دوره، شانس */
  #ft th:nth-child(3), #ft td:nth-child(3), #ft th:nth-child(9), #ft td:nth-child(9), #ft th:nth-child(10), #ft td:nth-child(10) { display: none; }
  #ft .love, #ft .gtag, #ft .tozih, #ft .mv { display: none !important; }
  #ft tr { page-break-inside: avoid; }
  #ft thead { display: table-header-group; }
}

/* ---- چاپ، نسخهٔ ۲: جمع‌وجور ---- */
.print-notes { display: none; }
@media print {
  @page { size: A4; margin: 9mm 8mm 10mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 8pt; }
  .print-head { display: flex; align-items: center; justify-content: space-between; gap: 6mm; margin: 0 0 3mm; padding: 0 0 2mm;
    border-bottom: 1.2pt solid #14532d; font-size: 9pt; color: #14532d; }
  .ph-brand { font-size: 7.5pt; color: #6b7a71; }
  .ph-title { font-weight: 800; font-size: 11pt; }
  .ph-name { font-weight: 800; font-size: 10.5pt; color: #000; }
  .print-title, .ph-box { display: none !important; }
  #ft { font-size: 7.6pt; border-collapse: collapse; }
  #ft th, #ft td { border: 0 !important; border-bottom: .4pt solid #d6ddd8 !important; padding: .55mm 1.4mm !important; line-height: 1.35; vertical-align: middle; }
  #ft thead th { background: #eef5f0 !important; color: #14532d !important; font-weight: 800; font-size: 7.4pt; border-bottom: .9pt solid #14532d !important; padding: 1mm 1.4mm !important; }
  #ft tbody tr:nth-child(even) td { background: #f7f9f8 !important; }
  #ft td:nth-child(2) { color: #6b7a71 !important; width: 7mm; }
  #ft td:nth-child(4) { font-weight: 700; width: 11mm; letter-spacing: .2pt; }
  #ft td:nth-child(8) { width: 16mm; }
  /* دوره در چاپ برمی‌گردد، کوتاه */
  #ft th:nth-child(9), #ft td:nth-child(9) { display: table-cell !important; width: 26mm; white-space: nowrap !important; }
  #ft .dpill { background: none !important; padding: 0 !important; font-size: 7.4pt; }
  #ft .nv { margin-right: 1mm; padding: 0 1.2mm; border-radius: 1mm; background: #eef0ee !important; color: #555 !important; font-size: 6.4pt; }
  #ft .fn { color: #b45309 !important; font-weight: 800; font-size: 6pt; margin-right: .6mm; }
  .print-notes { display: block; margin-top: 4mm; font-size: 7pt; color: #333; column-count: 2; column-gap: 6mm; }
  .print-notes > b { display: block; column-span: all; color: #14532d; font-size: 8pt; margin-bottom: 1.5mm; border-bottom: .6pt solid #14532d; padding-bottom: .8mm; }
  .print-notes ol { list-style: none; margin: 0; padding: 0; }
  .print-notes li { break-inside: avoid; margin-bottom: 1mm; line-height: 1.45; }
  .print-notes .n { display: inline-block; min-width: 4mm; color: #b45309; font-weight: 800; }
  .card { box-shadow: none !important; }
}

/* ---- چاپ، نسخهٔ ۳ ---- */
@media print {
  @page { size: A4; margin: 10mm 9mm 11mm; }
  body { font-size: 8pt; color: #1f2a24; }
  .print-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 0 4mm; padding: 0 0 2.5mm;
    border-bottom: 0; background: linear-gradient(#14532d, #14532d) bottom / 100% 1.6pt no-repeat; }
  .ph-cap { font-size: 7.5pt; font-weight: 700; color: #1b8a3a; letter-spacing: .3pt; margin-bottom: .6mm; }
  .ph-name { font-size: 15pt; font-weight: 800; color: #0f2a1a; line-height: 1.1; }
  .ph-l { text-align: left; }
  .ph-brand { font-size: 8pt; font-weight: 700; color: #14532d; }
  .ph-brand i { font-style: normal; color: #9fb3a6; margin: 0 1mm; }
  .ph-meta { font-size: 7pt; color: #7b8a81; margin-top: .6mm; }
  .ph-title, .ph-box, .print-title { display: none !important; }

  #ft { font-size: 7.6pt; width: 100%; table-layout: auto !important; border-collapse: collapse; }
  #ft colgroup { display: none; }
  #ft thead th { background: transparent !important; color: #7b8a81 !important; font-weight: 700; font-size: 6.8pt; text-align: right;
    border: 0 !important; border-bottom: .8pt solid #14532d !important; padding: 0 1.6mm 1mm !important; }
  #ft td { border: 0 !important; border-bottom: .35pt solid #e3e9e5 !important; padding: .9mm 1.6mm !important; line-height: 1.3; vertical-align: middle; }
  #ft tbody tr:nth-child(even) td { background: #f6f8f7 !important; }
  /* ستون‌ها */
  #ft th:nth-child(2), #ft td:nth-child(2) { width: 5mm; text-align: center; color: #9aa89f !important; font-size: 6.8pt; white-space: nowrap !important; }
  #ft th:nth-child(4), #ft td:nth-child(4) { width: 11mm; text-align: center; white-space: nowrap !important; }
  #ft td:nth-child(4) { font-weight: 800; color: #0f2a1a !important; font-size: 8pt; }
  #ft th:nth-child(5), #ft td:nth-child(5) { width: 30%; }
  #ft td:nth-child(5) { font-weight: 700; }
  #ft td.uni .par { color: #8a978f; font-size: 6.8pt; font-weight: 400; }
  #ft th:nth-child(8), #ft td:nth-child(8) { width: 13mm; white-space: nowrap !important; color: #4b5b51 !important; }
  #ft th:nth-child(9), #ft td:nth-child(9) { width: 25mm; white-space: nowrap !important; }
  #ft td:nth-child(9) { box-shadow: inset -1.6pt 0 0 var(--dk) !important; }
  #ft .dpill { color: var(--dk) !important; font-weight: 700; font-size: 7pt; }
  #ft .nv { float: left; margin: 0; padding: 0 1.2mm; border: .4pt solid #cfd8d2; background: #fff !important; color: #6b7a71 !important; font-size: 6pt; border-radius: 3pt; line-height: 1.5; }
  #ft .fn { color: #c2410c !important; font-size: 5.8pt; }
  .print-notes { margin-top: 5mm; font-size: 6.8pt; color: #4b5b51; column-count: 2; column-gap: 8mm; }
  .print-notes > b { font-size: 7pt; color: #7b8a81; border-bottom: .8pt solid #14532d; letter-spacing: .3pt; }
  .print-notes .n { color: #c2410c; min-width: 3.5mm; }
}
@media print { #ft .nv { float: none !important; display: inline-block; margin: 0 1.2mm 0 0 !important; vertical-align: 1px; } #ft th:nth-child(9), #ft td:nth-child(9) { width: 28mm; } }
@media print { #ft th:nth-child(5), #ft td:nth-child(5) { width: 24%; } }
/* ستون «پذیرش» فقط در چاپ: آزمون / سوابق پررنگ و متمایز */
#ft .pcell { display: none; }
@media print {
  #ft th.pcell, #ft td.pcell { display: table-cell !important; width: 13mm; text-align: center; white-space: nowrap !important; }
  #ft th.pcell { color: #14532d !important; }
  #ft .adm { display: inline-block; min-width: 10mm; padding: .25mm 1.5mm; border-radius: 2.5pt; font-size: 7pt; font-weight: 800; line-height: 1.5; }
  #ft .adm.az { background: #14532d !important; color: #fff !important; }
  #ft .adm.sv { background: #fff !important; color: #b45309 !important; box-shadow: inset 0 0 0 .9pt #b45309; }
}
/* ---- چاپ، نسخهٔ ۴: فقط کادر واقعی (بدون تکیه بر پس‌زمینه/سایه که ممکن است چاپ نشوند) ---- */
@media print {
  .print-head { background: none !important; border-bottom: 1.5pt solid #14532d !important; }
  #ft tbody tr:nth-child(even) td { background: #fff !important; }
  #ft td { border-bottom: .5pt solid #c9d2cc !important; padding: .8mm 1.4mm !important; }
  #ft thead th { border-bottom: 1pt solid #14532d !important; color: #14532d !important; }
  /* رشته فقط به اندازهٔ خودش؛ فضای بیشتر برای دانشگاه */
  #ft th:nth-child(5), #ft td:nth-child(5) { width: 1% !important; white-space: nowrap !important; padding-left: 3mm !important; }
  #ft td.uni { font-size: 7.3pt; }
  #ft td.uni .par { font-size: 6.2pt; }
  /* نشانگر دوره: کادر واقعی */
  #ft td:nth-child(9) { box-shadow: none !important; border-right: 1.8pt solid var(--dk) !important; padding-right: 1.6mm !important; }
  /* پذیرش: هر دو با کادر، بدون نیاز به پس‌زمینه */
  #ft .adm { background: #fff !important; box-shadow: none !important; padding: 0 1.4mm !important; border-radius: 2pt; }
  #ft .adm.az { color: #14532d !important; border: 1.2pt solid #14532d; }
  #ft .adm.sv { color: #b45309 !important; border: 1.2pt dashed #b45309; }
  .print-notes > b { border-bottom: 1pt solid #14532d !important; }
}
@media print {
  #ft td, #ft th { font-size: 7.4pt !important; }
  #ft thead th { font-size: 6.8pt !important; }
  #ft td:nth-child(2) { font-size: 6.6pt !important; }
  #ft td:nth-child(4) { font-size: 7.8pt !important; }
  #ft td:nth-child(5) { font-size: 7.6pt !important; }
  #ft td.uni { font-size: 7.3pt !important; }
  #ft td.uni .par { font-size: 6.2pt !important; }
  #ft td:nth-child(8) { font-size: 7.2pt !important; }
  #ft .dpill { font-size: 7pt !important; }
  #ft .adm, #ft .adm.az, #ft .adm.sv { background: #fff !important; font-size: 6.8pt !important; }
  #ft .adm.az { color: #14532d !important; }
}

/* پذیرش (ستون ۶، پس از رشته): متن ساده و پررنگ، بدون کادر */
@media print {
  #ft th.pcell, #ft td.pcell { width: 1% !important; padding: .8mm 2mm !important; text-align: center; }
  #ft .adm, #ft .adm.az, #ft .adm.sv { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; min-width: 0; font-weight: 800; font-size: 7.2pt !important; }
  #ft .adm.az { color: #14532d !important; }
  #ft .adm.sv { color: #c2410c !important; }
  /* رشته فقط به اندازهٔ متن خودش */
  #ft th:nth-child(5), #ft td:nth-child(5) { width: 1% !important; padding-left: 1.6mm !important; }
  #ft td.uni { width: auto !important; }
}
@media print { #ft th:nth-child(5), #ft td:nth-child(5) { white-space: normal !important; width: 30mm !important; max-width: 34mm; } }
@media print { #ft th:nth-child(5), #ft td:nth-child(5) { width: 38mm !important; min-width: 38mm; max-width: 40mm; } }
/* ستون پذیرش در صفحه هم */
#ft th.pcell, #ft td.pcell { display: table-cell; text-align: center; }
#ft .adm { font-weight: 800; font-size: 12px; }
#ft .adm.az { color: #14532d; }
#ft .adm.sv { color: #c2410c; }
/* چاپ: کاملاً سیاه‌وسفید */
@media print {
  .print-head { border-bottom-color: #000 !important; }
  .ph-cap, .ph-brand, .ph-name, .ph-meta { color: #000 !important; }
  .ph-cap, .ph-meta, .ph-brand i { color: #555 !important; }
  #ft thead th { color: #000 !important; border-bottom-color: #000 !important; }
  #ft td { color: #000 !important; border-bottom-color: #bbb !important; }
  #ft td:nth-child(2), #ft td.uni .par { color: #666 !important; }
  #ft td:nth-child(9) { border-right: 0 !important; box-shadow: none !important; padding-right: 1.4mm !important; }
  #ft .dpill { color: #000 !important; font-weight: 400; }
  #ft .adm.az { color: #000 !important; font-weight: 800; }
  #ft .adm.sv { color: #000 !important; font-weight: 400; text-decoration: underline; text-underline-offset: 1.5pt; }
  #ft .fn, .print-notes .n { color: #000 !important; }
  .print-notes, .print-notes > b { color: #000 !important; border-bottom-color: #000 !important; }
}

/* ================= پنل مشاور ارشد — زبان تصویری داشبورد VIP کاپیتان ================= */
.ar { --bg:#F3F1EC; --card:#fff; --soft:#FAF8F3; --ink:#16283A; --mut:#5C7183; --faint:#8FA3B3; --line:#E8E2D6; --line2:#D8D0BF;
  --brand:#1B3A57; --brass:#9A7A14; --brass-hi:#C9A23A; --brass-bg:#F6EFD9; --bad:#B23B2E; --bad-bg:#F8E8E5; --ok:#217A4B; --ok-bg:#E6F2EA;
  --hero1:#16324D; --hero2:#0E2438; --herom:#9FB6CA; --r:18px;
  --sh-1:0 1px 2px rgba(44,42,33,.05),0 4px 16px -6px rgba(44,42,33,.10); --sh-2:0 2px 4px rgba(44,42,33,.07),0 14px 34px -10px rgba(44,42,33,.20);
  color: var(--ink); display: grid; gap: 14px; }
body:has(.ar) { background: #F3F1EC; }
.ar h1 { margin: 0; font-size: 22px; color: inherit; }
.ar-mut { color: var(--mut); font-size: 12px; }
.ar-cap { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: var(--brass-hi); }
.ar-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-radius: 22px; color: #fff; box-shadow: var(--sh-2);
  background: radial-gradient(900px 260px at 85% -40%, rgba(201,162,58,.22), transparent 60%), linear-gradient(135deg, var(--hero1), var(--hero2)); }
.ar-hero-r { display: flex; align-items: center; gap: 14px; }
.ar-herom { color: var(--herom); font-size: 12.5px; margin-top: 2px; }
.ar-hstats { display: flex; align-items: center; gap: 14px; }
.ar-chip-l { color: var(--herom); font-size: 12px; text-decoration: none; border: 1px solid #ffffff2a; padding: 5px 12px; border-radius: 99px; }
.ar-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; align-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--hero2) 78%, transparent 80% 100%), conic-gradient(var(--brass-hi) calc(var(--p) * 1%), #ffffff22 0); }
.ar-ring b { font-size: 19px; line-height: 1; }
.ar-ring span { font-size: 9.5px; color: var(--herom); margin-top: 3px; }
.ar-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff); }
.ar-av.xl { width: 58px; height: 58px; font-size: 18px; background: #ffffff14; color: var(--brass-hi); border-color: #C9A23A66; }
.ar-av.lg { width: 48px; height: 48px; font-size: 15px; }
.ar-av.sm { width: 26px; height: 26px; font-size: 10px; }
.ar-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ar-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s; }
.ar-kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.ar-kpi .kh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--mut); }
.ar-kpi .kh i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); }
.ar-kpi .kh svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ar-kpi .kv { font-size: 32px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ar-kpi.g .kh i { background: var(--ok-bg); color: var(--ok); } .ar-kpi.g .kv { color: var(--ok); }
.ar-kpi.w .kh i { background: var(--brass-bg); color: var(--brass); }
.ar-kpi.r .kh i { background: var(--bad-bg); color: var(--bad); }
.ar-tree { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-1); }
.ar-root { display: flex; align-items: center; gap: 10px; width: max-content; margin: 0 auto; padding: 8px 16px 8px 12px; border-radius: 99px;
  background: linear-gradient(135deg, var(--hero1), var(--hero2)); color: #fff; box-shadow: var(--sh-2); position: relative; }
.ar-root .ar-av { background: #ffffff14; color: var(--brass-hi); border-color: #C9A23A66; }
.ar-root .ar-mut { color: var(--herom); }
.ar-root::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 18px; background: var(--line2); }
.ar-branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--line2); }
.ar-mem { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px; position: relative; transition: box-shadow .15s, border-color .15s; }
.ar-mem::before { content: ""; position: absolute; bottom: 100%; left: 50%; width: 2px; height: 17px; background: var(--line2); }
.ar-mem.me { background: var(--brass-bg); border-color: #E6D6A6; }
.ar-mem.off { opacity: .55; }
.ar-mem.over { border-color: var(--brass-hi); box-shadow: 0 0 0 2px var(--brass-hi); }
.ar-mem header { display: flex; align-items: center; gap: 10px; }
.ar-mh { flex: 1; min-width: 0; }
.ar-mh b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-tg button { border: 1px solid var(--line2); background: #fff; color: var(--mut); width: 28px; height: 28px; border-radius: 9px; cursor: pointer; }
.ar-tg button:hover { color: var(--bad); border-color: var(--bad); }
.ar-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; margin: 10px 0 8px; background: var(--line); gap: 1px; }
.ar-bar i { display: block; } .ar-bar .none { flex: 1; }
.ar-bar .s0 { background: #CFC7B6; } .ar-bar .s1 { background: var(--faint); } .ar-bar .s2 { background: var(--brass-hi); } .ar-bar .s3 { background: #2C5F8A; } .ar-bar .s4 { background: var(--ok); }
.ar-sts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.ar-sts li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 12.5px;
  box-shadow: inset -3px 0 0 var(--st, var(--line2)); cursor: grab; }
.ar-sts li.drg { opacity: .4; }
.ar-sts li.empty { justify-content: center; color: var(--faint); border-style: dashed; cursor: default; box-shadow: none; font-size: 11.5px; }
.ar-sts li.s0 { --st: #CFC7B6; } .ar-sts li.s1 { --st: var(--faint); } .ar-sts li.s2 { --st: var(--brass-hi); } .ar-sts li.s3 { --st: #2C5F8A; } .ar-sts li.s4 { --st: var(--ok); }
.ar-sts .nm { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-sts .nm:hover { color: var(--brand); text-decoration: underline; }
.ar-stg { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.ar-stg.s0 { background: #F1EDE4; color: #8C8270; } .ar-stg.s1 { background: #EEF2F5; color: var(--mut); } .ar-stg.s2 { background: var(--brass-bg); color: var(--brass); }
.ar-stg.s3 { background: #E8F0F7; color: #2C5F8A; } .ar-stg.s4 { background: var(--ok-bg); color: var(--ok); }
.ar-go { color: var(--brand); text-decoration: none; font-weight: 800; }
.ar-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); }
.ar-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ar-grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ar-pick { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.ar-pick:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.ar-form { display: grid; gap: 8px; align-content: start; }
.ar-form b { font-size: 14px; }
.ar-row { display: flex; gap: 8px; }
.ar-form input, .ar-form select { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; font: inherit; font-size: 13px; background: #fff; margin: 0; }
.ar-form input:focus, .ar-form select:focus { outline: none; border-color: var(--brass-hi); box-shadow: 0 0 0 3px #C9A23A33; }
.ar-btn { height: 36px; padding: 0 18px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--hero1), var(--hero2)); }
.ar-btn:hover { box-shadow: 0 0 0 2px var(--brass-hi); }
@media (max-width: 900px) { .ar-kpis { grid-template-columns: repeat(3, 1fr); } .ar-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ar-kpis { grid-template-columns: repeat(2, 1fr); } .ar-hero { flex-direction: column; align-items: flex-start; } }
.ar { grid-template-columns: minmax(0, 1fr); } .ar > * { min-width: 0; } .ar-row { flex-wrap: wrap; } .ar-root { max-width: 100%; }
@media (max-width: 560px) { .ar-branches { grid-template-columns: 1fr; } .ar-kpi .kv { font-size: 26px; } }

/* ---- پنل ارشد: جمع‌وجور + کاشی‌های فعال ---- */
.ar { gap: 10px; }
.ar-hero { padding: 12px 18px; border-radius: 16px; }
.ar-hero h1 { font-size: 18px; }
.ar-av.xl { width: 44px; height: 44px; font-size: 15px; }
.ar-ring { width: 58px; height: 58px; } .ar-ring b { font-size: 14px; } .ar-ring span { font-size: 8px; margin-top: 1px; }
.ar-kpis { gap: 8px; }
.ar-kpi { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; cursor: pointer; font: inherit; text-align: right; color: inherit; }
.ar-kpi > i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); }
.ar-kpi > i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ar-kpi .kt { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--mut); }
.ar-kpi .kv { font-size: 20px; font-weight: 800; margin: 0; }
.ar-kpi.g > i { background: var(--ok-bg); color: var(--ok); } .ar-kpi.g .kv { color: var(--ok); }
.ar-kpi.w > i { background: var(--brass-bg); color: var(--brass); } .ar-kpi.w .kv { color: var(--brass); }
.ar-kpi.r > i { background: var(--bad-bg); color: var(--bad); } .ar-kpi.r .kv { color: var(--bad); }
.ar-kpi.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.ar-kpi.g.on { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.ar-kpi.w.on { border-color: var(--brass-hi); box-shadow: 0 0 0 2px var(--brass-hi); }
.ar-kpi.r.on { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.ar-kpi:hover { transform: translateY(-1px); }
.ar-tree { padding: 12px; border-radius: 14px; }
.ar-root { padding: 4px 12px 4px 8px; gap: 8px; }
.ar-root .ar-av { width: 30px; height: 30px; font-size: 11px; }
.ar-root b { font-size: 13px; } .ar-root .ar-mut { font-size: 10.5px; }
.ar-root::after { height: 12px; }
.ar-branches { margin-top: 12px; padding-top: 10px; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ar-mem::before { height: 11px; }
.ar-mem { padding: 8px; border-radius: 12px; }
.ar-mem .ar-av { width: 32px; height: 32px; font-size: 11px; }
.ar-mem header { gap: 8px; }
.ar-mh b { font-size: 13px; } .ar-mh .ar-mut { font-size: 11px; }
.ar-bar { height: 4px; margin: 6px 0; }
.ar-sts { gap: 3px; max-height: 230px; }
.ar-sts li { padding: 3px 6px; font-size: 12px; border-radius: 8px; gap: 6px; }
.ar-av.sm { width: 22px; height: 22px; font-size: 9px; }
.ar-stg { font-size: 10px; padding: 1px 7px; }
.ar-tg button { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.ar-tree.only-mosh .ar-sts, .ar-tree.only-mosh .ar-bar { display: none; }
.ar-mem.dim { opacity: .4; }
.ar-fcnt:empty { display: none; }
.ar-fcnt { order: 9; min-width: 22px; height: 22px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 6px; }
.ar-card { padding: 10px 12px; border-radius: 14px; }
.ar-form { gap: 6px; } .ar-form b { font-size: 13px; }
.ar-form input, .ar-form select, .ar-btn { height: 32px; font-size: 12.5px; border-radius: 8px; }
.ar-grid2 { gap: 10px; }
@media (max-width: 900px) { .ar-kpis { grid-template-columns: repeat(3, 1fr); } }

/* ================= کارنامه — جمع‌وجور ================= */
.kn { --ink:#16283A; --mut:#5C7183; --faint:#8FA3B3; --line:#E3E8E4; --line2:#CFD8D2; --brand:#1b8a3a; --brand-d:#14532d; --soft:#F6F9F7;
  display: grid; gap: 10px; color: var(--ink); padding-bottom: 64px; }
.kn [hidden] { display: none !important; }
.kn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-radius: 14px; color: #fff;
  background: radial-gradient(700px 200px at 90% -60%, rgba(134,239,172,.25), transparent 60%), linear-gradient(135deg, #14532d, #0f3d22); }
.kn-head h1 { margin: 0; font-size: 18px; color: #fff; }
.kn-cap { font-size: 11px; color: #86efac; font-weight: 700; }
.kn-pill { font-size: 12px; padding: 3px 12px; border-radius: 99px; background: #ffffff1f; color: #d1fae5; }
.kn-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px #0000000a, 0 4px 14px -8px #0000001f; }
.kn-card h2 { margin: 0 0 10px; font-size: 14px; color: var(--brand-d); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kn-hint { font-size: 11px; font-weight: 400; color: var(--faint); }
.kn-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px 16px; }
.kn-f { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kn-l { width: 84px; flex: none; font-size: 12px; font-weight: 700; color: var(--mut); }
.kn-seg { display: inline-flex; flex: 1; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; background: #fff; min-width: 0; }
.kn-seg input { position: absolute; opacity: 0; pointer-events: none; }
.kn-seg label { flex: 1; text-align: center; padding: 0 8px; height: 32px; line-height: 32px; font-size: 12.5px; cursor: pointer; margin: 0; color: var(--ink); white-space: nowrap; transition: background .12s; }
.kn-seg label + input + label, .kn-seg input + label ~ label { border-right: 1px solid var(--line2); }
.kn-seg label:hover { background: var(--soft); }
.kn-seg input:checked + label { background: var(--brand-d); color: #fff; font-weight: 700; }
.kn-seg input:focus-visible + label { box-shadow: inset 0 0 0 2px #86efac; }
.kn-in { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 9px; font: inherit; font-size: 13px; background: #fff; margin: 0; }
.kn-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #1b8a3a26; }
.kn-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.kn-num { display: grid; gap: 4px; margin: 0; }
.kn-num span { font-size: 11.5px; font-weight: 700; color: var(--mut); }
.kn-num .kn-in { font-size: 15px; font-weight: 700; text-align: center; letter-spacing: .5px; }
.kn-two { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; align-items: start; }
.kn-mj { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.kn-mj + .kn-mj { border-top: 1px dashed var(--line); }
.kn-mj .kn-l { padding-top: 6px; }
.kn-mj.off { opacity: .35; pointer-events: none; }
.kn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kn-chip { position: relative; margin: 0; cursor: pointer; }
.kn-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kn-chip span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 99px; border: 1px solid var(--line2); background: #fff; font-size: 12.5px; color: var(--mut); transition: all .12s; user-select: none; }
.kn-chip span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line2); background: #fff; flex: none; transition: all .12s; }
.kn-chip span i { font-style: normal; font-size: 10.5px; color: var(--faint); }
.kn-chip:hover span { border-color: var(--brand); }
.kn-chip input:checked + span { background: #E8F5EC; border-color: var(--brand); color: var(--brand-d); font-weight: 700; }
.kn-chip input:checked + span::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--brand); }
.kn-chip input:focus-visible + span { box-shadow: 0 0 0 3px #1b8a3a33; }
.kn-sep { height: 1px; background: var(--line); margin: 10px 0; }
.kn-save { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px 16px;
  background: #ffffffe6; backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.kn-btn { height: 38px; padding: 0 28px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #1b8a3a, #14532d); color: #fff; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 6px 16px -6px #14532d88; }
.kn-btn:hover { filter: brightness(1.08); }
@media (max-width: 900px) { .kn-two { grid-template-columns: 1fr; } .kn-nums { grid-template-columns: repeat(2, 1fr); } }
.kn .mojaz-col { border: 0 !important; background: none !important; padding: 6px 0 !important; border-radius: 0 !important; box-shadow: none !important; } .kn .kn-mj + .kn-mj { border-top: 1px dashed #E3E8E4 !important; }

/* ---- اسکلت: خانهٔ عدد اعشاری دوبخشی ---- */
.dec { display: inline-flex; align-items: center; gap: 0; border: 1px solid #CFD8D2; border-radius: 9px; background: #fff; overflow: hidden; height: 32px; }
.dec input { width: 3.2em; height: 100%; border: 0 !important; margin: 0; padding: 0 4px; text-align: center; font: inherit; font-weight: 700; font-size: 15px; background: transparent; box-shadow: none !important; }
.dec input:focus { outline: none; background: #E8F5EC; }
.dec b { color: #8FA3B3; font-size: 18px; line-height: 1; padding: 0 1px; }
.dec:focus-within { border-color: #1b8a3a; box-shadow: 0 0 0 3px #1b8a3a26; }
.kn-num .dec { width: 100%; justify-content: center; }

/* ناحیه و قطب در کارنامه */
.kn-geo { gap: 8px; }
.kn-mini { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 11.5px; color: #5C7183; }
.kn-mini .kn-in { width: 58px; flex: none; text-align: center; padding: 0 4px; }
.kn-geo-st { font-size: 11px; color: #8FA3B3; white-space: nowrap; }
.kn-geo-st.man { color: #b45309; font-weight: 700; }
.kn-reset { border: 1px solid #CFD8D2; background: #fff; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: #b45309; }

/* عددهای درشت با جداکننده: فاصلهٔ بیشتر بین رقم‌ها */
.kn-num .kn-in[data-sep] { letter-spacing: 1.5px; word-spacing: 2px; font-size: 16px; }
input[data-sep] { direction: ltr; unicode-bidi: plaintext; }
input[data-sep]:placeholder-shown { direction: rtl; }

/* ================= قدم ۲ — رشته‌ها ================= */
.pk { --ink:#16283A; --mut:#5C7183; --faint:#8FA3B3; --line:#E3E8E4; --line2:#CFD8D2; --brand:#1b8a3a; --brand-d:#14532d; --soft:#F6F9F7;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; align-items: start; color: var(--ink); padding-bottom: 60px; }
.pk [hidden] { display: none !important; }
.pk-mine, .pk-cat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 1px 2px #0000000a, 0 4px 14px -8px #0000001f; }
.pk-mine { position: sticky; top: 70px; max-height: calc(100vh - 150px); overflow-y: auto; }
.pk-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pk-h h2 { margin: 0; font-size: 14px; color: var(--brand-d); }
.pk-h h2 b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-right: 4px; border-radius: 99px; background: var(--brand-d); color: #fff; font-size: 11px; }
.pk-hint { font-size: 11px; color: var(--faint); }
/* ستون‌های علاقه */
.pk-lane { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; background: var(--soft); transition: border-color .12s, box-shadow .12s; }
.pk-lane.over { border-color: var(--brand); box-shadow: 0 0 0 2px #1b8a3a33; }
.pk-lh { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; font-weight: 800; border-bottom: 1px solid var(--line); }
.pk-lh .st { color: #f59e0b; letter-spacing: -1px; }
.pk-ln { margin-right: auto; font-size: 11px; color: var(--mut); font-weight: 700; }
.pk-list { list-style: none; margin: 0; padding: 4px; counter-reset: pk; min-height: 6px; }
.pk-list li { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; margin: 3px 0; font-size: 12.5px; cursor: grab; counter-increment: pk; }
.pk-list li::before { content: counter(pk, persian); min-width: 18px; text-align: center; font-size: 11px; color: var(--faint); font-weight: 700; }
.pk-list li .grip { color: #b7c2bb; font-size: 11px; }
.pk-list li .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-list li .nm i, .pk-tree .nm i { font-style: normal; color: var(--faint); font-size: 11px; }
.pk-list li .cnt { font-size: 10.5px; color: var(--faint); }
.pk-list li .x { border: 0; background: transparent; color: #b7c2bb; cursor: pointer; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.pk-list li .x:hover { background: #fee2e2; color: #b91c1c; }
.pk-list li.drg { opacity: .35; }
.pk-list li.bad { border-color: #f3c4c4; background: #fff7f7; }
.pk-list li .warn { font-size: 10.5px; font-weight: 800; color: #b91c1c; background: #fee2e2; border-radius: 99px; padding: 0 7px; }
@keyframes pkBlink { 0%, 50%, 100% { background: #fff; } 25%, 75% { background: #fde68a; } }
.pk-list li.blink { animation: pkBlink 1.6s ease-in-out; }
.pk-empty { display: none; padding: 8px; text-align: center; font-size: 11px; color: var(--faint); }
.pk-lane.empty .pk-empty { display: block; }
.pk-lane.l1 { background: #FFFBEB; } .pk-lane.l2 { background: #F7FAF8; } .pk-lane.l3 { background: #FAFAFA; }
/* کاتالوگ */
.pk-search { display: flex; gap: 6px; margin-bottom: 8px; }
.pk-search input { flex: 1; height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 9px; font: inherit; font-size: 13px; margin: 0; }
.pk-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #1b8a3a26; }
.pk-search button { width: 34px; height: 34px; border: 1px solid var(--line2); background: #fff; border-radius: 9px; cursor: pointer; color: var(--mut); }
.pk-tree details { border-radius: 8px; }
.pk-tree details > summary { list-style: none; cursor: pointer; padding: 5px 8px !important; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.pk-tree details > summary::before { content: "▸"; color: var(--faint); font-size: 10px; transition: transform .12s; }
.pk-tree details[open] > summary::before { transform: rotate(90deg); }
.pk-tree .t1 > summary { font-weight: 800; font-size: 13px; background: var(--soft); margin-top: 4px; }
.pk-tree .t2 { margin-right: 14px; }
.pk-tree .t2 > summary { font-weight: 700; font-size: 12.5px; color: var(--mut); }
.pk-tree summary .c { margin-right: auto; font-size: 10.5px; color: var(--faint); font-weight: 400; }
.pk-tree ul { list-style: none; margin: 0 22px 4px 0; padding: 0; }
.pk-tree li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; font-size: 12.5px; }
.pk-tree li:hover { background: var(--soft); }
.pk-tree li .nm { flex: 1; min-width: 0; }
.pk-tree li .cnt { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.pk-tree li .add { display: inline-flex; gap: 2px; opacity: .35; transition: opacity .1s; }
.pk-tree li:hover .add { opacity: 1; }
.pk-tree li .add button { border: 1px solid var(--line2); background: #fff; color: #f59e0b; border-radius: 6px; height: 22px; padding: 0 6px; font-size: 10.5px; cursor: pointer; letter-spacing: -1px; }
.pk-tree li .add button:hover { background: #fffbeb; border-color: #f59e0b; }
.pk-tree li .ok { display: none; font-size: 11px; color: var(--brand); font-weight: 700; }
.pk-tree li.in { opacity: .55; } .pk-tree li.in .add { display: none; } .pk-tree li.in .ok { display: inline; }
.pk-none { text-align: center; color: var(--faint); font-size: 12px; }
/* نوار پایین */
.pk-save { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px 16px;
  background: #ffffffe6; backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.pk-save .pk-hint.busy { color: #b45309; } .pk-save .pk-hint.err { color: #b91c1c; font-weight: 800; }
.pk-btn { height: 38px; line-height: 38px; padding: 0 28px; border-radius: 10px; background: linear-gradient(135deg, #1b8a3a, #14532d); color: #fff; font-weight: 800; text-decoration: none; box-shadow: 0 6px 16px -6px #14532d88; }
@media (max-width: 900px) { .pk { grid-template-columns: 1fr; } .pk-mine { position: static; max-height: none; } }
.pk-tree .t1 > summary { margin-top: 2px; padding: 4px 8px !important; } .pk-tree .t2 > summary { padding: 3px 8px !important; }

/* ---- قدم ۳ — استان‌ها، جمع‌وجور ---- */
.prov-wrap { gap: 12px; }
.prov-side h2 { font-size: 14px; margin: 0 0 6px; }
.prov-side .pv-sub { margin-top: 12px; font-size: 13px; }
.prov-side .pv-sub .muted { font-size: 11px; font-weight: 400; }
.order { gap: 3px; max-height: 360px; }
.order li { padding: 3px 8px; gap: 8px; border-radius: 8px; font-size: 13px; }
.order .num { width: 22px; height: 22px; font-size: 11px; }
.order .cc { font-size: 10.5px; color: #8FA3B3; white-space: nowrap; }
.order .cc.z { color: #b91c1c; font-weight: 700; }
.order .acts button { width: 22px; height: 22px; font-size: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.quick .qb { height: 26px; padding: 0 10px; border: 1px solid #CFD8D2; background: #fff; border-radius: 99px; font: inherit; font-size: 11.5px; cursor: pointer; color: #14532d; }
.quick .qb:hover { background: #E8F5EC; border-color: #1b8a3a; }
.quick .qb.dz { color: #b91c1c; } .quick .qb.dz:hover { background: #fee2e2; border-color: #b91c1c; }
.chips { gap: 4px; }
.chips .chip { height: 26px; padding: 0 9px; font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; }
.chips .chip i { font-style: normal; font-size: 10px; color: #8FA3B3; }
.chips .chip.on i { color: #d1fae5; }
.chips .chip.zero { opacity: .45; }

/* ---- داشبورد ترکیب رشته × استان ---- */
.pv-dash { margin-top: 12px; border-top: 1px dashed #E3E8E4; padding-top: 10px; }
.pv-dash header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-dash h2 { margin: 0; font-size: 14px; color: #14532d; }
.pv-dash header .muted { font-size: 11px; }
.pv-kpis { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.pv-kpis .k { background: #fff; border: 1px solid #E3E8E4; border-radius: 12px; padding: 7px 12px; display: grid; gap: 1px; }
.pv-kpis .k span { font-size: 11.5px; color: #5C7183; font-weight: 700; }
.pv-kpis .k em { font-style: normal; color: #f59e0b; letter-spacing: -1px; }
.pv-kpis .k b { font-size: 22px; line-height: 1.1; color: #16283A; }
.pv-kpis .k i { font-style: normal; font-size: 10.5px; color: #8FA3B3; }
.pv-kpis .k.main { background: linear-gradient(135deg, #14532d, #0f3d22); border: 0; }
.pv-kpis .k.main span, .pv-kpis .k.main i { color: #bbf7d0; } .pv-kpis .k.main b { color: #fff; }
.pv-mx-wrap { overflow: auto; max-height: 520px; border: 1px solid #E3E8E4; border-radius: 12px; background: #fff; }
.pv-mx { border-collapse: separate; border-spacing: 0; font-size: 11.5px; min-width: 100%; }
.pv-mx th, .pv-mx td { padding: 0; height: 26px; text-align: center; border-bottom: 1px solid #F0F3F1; white-space: nowrap; }
.pv-mx thead th { position: sticky; top: 0; z-index: 2; background: #F6F9F7; height: 86px; vertical-align: bottom; border-bottom: 1px solid #CFD8D2; }
.pv-mx th.ph { width: 30px; min-width: 30px; cursor: pointer; }
.pv-mx th.ph span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; font-weight: 700; color: #5C7183; }
.pv-mx th.ph b { writing-mode: horizontal-tb; transform: rotate(180deg); background: #14532d; color: #fff; border-radius: 99px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; font-size: 10px; }
.pv-mx th.ph.on { background: #E8F5EC; } .pv-mx th.ph.on span { color: #14532d; }
.pv-mx th.ph:hover { background: #d1fae5; }
.pv-mx .rh { position: sticky; right: 0; z-index: 1; background: #fff; text-align: right; padding: 0 10px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; border-left: 1px solid #E3E8E4; }
.pv-mx thead .rh { z-index: 3; background: #F6F9F7; }
.pv-mx .tt { position: sticky; right: 230px; z-index: 1; background: #fff; font-weight: 800; padding: 0 8px; border-left: 2px solid #CFD8D2; color: #14532d; }
.pv-mx .tt small { font-weight: 400; color: #8FA3B3; font-size: 10px; }
.pv-mx .tt.z { color: #b91c1c; }
.pv-mx thead .tt { z-index: 3; background: #F6F9F7; color: #5C7183; font-size: 10.5px; }
.pv-mx td.c { background: rgba(100, 116, 139, calc(var(--a) * .55)); color: #334155; }
.pv-mx td.c.on { background: rgba(27, 138, 58, var(--a)); color: #fff; font-weight: 700; }
.pv-mx td.c.on:empty { background: #F3FAF5; }
.pv-mx tr.lv td { position: sticky; right: 0; height: 22px; text-align: right; padding: 0 10px; font-weight: 800; font-size: 11.5px; background: #F6F9F7; color: #16283A; }
.pv-mx tr.lv .st { color: #f59e0b; letter-spacing: -1px; }
.pv-mx tr.lv.l1 td { background: #FFFBEB; }
.pv-mx tbody tr:not(.lv):hover td { filter: brightness(.96); }
@media (max-width: 900px) { .pv-kpis { grid-template-columns: repeat(2, 1fr); } }
.pv-mx .rh { width: 190px; min-width: 190px; max-width: 190px; box-sizing: border-box; } .pv-mx .tt { right: 190px; min-width: 64px; box-sizing: border-box; }

/* خانه‌های قابل انتخاب داشبورد */
.pv-mx td.can { cursor: pointer; }
.pv-mx td.can:hover { outline: 2px solid #14532d; outline-offset: -2px; }
.pv-mx td.c.m-ex { background: repeating-linear-gradient(135deg, #fff 0 4px, #fde2e2 4px 8px) !important; color: #b91c1c !important; text-decoration: line-through; font-weight: 700; }
.pv-mx td.c.m-in { box-shadow: inset 0 0 0 2px #14532d; }
.pv-mx td.c.m-in:not(.on) { background: rgba(27, 138, 58, var(--a)); color: #fff; }

/* داشبورد: فیلتر دوره/پذیرش و کاشی‌های دوره */
.pv-filt, .pv-dores { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
.pv-filt .fl, .pv-dores .fl { font-size: 11px; font-weight: 800; color: #5C7183; margin-left: 4px; }
.pv-filt .fl.sep { margin-right: 10px; padding-right: 10px; border-right: 1px solid #CFD8D2; }
.pv-filt button { height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid #CFD8D2; background: #fff; color: #8FA3B3; font: inherit; font-size: 11.5px; cursor: pointer; text-decoration: line-through; }
.pv-filt button.on { background: #E8F5EC; border-color: #1b8a3a; color: #14532d; font-weight: 700; text-decoration: none; }
.pv-filt button.all { text-decoration: none; color: #14532d; margin-right: 6px; }
.pv-dores .dt { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px; background: #fff; border: 1px solid #E3E8E4; border-radius: 10px; padding: 4px 10px; }
.pv-dores .dt b { font-size: 16px; color: #14532d; grid-row: span 2; }
.pv-dores .dt span { font-size: 11.5px; font-weight: 700; color: #16283A; }
.pv-dores .dt i { font-style: normal; font-size: 10px; color: #8FA3B3; }
.pv-dores .dt.off { opacity: .4; }
/* ---- داشبورد جمع‌وجورتر ---- */
.pv-dash { margin-top: 8px; padding-top: 8px; }
.pv-dash header { margin-bottom: 6px; gap: 8px; }
.pv-dash h2 { font-size: 13px; }
.pv-dash header .muted { font-size: 10.5px; }
.pv-filt, .pv-dores { gap: 3px; margin-bottom: 5px; }
.pv-filt button { height: 22px; padding: 0 8px; font-size: 11px; }
.pv-filt .fl, .pv-dores .fl { font-size: 10.5px; }
.pv-kpis { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.pv-kpis .k { display: flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 99px; }
.pv-kpis .k span { font-size: 11px; order: 1; }
.pv-kpis .k b { font-size: 15px; order: 0; }
.pv-kpis .k i { font-size: 10px; order: 2; }
.pv-dores .dt { display: flex; align-items: baseline; gap: 5px; padding: 2px 9px; border-radius: 99px; }
.pv-dores .dt b { font-size: 13px; grid-row: auto; }
.pv-dores .dt span { font-size: 11px; }
.pv-dores .dt i { font-size: 9.5px; }
.pv-mx { font-size: 11px; }
.pv-mx th, .pv-mx td { height: 22px; }
.pv-mx thead th { height: 72px; }
.pv-mx th.ph { width: 26px; min-width: 26px; }
.pv-mx tr.lv td { height: 19px; font-size: 11px; }
.pv-mx .rh { width: 170px; min-width: 170px; max-width: 170px; padding: 0 8px; }
.pv-mx .tt { right: 170px; min-width: 56px; padding: 0 6px; }
.pv-mx-wrap { max-height: 440px; }

/* ---- استان‌ها: اولویت‌ها به‌صورت چیپ‌های شماره‌دار ---- */
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pv-top h2 { margin: 0 !important; }
.pv-top .quick { margin: 0; }
.pv-top .quick .qb { height: 24px; padding: 0 8px; font-size: 11px; }
.prov-side .order { display: flex; flex-wrap: wrap; flex-direction: row; gap: 4px; max-height: none; overflow: visible; padding: 0; margin: 0; }
.prov-side .order li { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px 0 8px; border-radius: 99px; border: 1px solid #CFD8D2; background: #fff; font-size: 12px; cursor: grab; position: relative; }
.prov-side .order li:hover { border-color: #1b8a3a; background: #F6F9F7; }
.prov-side .order li .num { width: 20px; height: 20px; font-size: 10.5px; }
.prov-side .order li .nm { flex: none; font-weight: 700; }
.prov-side .order li .cc { font-size: 10px; color: #8FA3B3; }
.prov-side .order li .cc.z { color: #b91c1c; }
.prov-side .order li .del { border: 0; background: transparent; width: 16px; height: 16px; border-radius: 50%; font-size: 9px; color: #b7c2bb; cursor: pointer; padding: 0; opacity: 0; transition: opacity .1s; }
.prov-side .order li:hover .del { opacity: 1; }
.prov-side .order li .del:hover { background: #fee2e2; color: #b91c1c; }
.prov-side .order li.over { border-color: #1b8a3a; box-shadow: 0 0 0 2px #1b8a3a33; }
.pv-empty { font-size: 11.5px; margin: 4px 0; }
.pv-all { margin-top: 10px; border-top: 1px dashed #E3E8E4; padding-top: 6px; }
.pv-all > summary { font-size: 12px; font-weight: 700; color: #5C7183; cursor: pointer; padding: 4px 0 !important; }
.pv-all > summary .muted { font-size: 10.5px; font-weight: 400; }
.pv-all .chips { margin-top: 6px; }
.prov-wrap { grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); }

/* ---- استان‌ها، طرح نهایی: فهرست شماره‌دار خوانا + نقشهٔ هم‌قد ---- */
.prov-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.map-box { padding: 6px; }
.iranmap { max-height: 420px; width: 100%; }
.prov-side .order { display: block; columns: 1; column-gap: 14px; max-height: none; overflow: visible; margin: 0; padding: 0; }
.prov-side .order.two { columns: 2; }
.prov-side .order li { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 6px; margin: 0 0 3px; border: 0; border-bottom: 1px solid #EEF2EF;
  border-radius: 0; background: transparent; font-size: 12.5px; cursor: grab; break-inside: avoid; }
.prov-side .order li:hover { background: #F6F9F7; border-radius: 8px; }
.prov-side .order li .num { width: 20px; height: 20px; font-size: 10.5px; flex: none; }
.prov-side .order li .nm { flex: none; width: 92px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prov-side .order li .bar { flex: 1; height: 6px; border-radius: 99px; background: #EEF2EF; overflow: hidden; min-width: 30px; }
.prov-side .order li .bar i { display: block; height: 100%; background: #1b8a3a; border-radius: 99px; }
.prov-side .order li .cc { width: 30px; text-align: left; font-size: 11px; font-weight: 700; color: #5C7183; }
.prov-side .order li .cc.z { color: #b91c1c; width: auto; }
.prov-side .order li .del { opacity: 0; width: 18px; height: 18px; font-size: 9px; }
.prov-side .order li:hover .del { opacity: 1; }
.prov-side .order li.over { box-shadow: inset 0 2px 0 #1b8a3a; background: #E8F5EC; }
.prov-side .order li.drag { opacity: .35; }

/* انتخاب دستی ردیف‌های داشبورد */
.pv-mx .rchk { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; max-width: 100%; }
.pv-mx .rchk input { width: 13px; height: 13px; margin: 0; accent-color: #14532d; flex: none; cursor: pointer; }
.pv-mx .rh .rchk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-mx tr.lv small { font-weight: 400; color: #8FA3B3; font-size: 10px; margin-right: 4px; }
.pv-mx tr.off td { opacity: .32; }
.pv-mx tr.off td.rh { opacity: 1; color: #8FA3B3; text-decoration: line-through; }
.pv-mx tr.off td.rh input { opacity: 1; }

/* ردیف برداشته/نیمه: خانه‌های حذفی آرام (بدون هاشور)، خانه‌های برگردانده پررنگ */
.pv-mx tr.off td { opacity: 1; }
.pv-mx tr.rs-off td.rh, .pv-mx tr.rs-off td.tt { color: #8FA3B3; }
.pv-mx tr.rs-off td.rh .rchk { text-decoration: line-through; }
.pv-mx tr.rs-off td.c.m-ex, .pv-mx tr.rs-mix td.c.m-ex { background: #F7F8F7 !important; color: #C3CCC6 !important; text-decoration: none; font-weight: 400; }
.pv-mx tr.rs-mix td.c.on, .pv-mx tr.rs-off td.c.on { box-shadow: inset 0 0 0 2px #14532d; }
/* کادرهای سنگین برداشته شد: خانهٔ نگه‌داشته فقط سبز؛ تک‌خانهٔ اضافه فقط یک نقطهٔ گوشه */
.pv-mx tr.rs-mix td.c.on, .pv-mx tr.rs-off td.c.on { box-shadow: none !important; }
.pv-mx td.c.m-in { box-shadow: none !important; position: relative; }
.pv-mx td.c.m-in::after { content: ""; position: absolute; top: 3px; left: 3px; width: 5px; height: 5px; border-radius: 50%; background: #14532d; }
.pv-mx td.c.on:empty, .pv-mx td.c:empty { box-shadow: none !important; background: transparent !important; }
.pv-mx td.c { border-left: 1px solid #fff; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 10.5px; color: #5C7183; }
.pv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pv-legend .lg { width: 14px; height: 12px; border-radius: 3px; display: inline-block; position: relative; }
.pv-legend .lg.on { background: #1b8a3a; } .pv-legend .lg.off { background: #cfd5dc; } .pv-legend .lg.ex { background: #F7F8F7; border: 1px solid #E3E8E4; }
.pv-legend .lg.in { background: #7fbf8f; } .pv-legend .lg.in::after { content: ""; position: absolute; top: 2px; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: #14532d; }

/* ================= قدم ۴ — چیدمان‌ها ================= */
.rs { display: grid; gap: 10px; padding-bottom: 60px; color: #16283A; }
.rs [hidden] { display: none !important; }
.rs-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rs-h h1 { margin: 0; font-size: 18px; color: #14532d; }
.rs-h .muted { font-size: 11.5px; }
.rs-warn { font-size: 11.5px; color: #92400e; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 9px; padding: 4px 10px; }
.rs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rs-card { text-align: right; font: inherit; color: inherit; background: #fff; border: 1px solid #E3E8E4; border-radius: 12px; padding: 8px 10px; cursor: pointer;
  display: grid; gap: 5px; align-content: start; box-shadow: 0 1px 2px #0000000a; transition: border-color .12s, box-shadow .12s, transform .12s; }
.rs-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px #0000002e; }
.rs-card.on { border-color: #14532d; box-shadow: 0 0 0 2px #14532d; }
.rc-h { display: flex; align-items: center; gap: 7px; }
.rc-n { width: 22px; height: 22px; border-radius: 50%; background: #E8F5EC; color: #14532d; display: grid; place-items: center; font-size: 12px; flex: none; }
.rs-card.on .rc-n { background: #14532d; color: #fff; }
.rc-t { font-weight: 800; font-size: 13px; }
.rc-ch { margin-right: auto; font-style: normal; font-size: 10px; font-weight: 800; color: #92400e; background: #FEF3C7; border-radius: 99px; padding: 1px 8px; }
.rc-d { font-size: 11px; color: #8FA3B3; }
.rc-bar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; gap: 1px; background: #EEF2EF; }
.rc-bar i { display: block; }
.rc-top { list-style: none; margin: 0; padding: 0; counter-reset: rt; display: grid; gap: 1px; }
.rc-top li { display: flex; gap: 6px; font-size: 11.5px; counter-increment: rt; white-space: nowrap; overflow: hidden; }
.rc-top li::before { content: counter(rt, persian); color: #8FA3B3; width: 12px; flex: none; }
.rc-top .t { font-weight: 700; flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
.rc-top .u { color: #5C7183; overflow: hidden; text-overflow: ellipsis; }
.rs-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10.5px; color: #5C7183; }
.rs-legend span { display: inline-flex; align-items: center; gap: 4px; }
.rs-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rs-pane { background: #fff; border: 1px solid #E3E8E4; border-radius: 12px; overflow: hidden; }
.rs-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 12px; border-bottom: 1px solid #E3E8E4; background: #F6F9F7; font-size: 13px; }
.rs-mix { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 10.5px; color: #5C7183; }
.rs-mix span { display: inline-flex; align-items: center; gap: 3px; }
.rs-mix i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rs-t { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.rs-t thead th { position: sticky; top: 58px; z-index: 2; background: #F6F9F7; color: #5C7183; font-size: 11px; font-weight: 700; text-align: right; padding: 5px 6px; border-bottom: 1px solid #CFD8D2; }
.rs-t td { padding: 3px 6px; height: 28px; border-bottom: 1px solid #F0F3F1; background: var(--dc, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-t th:nth-child(1) { width: 40px; } .rs-t th:nth-child(2) { width: 56px; } .rs-t th:nth-child(4) { width: 56px; }
.rs-t th:nth-child(6) { width: 76px; } .rs-t th:nth-child(7) { width: 100px; } .rs-t th:nth-child(8) { width: 84px; }
.rs-t td.n { color: #8FA3B3; font-size: 11px; text-align: center; }
.rs-t td.c { font-weight: 800; }
.rs-t td.t { font-weight: 600; }
.rs-t .love { color: #f59e0b; font-size: 10.5px; letter-spacing: -1px; margin-left: 5px; } .rs-t .love i { font-style: normal; color: #d8dcd9; }
.rs-t td.adm { font-weight: 800; font-size: 11.5px; } .rs-t td.adm.az { color: #14532d; } .rs-t td.adm.sv { color: #c2410c; }
.rs-t td.u .tz { color: #8FA3B3; font-size: 10.5px; }
.rs-t .dp { font-size: 11px; }
.rs-t .eh { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c); border-radius: 99px; padding: 1px 8px; }
.rs-more { padding: 6px 12px; margin: 0; font-size: 11px; }
@media (max-width: 1000px) { .rs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rs-cards { grid-template-columns: 1fr; } }
.rs-pane { overflow: visible; } .rs-t thead th:first-child { border-top-right-radius: 0; }

/* ================= قدم ۴ — نوار DNA چیدمان‌ها ================= */
.dn { display: grid; gap: 10px; padding-bottom: 64px; color: #16283A; }
.dn [hidden] { display: none !important; }
.dn-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-radius: 16px; color: #fff;
  background: radial-gradient(800px 240px at 88% -50%, rgba(134,239,172,.28), transparent 60%), linear-gradient(135deg, #14532d, #0b2e1a); box-shadow: 0 10px 28px -14px #0b2e1a; }
.dn-cap { font-size: 11px; font-weight: 700; color: #86efac; }
.dn-h h1 { margin: 2px 0 4px; font-size: 20px; color: #fff; }
.dn-h p { margin: 0; font-size: 12px; color: #bbf7d0; max-width: 640px; }
.dn-h p b { color: #fff; }
.dn-stat { text-align: center; flex: none; padding: 6px 18px; border-radius: 12px; background: #ffffff14; }
.dn-stat b { display: block; font-size: 26px; line-height: 1.1; }
.dn-stat span { font-size: 11px; color: #bbf7d0; }
.dn-warn { font-size: 12px; color: #92400e; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 10px; padding: 6px 12px; }
/* تخته */
.dn-board { position: relative; background: #fff; border: 1px solid #E3E8E4; border-radius: 14px; padding: 10px 12px 8px; box-shadow: 0 1px 2px #0000000a, 0 6px 18px -12px #0000002e; }
.dn-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dn-tl { font-size: 11.5px; font-weight: 800; color: #5C7183; }
.dn-seg { display: inline-flex; border: 1px solid #CFD8D2; border-radius: 9px; overflow: hidden; }
.dn-seg button { border: 0; background: #fff; font: inherit; font-size: 12px; padding: 0 12px; height: 28px; cursor: pointer; color: #16283A; }
.dn-seg button + button { border-right: 1px solid #CFD8D2; }
.dn-seg button.on { background: #14532d; color: #fff; font-weight: 700; }
.dn-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11px; color: #5C7183; }
.dn-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dn-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dn-rows { position: relative; display: grid; gap: 5px; }
.dn-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 8px; }
.dn-lab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: inherit; cursor: pointer; text-align: right; color: inherit; }
.dn-lab b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #E8F5EC; color: #14532d; font-size: 12px; flex: none; }
.dn-lab span { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-lab i { font-style: normal; font-size: 9.5px; font-weight: 800; color: #92400e; background: #FEF3C7; border-radius: 99px; padding: 0 6px; flex: none; }
.dn-row:hover .dn-lab { background: #F6F9F7; }
.dn-row.on .dn-lab { border-color: #14532d; background: #E8F5EC; }
.dn-row.on .dn-lab b { background: #14532d; color: #fff; }
.dn-strip { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); height: 30px; border-radius: 8px; overflow: hidden; background: #EEF2EF; cursor: crosshair; }
.dn-row.on .dn-strip { box-shadow: 0 0 0 2px #14532d; }
.dn-strip i { display: block; min-width: 0; border-left: 1px solid #ffffff55; transition: transform .08s; }
.dn-strip i.hi { background: #111 !important; transform: scaleY(1.35); box-shadow: 0 0 0 2px #fde047; position: relative; z-index: 2; border-radius: 2px; }
.dn-axis { display: flex; justify-content: space-between; margin-right: 198px; font-size: 10px; color: #8FA3B3; }
.dn-tip { position: absolute; z-index: 20; width: 300px; background: #0f2a1a; color: #fff; border-radius: 12px; padding: 9px 12px; box-shadow: 0 14px 30px -10px #000a; pointer-events: none; display: grid; gap: 2px; font-size: 11.5px; }
.dn-tip b { font-size: 13px; }
.dn-tip span { color: #d1fae5; } .dn-tip .m { color: #86efac; font-size: 11px; }
.dn-tip .ps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 5px; }
.dn-tip .ps span { background: #ffffff14; border-radius: 6px; text-align: center; padding: 2px 0; color: #fff; font-weight: 700; font-size: 11.5px; }
.dn-tip .ps span i { display: block; font-style: normal; font-size: 9px; color: #86efac; font-weight: 400; }
.dn-tip .ps span.on { background: #fde047; color: #0f2a1a; } .dn-tip .ps span.on i { color: #0f2a1a; }
/* جزئیات */
.dn-detail { background: #fff; border: 1px solid #E3E8E4; border-radius: 14px; overflow: visible; }
.dn-dh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 14px; background: #F6F9F7; border-bottom: 1px solid #E3E8E4; border-radius: 14px 14px 0 0; }
.dn-dh b { font-size: 14px; color: #14532d; }
.dn-desc { font-size: 11.5px; color: #8FA3B3; margin-right: 8px; }
.dn-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.dn-facts span { display: grid; background: #fff; border: 1px solid #E3E8E4; border-radius: 10px; padding: 3px 10px; }
.dn-facts i { font-style: normal; font-size: 10px; color: #8FA3B3; } .dn-facts b { font-size: 12.5px; color: #16283A; }
.dn-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.dn-t thead th { position: sticky; top: 58px; z-index: 3; background: #F6F9F7; color: #5C7183; font-size: 11px; font-weight: 700; text-align: right; padding: 5px 6px; border-bottom: 1px solid #CFD8D2; }
.dn-t th:nth-child(1) { width: 38px; } .dn-t th:nth-child(2) { width: 54px; } .dn-t th:nth-child(4) { width: 50px; } .dn-t th:nth-child(6) { width: 70px; }
.dn-t th:nth-child(7) { width: 92px; } .dn-t th:nth-child(8) { width: 78px; } .dn-t th:nth-child(9) { width: 200px; }
.dn-t td { padding: 3px 6px; height: 28px; border-bottom: 1px solid #F0F3F1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-t tr.dk-RZ td { background: #f5f9ff; } .dn-t tr.dk-N2 td { background: #f8f6ff; } .dn-t tr.dk-SH td, .dn-t tr.dk-PK td, .dn-t tr.dk-MJ td { background: #fff8f1; }
.dn-t tr.dk-GE td { background: #fffbeb; } .dn-t tr.dk-PN td { background: #f7f8f8; }
.dn-t tr:hover td { background: #E8F5EC; }
.dn-t td.n { color: #8FA3B3; text-align: center; font-size: 11px; } .dn-t td.c { font-weight: 800; } .dn-t td.t { font-weight: 600; }
.dn-t .lv { color: #f59e0b; font-size: 10.5px; letter-spacing: -1px; margin-left: 5px; } .dn-t .lv i { font-style: normal; color: #d8dcd9; }
.dn-t td.adm { font-weight: 800; font-size: 11.5px; } .dn-t td.adm.az { color: #14532d; } .dn-t td.adm.sv { color: #c2410c; }
.dn-t .tz { color: #8FA3B3; font-size: 10.5px; }
.dn-t .eh { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c); border-radius: 99px; padding: 1px 8px; }
.dn-t td.ot { display: flex; gap: 2px; align-items: center; height: 28px; box-sizing: border-box; }
.dn-t td.ot span { flex: 1; text-align: center; font-size: 10.5px; font-weight: 700; color: #5C7183; background: #F3F6F4; border-radius: 5px; line-height: 1.05; padding: 2px 0; }
.dn-t td.ot span i { display: block; font-style: normal; font-size: 8px; color: #8FA3B3; font-weight: 400; }
.dn-t td.ot span.up { background: #DCFCE7; color: #14532d; } .dn-t td.ot span.dn2 { background: #FEE2E2; color: #b91c1c; } .dn-t td.ot span.no { opacity: .4; }
@keyframes dnFlash { 0%, 50%, 100% { background: inherit; } 25%, 75% { background: #fde68a; } }
.dn-t tr.flash td { animation: dnFlash 1.6s ease-in-out; }
.dn-more { font-size: 11px; color: #8FA3B3; padding: 6px 14px; margin: 0; }
@media (max-width: 800px) { .dn-row { grid-template-columns: 1fr; } .dn-axis { margin-right: 0; } .dn-t th:nth-child(9), .dn-t td.ot { display: none; } }

/* ---- لیست نهایی: سربرگ هم‌خانواده + خط ظرفیت ۱۵۰ ---- */
.fn-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; margin-bottom: 10px; border-radius: 16px; color: #fff;
  background: radial-gradient(800px 240px at 88% -50%, rgba(134,239,172,.28), transparent 60%), linear-gradient(135deg, #14532d, #0b2e1a); box-shadow: 0 10px 28px -14px #0b2e1a; }
.fn-cap { font-size: 11px; font-weight: 700; color: #86efac; }
.fn-h h1 { margin: 2px 0 3px; font-size: 20px; color: #fff; }
.fn-h p { margin: 0; font-size: 12px; color: #bbf7d0; }
.fn-hr { display: flex; align-items: center; gap: 14px; flex: none; }
.fn-cnt { display: grid; text-align: center; padding: 6px 16px; border-radius: 12px; background: #ffffff14; }
.fn-cnt b { font-size: 24px; line-height: 1.1; }
.fn-cnt span { font-size: 11px; color: #bbf7d0; }
.fn-cnt i { font-style: normal; font-size: 10px; color: #86efac; }
.fn-cnt.over { background: #7f1d1d66; box-shadow: inset 0 0 0 1px #fca5a5; }
.fn-cnt.over span { color: #fecaca; font-weight: 700; }
.fn-btns { display: grid; gap: 6px; }
.fn-b { height: 30px; line-height: 30px; padding: 0 14px; border-radius: 9px; background: #ffffff1f; color: #fff; text-decoration: none; font: inherit; font-size: 12px; font-weight: 700; border: 0; cursor: pointer; text-align: center; }
.fn-b:hover { background: #ffffff33; } .fn-b.pr { background: #fff; color: #14532d; }
#ft tr.cap-line td { height: 26px; padding: 0 !important; background: #FEF2F2 !important; border-top: 2px solid #b91c1c; border-bottom: 2px solid #b91c1c; text-align: center; }
#ft tr.cap-line span { font-size: 11.5px; font-weight: 800; color: #b91c1c; }
#ft tr.over td { opacity: .5; }
#ft tr.over:hover td { opacity: .9; }
@media print { #ft tr.cap-line { display: none; } #ft tr.over td { opacity: 1; } }

.kn-nums-h { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #E3E8E4; font-size: 12px; font-weight: 800; color: #5C7183; }
.kn-nums-h span { font-weight: 400; color: #8FA3B3; font-size: 11px; }
.kn-nums-h + .kn-nums { margin-top: 6px; padding-top: 0; border-top: 0; }

/* ---- فهرست دانش‌آموزان: پروفایل ---- */
.st { background: #fff; border: 1px solid #E3E8E4; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.st [hidden] { display: none !important; }
.st-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; color: #fff; background: linear-gradient(135deg, #14532d, #0b2e1a); }
.st-cap { font-size: 11px; color: #86efac; font-weight: 700; }
.st-h h1 { margin: 0; font-size: 18px; color: #fff; }
.st-h h1 b { font-size: 13px; background: #ffffff22; border-radius: 99px; padding: 1px 9px; margin-right: 4px; }
.st-sum { display: flex; gap: 10px; font-size: 12px; color: #bbf7d0; } .st-sum b { color: #fff; font-size: 15px; }
.st-h input { margin-right: auto; width: 240px; height: 32px; border: 0; border-radius: 9px; padding: 0 12px; font: inherit; font-size: 13px; }
.st-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-t th { text-align: right; font-size: 11px; color: #5C7183; background: #F6F9F7; padding: 6px 10px; border-bottom: 1px solid #CFD8D2; }
.st-t td { padding: 5px 10px; border-bottom: 1px solid #F0F3F1; }
.st-t tr:hover td { background: #F6F9F7; }
.st-t td.nm a { font-weight: 700; color: #16283A; text-decoration: none; }
.st-t a.ok { display: inline-block; min-width: 44px; text-align: center; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px dashed #CFD8D2; color: #8FA3B3; text-decoration: none; }
.st-t a.ok.y { border: 1px solid #1b8a3a; background: #E8F5EC; color: #14532d; font-weight: 800; }
.st-t .pf { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: #EEF2EF; overflow: hidden; vertical-align: middle; }
.st-t .pf i { display: block; height: 100%; background: #f59e0b; } .st-t .pf.p3 i { background: #1b8a3a; }
.st-t .pft { font-size: 11px; color: #5C7183; margin-right: 6px; }
.st-go { font-size: 12px; font-weight: 700; color: #14532d; text-decoration: none; }

/* ---- ثبت سریع پروفایل ---- */
.qa { background: #fff; border: 1px solid #E3E8E4; border-radius: 14px; padding: 12px 16px; }
.qa header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.qa h2 { margin: 0; font-size: 15px; color: #14532d; }
.qa header span { font-size: 11.5px; color: #8FA3B3; }
.qa-x { margin-right: auto; font-size: 12.5px; font-weight: 800; color: #14532d; text-decoration: none; border: 1px solid #1b8a3a; border-radius: 99px; padding: 3px 12px; }
.qa-x:hover { background: #E8F5EC; }
.qa-f { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.qa-f label { display: grid; gap: 3px; margin: 0; }
.qa-f label span { font-size: 11.5px; font-weight: 700; color: #5C7183; }
.qa-f .w2 { grid-column: span 2; } .qa-f .w3 { grid-column: span 3; }
.qa-f input, .qa-f select { height: 34px; border: 1px solid #CFD8D2; border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; margin: 0; width: 100%; box-sizing: border-box; background: #fff; }
.qa-f input:focus, .qa-f select:focus { outline: none; border-color: #1b8a3a; box-shadow: 0 0 0 3px #1b8a3a26; }
.qa-b { grid-column: span 2; height: 38px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #1b8a3a, #14532d); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
@media (max-width: 900px) { .qa-f { grid-template-columns: repeat(2, 1fr); } .qa-f .w2, .qa-f .w3, .qa-b { grid-column: span 2; } }
/* ---- ورود گروهی پروفایل ---- */
.im { display: grid; gap: 10px; }
.im .st-h { border-radius: 14px; }
.im-back { margin-right: auto; color: #bbf7d0; text-decoration: none; font-size: 12.5px; font-weight: 700; }
.im-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.im-step { display: flex; gap: 10px; background: #fff; border: 1px solid #E3E8E4; border-radius: 14px; padding: 12px 14px; }
.im-step > b { width: 30px; height: 30px; border-radius: 50%; background: #14532d; color: #fff; display: grid; place-items: center; flex: none; }
.im-step h3 { margin: 2px 0 4px; font-size: 14px; color: #14532d; }
.im-step p { margin: 0 0 8px; font-size: 12px; color: #5C7183; line-height: 1.7; }
.im-btn { display: inline-block; height: 34px; line-height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: linear-gradient(135deg, #1b8a3a, #14532d); color: #fff; font: inherit; font-size: 12.5px; font-weight: 800; text-decoration: none; cursor: pointer; }
.im-btn.ghost { background: #fff; color: #14532d; border: 1px solid #1b8a3a; line-height: 32px; }
.im-up { display: grid; gap: 6px; } .im-up input { font-size: 12px; }
.im-sum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid #E3E8E4; border-radius: 12px; padding: 8px 14px; font-size: 12.5px; }
.im-sum .g b { color: #14532d; font-size: 16px; } .im-sum .r { color: #b91c1c; } .im-sum .r b { font-size: 16px; }
.im-act { margin-right: auto; display: flex; gap: 6px; }
.im-t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #E3E8E4; border-radius: 12px; font-size: 12px; }
.im-t th { background: #F6F9F7; color: #5C7183; font-size: 11px; text-align: right; padding: 6px 8px; border-bottom: 1px solid #CFD8D2; }
.im-t td { padding: 4px 8px; border-bottom: 1px solid #F0F3F1; }
.im-t td.n { color: #8FA3B3; } .im-t td.nm { font-weight: 700; }
.im-t td.st { font-size: 11.5px; color: #14532d; font-weight: 700; }
.im-t tr.bad td { background: #FEF2F2; } .im-t tr.bad td.st { color: #b91c1c; }
.im-t tr.warn td.st { color: #b45309; }
@media (max-width: 900px) { .im-steps { grid-template-columns: 1fr; } }

/* کارنامه: اطلاعات فردی */
.kn-pf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; }
.kn-pf label { display: grid; gap: 3px; margin: 0; }
.kn-pf label span { font-size: 11.5px; font-weight: 700; color: #5C7183; }
.kn-pf .w2 { grid-column: span 2; } .kn-pf .w6 { grid-column: span 6; }
.kn-pf .kn-in { width: 100%; box-sizing: border-box; }
.kn-note { height: auto !important; padding: 6px 10px !important; resize: vertical; font-size: 13px; line-height: 1.7; }
@media (max-width: 900px) { .kn-pf { grid-template-columns: repeat(2, 1fr); } .kn-pf .w6 { grid-column: span 2; } }

/* ---- رمز من ---- */
.pw { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid #E3E8E4; border-radius: 16px; padding: 20px 22px; box-shadow: 0 10px 28px -16px #0b2e1a55; }
.pw h1 { margin: 0 0 6px; font-size: 18px; color: #14532d; }
.pw-note { margin: 0 0 12px; font-size: 12.5px; color: #92400e; background: #FEF3C7; border-radius: 10px; padding: 8px 12px; }
.pw form { display: grid; gap: 10px; }
.pw label { display: grid; gap: 4px; margin: 0; } .pw label span { font-size: 12px; font-weight: 700; color: #5C7183; }
.pw input { height: 38px; border: 1px solid #CFD8D2; border-radius: 10px; padding: 0 12px; font: inherit; margin: 0; }
.pw input:focus { outline: none; border-color: #1b8a3a; box-shadow: 0 0 0 3px #1b8a3a26; }
.pw button { height: 40px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #1b8a3a, #14532d); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.topbar a.who { color: inherit; text-decoration: none; } .topbar a.who:hover { text-decoration: underline; }
.ar-tg { display: flex; gap: 4px; }
footer .build { color: #9aa89f; font-size: 11px; margin-right: 4px; }
