/* سامانه مدیریت پروژه و کار — آریا فناوران
   رنگ‌ها از آبی نشان شرکت گرفته شده‌اند؛ شکل حلقه‌ای (مقطع لوله) تنها عنصر تزئینی است. */
@font-face { font-family: "Vazirmatn FD"; src: url("fonts/Vazirmatn-UI-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("fonts/Vazirmatn-UI-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("fonts/Vazirmatn-UI-FD-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #17233a;
  --ink-2: #4c5a73;
  --ink-3: #7d899d;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --line: #dfe4ec;
  --line-2: #eef1f6;
  --brand: #3b62ae;
  --brand-ink: #2c4c8c;
  --brand-soft: #e8eefa;
  --deep: #14233f;
  --deep-2: #1d3157;
  --ok: #1d7a5a; --ok-soft: #e2f3ec;
  --warn: #9a6400; --warn-soft: #fcf0d6;
  --bad: #b33a35; --bad-soft: #fbe6e4;
  --series: #2a78d6;
  --series-prev: #c3c9d4;
  --r: 10px;
  --shadow: 0 1px 2px rgba(23, 35, 58, .06), 0 4px 14px rgba(23, 35, 58, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font-family: "Vazirmatn FD", Tahoma, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.75; color: var(--ink); background: var(--paper); }
h1, h2, h3 { line-height: 1.4; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; right: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { right: 8px; }
.ic { flex: none; }

/* ---------- چارچوب ---------- */
body.app { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--deep); color: #cfd8ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { background: #fff; border-radius: 50%; }
.brand b { display: block; font-size: 15px; }
.brand small { color: #9fb0cf; }
.side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; }
.side nav a, .side-foot a, .side-foot button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #cfd8ea; font: inherit; font-size: 14.5px; background: none; border: 0; cursor: pointer; width: 100%; text-align: right; }
.side nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--deep-2); text-decoration: none; color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; font-weight: 500; }
.side-foot { padding: 10px; border-top: 1px solid #2a3f68; }
.side-foot form { margin: 0; }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 19px; font-weight: 700; flex: 1; }
.who { text-align: left; line-height: 1.35; }
.who b { display: block; font-size: 14px; font-weight: 500; }
.who small { color: var(--ink-3); }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
.main { padding: 22px 28px 60px; max-width: 1180px; width: 100%; }
.main.wide { max-width: 1400px; }
.tabbar { display: none; }

/* ---------- اجزا ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 460px; }
.card > h2 small { font-weight: 400; color: var(--ink-3); margin-inline-start: 6px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split > * { min-width: 0; }
.grid > * { min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 40px; }
.btn:hover { border-color: #c5cddb; text-decoration: none; background: #fafbfd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: #e7c1be; }
.btn.small { padding: 5px 10px; min-height: 34px; font-size: 13px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--brand-ink); cursor: pointer; }
.link.danger, a.danger { color: var(--bad); }
.mini { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); min-height: 30px; }
.mini:hover { border-color: var(--brand); color: var(--brand-ink); }
.mini.danger { color: var(--bad); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--brand-soft); color: var(--brand-ink); }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); border-color: #bfe3d3; color: #14543e; }
.alert.err { background: var(--bad-soft); border-color: #efc4c1; color: #8a2a26; }
.alert.info { background: var(--brand-soft); border-color: #c9d7f1; color: var(--brand-ink); }
.alert.warn { background: var(--warn-soft); border-color: #efd9a4; color: #6f4800; }
.empty { text-align: center; padding: 36px 16px; background: var(--surface); border: 1px dashed #cdd5e2; border-radius: var(--r); color: var(--ink-2); }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.summary-line { color: var(--ink-2); margin: 8px 0 12px; }
.plain-list { margin: 0 0 10px; padding: 0 18px 0 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.kv dt { color: var(--ink-3); font-size: 13.5px; }
dl.kv dd { margin: 0; }

/* ---------- فرم ---------- */
.f { margin-bottom: 14px; }
.f label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.f small { color: var(--ink-3); display: block; margin-top: 2px; }
input[type=text], input[type=password], input[type=search], input[type=tel], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; min-height: 42px; }
textarea { min-height: 76px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); outline-offset: 0; }
input[dir=ltr] { text-align: right; }
.req { color: var(--bad); font-style: normal; }
.ferr { color: var(--bad); font-size: 13.5px; margin: -8px 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.date-in { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.date-in input { margin-top: 0; flex: 1; min-width: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: 13px; color: var(--ink-3); }
.filter-select { margin-bottom: 4px; }
fieldset.chips { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.chips legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
fieldset.chips > div { display: flex; flex-wrap: wrap; gap: 7px; }
fieldset.chips label { position: relative; cursor: pointer; }
fieldset.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
fieldset.chips span { display: inline-block; padding: 6px 13px; border: 1px solid #cfd6e2; border-radius: 999px; background: #fff; font-size: 14px; min-height: 38px; line-height: 24px; user-select: none; }
fieldset.chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
fieldset.chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
fieldset.chips small { color: var(--ink-3); display: block; margin-top: 4px; }
details.more { border-top: 1px solid var(--line); padding: 10px 0 2px; }
details.more > summary { cursor: pointer; font-weight: 500; color: var(--brand-ink); padding: 4px 0 10px; }
details.more > summary small { color: var(--ink-3); font-weight: 400; }
.form-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.rep-row { display: grid; grid-template-columns: 150px 1.4fr 1fr 1fr 1.2fr 34px; gap: 6px; margin-bottom: 8px; align-items: center; }
.rep-row input, .rep-row select { margin-top: 0; }
.draft-note { background: var(--warn-soft); border: 1px solid #efd9a4; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.money-hint { color: var(--ink-3); font-size: 12.5px; }
[hidden] { display: none !important; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }

/* ---------- فیلتر و دوره ---------- */
.period { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg a { padding: 5px 13px; border-radius: 6px; color: var(--ink-2); font-size: 14px; }
.seg a:hover { text-decoration: none; background: var(--line-2); }
.seg a.on { background: var(--deep); color: #fff; font-weight: 500; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper a { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 18px; color: var(--ink-2); }
.stepper a:hover { text-decoration: none; border-color: var(--brand); }
.stepper b { padding: 0 8px; font-size: 15px; }
.custom-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin-inline-start: auto; }
.custom-range label { display: flex; align-items: center; gap: 6px; }
.custom-range input { width: 112px; margin: 0; min-height: 34px; padding: 4px 8px; font-size: 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 4px; margin-bottom: 12px; align-items: end; }
.filters .f { margin-bottom: 10px; }
.filters input, .filters select { min-height: 38px; padding: 6px 9px; font-size: 14px; }
.f-actions { display: flex; gap: 6px; margin-bottom: 10px; }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-weight: 500; color: var(--ink-2); font-size: 13px; padding: 10px 12px; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th[data-sort-col] { cursor: pointer; user-select: none; }
.tbl th[aria-sort=ascending]::after { content: " ▲"; font-size: 10px; }
.tbl th[aria-sort=descending]::after { content: " ▼"; font-size: 10px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfe; }
.tbl th.num, .tbl td.num { text-align: left; }
.tbl td.note { max-width: 340px; color: var(--ink-2); font-size: 13.5px; }
.tbl tfoot td { font-weight: 700; background: #f8f9fc; border-top: 1px solid var(--line); }
.row-actions { white-space: nowrap; font-size: 13px; }
.row-actions form { display: inline; margin: 0 6px 0 0; }
.row-actions a { margin-left: 6px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; color: var(--ink-2); font-size: 14px; }
.pager a { border: 1px solid var(--line); background: var(--surface); padding: 5px 14px; border-radius: 8px; }

td.heat.l1 { background: #eef4fc; } td.heat.l2 { background: #d7e6f8; } td.heat.l3 { background: #b6d1f2; } td.heat.l4 { background: #8fb9ea; }
td.heat a { color: var(--ink); }

/* ---------- کاشی‌های شاخص ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; display: flex; flex-direction: column; gap: 1px; color: var(--ink); box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile > span { font-size: 13px; color: var(--ink-2); }
.tile > b { font-size: 25px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
.tile > b small { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.tile > small { color: var(--ink-3); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--ink-3); }
.tile.alarm { border-color: #e7c1be; background: #fffafa; }
.tile.alarm > b { color: var(--bad); }

/* ---------- نمودارها ---------- */
.chart { margin: 0; }
.chart-scroll { overflow-x: auto; direction: rtl; }
.chart svg { display: block; max-width: none; }
.chart svg.fit { width: 100%; height: auto; min-width: 400px; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .tick, .chart .xl { font-size: 10.5px; fill: var(--ink-3); font-family: inherit; }
.chart .val { font-size: 11px; fill: var(--ink); font-weight: 700; font-family: inherit; }
.chart .col { fill: var(--series); }
.chart .col.prev { fill: var(--series-prev); }
.chart .hit { fill: transparent; }
.chart a:hover .col, .chart g:hover .col { fill: #1f5fb0; }
.chart a:hover .col.prev, .chart g:hover .col.prev { fill: #a9b1bf; }
.chart a:hover .hit, .chart g:hover .hit { fill: rgba(42, 120, 214, .07); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.sw.cur { background: var(--series); } .sw.prev { background: var(--series-prev); }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li > a, .hbars li > div { display: grid; grid-template-columns: minmax(110px, 42%) 1fr max-content; gap: 10px; align-items: center; padding: 5px 4px; border-radius: 6px; color: var(--ink); }
.hbars li > a:hover { background: var(--brand-soft); text-decoration: none; }
.hb-l { font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
.hb-l small { color: var(--ink-3); margin-inline-start: 6px; }
.hb-t { background: var(--line-2); height: 10px; border-radius: 5px; overflow: hidden; display: block; }
.hb-t i { display: block; height: 100%; background: var(--series); border-radius: 5px; min-width: 2px; }
.hb-v { font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hb-v small { color: var(--ink-3); font-weight: 400; }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut svg { flex: none; }
.s1 { --c: #2a78d6; } .s2 { --c: #eb6834; } .s3 { --c: #1baf7a; } .s4 { --c: #eda100; } .s5 { --c: #9aa3b2; }
.donut circle.seg { stroke: var(--c); }
.sw.s1, .sw.s2, .sw.s3, .sw.s4, .sw.s5 { background: var(--c); }
.donut-n { font-size: 20px; font-weight: 700; fill: var(--ink); font-family: inherit; }
.donut-u { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; font-size: 13.5px; }
.donut-legend li > a, .donut-legend li > div { display: grid; grid-template-columns: 16px 1fr max-content 38px; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 6px; color: var(--ink); }
.donut-legend li > a:hover { background: var(--brand-soft); text-decoration: none; }
.donut-legend small { color: var(--ink-3); text-align: left; }
.cal-wrap { display: flex; flex-wrap: wrap; gap: 18px; }
table.cal { border-collapse: separate; border-spacing: 3px; }
.cal caption { font-size: 13px; font-weight: 500; text-align: right; padding-bottom: 2px; color: var(--ink-2); }
.cal th { font-size: 11px; font-weight: 400; color: var(--ink-3); padding: 0; }
.cal td { padding: 0; }
.c { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; font-size: 12px; background: var(--line-2); color: var(--ink-3); }
.c.l1 { background: #cfe1f7; color: var(--ink); } .c.l2 { background: #93bdec; color: var(--ink); } .c.l3 { background: #4b8fdc; color: #fff; } .c.l4 { background: #1c5db3; color: #fff; }
.c.out { opacity: .35; }
.cal a:hover .c { outline: 2px solid var(--ink); }
.cal-legend i.c { width: 14px; height: 14px; border-radius: 4px; }
.meter { background: var(--line-2); height: 8px; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--series); border-radius: 4px; }
.meter.over i { background: var(--bad); }
.tip { position: fixed; z-index: 100; background: var(--deep); color: #fff; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; pointer-events: none; max-width: 260px; }
.stars { color: #e0a100; letter-spacing: 1px; white-space: nowrap; }
.stars i { color: #d8dde6; font-style: normal; }

/* ---------- مراحل پروژه: حلقه‌های لوله ---------- */
.stages { display: flex; gap: 0; margin: 4px 0 6px; overflow-x: auto; padding-bottom: 4px; }
.stage { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 12.5px; color: var(--ink-3); padding-top: 34px; }
.stage::before { content: ""; position: absolute; top: 4px; right: 50%; margin-right: -11px; width: 22px; height: 22px; border-radius: 50%; border: 5px solid #d3dae6; background: var(--surface); box-sizing: border-box; z-index: 1; }
.stage::after { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 4px; background: #d3dae6; }
.stage:last-child::after { display: none; }
.stage.done { color: var(--ink); }
.stage.done::before { border-color: var(--brand); }
.stage.done::after { background: var(--brand); }
.stage.now { color: var(--brand-ink); font-weight: 700; }
.stage.now::before { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stage small { display: block; color: var(--ink-3); font-weight: 400; }

/* ---------- ستون کناری فرم ---------- */
.mini-logs, .tpl { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.mini-logs li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.total { margin: 10px 0 0; }
.tpl li a { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; color: var(--ink); }
.tpl li a:hover { border-color: var(--brand); text-decoration: none; }
.tpl small { display: block; color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 14px 8px 0; border-right: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; right: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline time { color: var(--ink-3); font-size: 12.5px; display: block; }

/* ---------- صفحه‌های مستقل (ورود، خطا، نظرسنجی) ---------- */
body.plain { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #14233f 0 38%, var(--paper) 38%); }
.center-card { background: var(--surface); border-radius: 14px; padding: 28px 26px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(20, 35, 63, .18); text-align: center; }
.center-card h1 { font-size: 19px; margin: 10px 0 4px; }
.center-card form { text-align: right; margin-top: 16px; }
.center-card.survey { max-width: 520px; text-align: right; }
.center-card.survey header { text-align: center; margin-bottom: 14px; }
.rate { border: 0; padding: 0; margin: 0 0 18px; }
.rate legend { font-weight: 500; margin-bottom: 4px; padding: 0; }
.rate .opt { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.rate-stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; direction: ltr; }
.rate-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-stars label { font-size: 38px; line-height: 1; color: #d5dbe5; cursor: pointer; padding: 2px 3px; }
.rate-stars input:checked ~ label, .rate-stars label:hover, .rate-stars label:hover ~ label { color: #e8a800; }
.rate-stars input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 6px; }
.rate-scale { display: flex; justify-content: space-between; max-width: 238px; font-size: 12px; color: var(--ink-3); direction: rtl; }

/* ---------- موبایل ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body.app { display: block; padding-bottom: 68px; }
  .side { position: fixed; top: 0; bottom: 0; right: 0; z-index: 60; transform: translateX(105%); visibility: hidden; transition: transform .18s ease, visibility 0s .18s; width: 264px; height: 100%; }
  .side.open { transform: none; visibility: visible; transition: transform .18s ease; box-shadow: -20px 0 60px rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 16.5px; }
  .who small { display: none; }
  .main { padding: 14px 12px 30px; }
  .g2, .g3, .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .shell { min-width: 0; overflow-x: clip; }
  .row2 { gap: 0; }
  .card { padding: 14px; }
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 40; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--ink-2); padding: 5px 2px; border-radius: 8px; }
  .tabbar a.main-tab { color: #fff; background: var(--brand); margin: -14px 4px 0; border-radius: 14px; padding: 9px 2px 6px; box-shadow: 0 4px 12px rgba(59, 98, 174, .4); }
  .tabbar a:hover { text-decoration: none; }
  .custom-range { margin-inline-start: 0; width: 100%; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 10px 2px; }
  .filters .f-actions { grid-column: 1 / -1; }
  .filter-toggle { margin-bottom: 12px; }
  .seg { overflow-x: auto; max-width: 100%; }
  .seg a { white-space: nowrap; }
  .rep-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile > b { font-size: 21px; }
  .form-foot .btn { flex: 1; }
  /* جدول‌ها در موبایل به کارت تبدیل می‌شوند */
  table.tbl.cards thead { display: none; }
  table.tbl.cards, table.tbl.cards tbody, table.tbl.cards tr, table.tbl.cards td { display: block; width: 100%; }
  table.tbl.cards tr { border-bottom: 6px solid var(--paper); padding: 6px 0; }
  table.tbl.cards td { border: 0; padding: 3px 12px; text-align: right; }
  table.tbl.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 12.5px; }
  .c { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- چاپ / خروجی PDF ---------- */
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body, body.app { background: #fff; display: block; font-size: 11.5px; padding: 0; }
  .side, .top, .tabbar, .no-print, .actions, .pager, .row-actions, .tip, .skip { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card, .table-wrap, .tile { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .table-wrap { overflow: visible; border: 0; }
  .tbl th, .tbl td { padding: 4px 6px; border: 1px solid #bbb; }
  .tbl thead { display: table-header-group; }
  .tbl tr { break-inside: avoid; }
  .tbl td.note { max-width: none; }
  .hb-l { -webkit-line-clamp: 3; }
  .hbars li > a, .hbars li > div { grid-template-columns: 46% 1fr max-content; }
  .print-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #17233a; padding-bottom: 8px; margin-bottom: 12px; }
  .print-head img { width: 48px; height: 48px; }
  .print-head b { font-size: 15px; display: block; }
  .chart .col, .hb-t i, .meter i, .c, .badge, .sw, .donut circle.seg, td.heat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .grid.g2, .grid.g3 { grid-template-columns: 1fr 1fr; }
  details.more { display: block; }
}

/* بینش‌های کوتاه بالای جدول مقایسه */
ul.insights { margin: 0 0 12px; padding: 0 18px 0 0; color: var(--ink-2); font-size: 14px; }
ul.insights li { margin-bottom: 3px; }
td.delta.up { color: var(--ok); } td.delta.down { color: var(--bad); }
