/* نیروکاو (Nirokav) — داشبورد پایش نیروگاه. رنگ‌های برند: سرمه‌ای #002b5b، فیروزه‌ای #01adae. توکن‌ها در :root؛ حالت تاریک خودکار.
   فونت: اگر وزیرمتن روی سیستم نصب باشد استفاده می‌شود، وگرنه فونت سیستم. */
@font-face { font-family: "Vazirmatn"; src: local("Vazirmatn"), local("Vazirmatn UI"); font-display: swap; }

:root {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f5f7fb; --ink: #0f1e3c; --ink-2: #4a5873; --line: #dde3ee;
  --out: #008089; --out-soft: #d3f1f0; --sun: #c98a00; --sun-soft: #fbefcf; --exp: #6b7a99;
  --crit: #c8321f; --crit-soft: #fbe3df; --warn: #8f5400; --warn-soft: #fcebc8; --idle: #5b6b8c; --idle-soft: #e4e9f2;
  --side: #00244d; --side-ink: #cfdcf0; --side-dim: #86a0c6; --side-line: #0f3d73; --accent: #20c4be;
  --font: "Vazirmatn", "IRANSansX", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  --gap: clamp(14px, 2vw, 24px);
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgb(15 30 60 / .05), 0 6px 20px -8px rgb(15 30 60 / .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09111f; --surface: #111c33; --surface-2: #16233f; --ink: #e6ecf8; --ink-2: #9aa9c6; --line: #24324f;
    --out: #2cc9c4; --out-soft: #0d3b40; --sun: #f4b73c; --sun-soft: #3b2d0c; --exp: #8696b8;
    --crit: #ff7a66; --crit-soft: #3a1a1a; --warn: #f4b73c; --warn-soft: #3b2d0c; --idle: #8fa0c4; --idle-soft: #1c2944;
    --side: #001833; --side-line: #0d2f5a; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.8 var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--out); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.unit { font-size: .74em; color: var(--ink-2); margin-right: .4em; font-weight: 400; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hint { color: var(--ink-2); font-size: 13px; }

/* ---------- قاب اصلی: منوی کناری + صحنه ---------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-logo { width: 44px; height: auto; flex: none; }
.brand-text b { display: block; font-size: 18px; color: #fff; line-height: 1.4; }
.brand-text small { color: var(--side-dim); font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-sm); text-decoration: none; color: var(--side-ink); position: relative; transition: background .15s; }
.nav a:hover { background: var(--side-line); }
.nav a[aria-current="page"] { background: #16264a; color: #fff; font-weight: 700; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline-end: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 4px 0 0 4px; background: var(--accent); }
.nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.badge { margin-inline-start: auto; font-style: normal; font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; padding: 0 7px; border-radius: 999px; background: var(--crit); color: #fff; line-height: 22px; }
.badge[data-level="warn"] { background: #ffb938; color: #3a2400; }
.side-note { margin-top: auto; font-size: 12.5px; line-height: 1.8; color: var(--side-dim); border: 1px dashed var(--side-line); border-radius: var(--r-sm); padding: 10px 12px; }

.stage { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px var(--gap); flex-wrap: wrap; padding: 16px var(--gap); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.top-title { font-size: 19px; font-weight: 700; }
.top-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-tools select { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; max-width: 260px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: 13.5px; color: var(--ink-2); box-shadow: var(--shadow); }
.pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clock { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--out); box-shadow: 0 0 0 0 color-mix(in srgb, var(--out) 55%, transparent); animation: beat 2.4s ease-out infinite; }
.conn[data-ok="false"] { background: var(--crit-soft); color: var(--crit); }
.conn[data-ok="false"]::before { background: var(--crit); animation: none; }
.conn[data-stale="true"] { background: var(--warn-soft); color: var(--warn); }
.conn[data-stale="true"]::before { background: var(--sun); animation: none; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--out) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

main { padding: 6px var(--gap) calc(var(--gap) * 1.6); display: grid; gap: var(--gap); max-width: 1380px; width: 100%; margin-inline: auto; }
.page { display: grid; gap: var(--gap); align-content: start; }

/* ---------- کارت ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px 20px; box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card > header > div:not(.tabs) { min-width: 0; flex: 1 1 auto; }
.card h3 { font-size: 16px; font-weight: 700; line-height: 1.5; }
.card header p { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.ic { width: 38px; height: 38px; border-radius: 12px; background: var(--out-soft); color: var(--out); display: grid; place-items: center; flex: none; }
.ic.amber { background: var(--sun-soft); color: var(--sun); }
.ic.red { background: var(--crit-soft); color: var(--crit); }
.ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.more { font-size: 13px; color: var(--out); text-decoration: none; font-weight: 600; }
.more:hover { text-decoration: underline; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--gap); align-items: stretch; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.grid-charts { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin-inline-start: auto; }
.tabs button { background: none; border: 0; padding: 3px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }

/* ---------- بنر نمای کلی ---------- */
.banner { position: relative; overflow: hidden; border-radius: 26px; background: linear-gradient(120deg, #0c1a38 0%, #14305f 55%, #1a4a78 100%); color: #fff; min-height: 170px; box-shadow: var(--shadow); }
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgb(12 26 56 / .9) 12%, rgb(12 26 56 / .15) 75%); }
.banner-body { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 26px 28px; height: 100%; min-height: 170px; }
.eyebrow-less { color: #9fc2ff; font-size: 13.5px; }
.banner h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; line-height: 1.5; letter-spacing: -.01em; }
.banner-line { color: #d6e2ff; font-size: 14.5px; max-width: 60ch; }
.banner-side { display: grid; gap: 6px; justify-items: end; }
.banner-side small { color: #9fc2ff; font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; background: #1f8f7b; color: #fff; }
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.banner[data-level="warn"] .chip { background: #e9a21a; color: #2e1d00; }
.banner[data-level="crit"] .chip { background: #d8402c; }
.banner[data-level="idle"] .chip { background: #3d5282; }

/* ---------- کاشی‌ها ---------- */
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { border-radius: var(--r-md); padding: 12px 14px 12px; display: grid; gap: 1px; align-content: start; background: var(--surface-2); position: relative; min-width: 0; }
.tile .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); margin-bottom: 6px; }
.tile .ti svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .tl { font-size: 12.5px; color: var(--ink-2); }
.tile .tv { font-size: 22px; font-weight: 700; line-height: 1.4; }
.tile small { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.tile[data-tone="out"] { background: var(--out-soft); } .tile[data-tone="out"] .ti { color: var(--out); }
.tile[data-tone="sun"] { background: var(--sun-soft); } .tile[data-tone="sun"] .ti { color: var(--sun); }
.tile[data-tone="crit"] { background: var(--crit-soft); } .tile[data-tone="crit"] .ti { color: var(--crit); }
.tile[data-tone="idle"] { background: var(--idle-soft); } .tile[data-tone="idle"] .ti { color: var(--idle); }
.tile small.bad { color: var(--warn); font-weight: 600; }

.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); font-size: 14px; }
.kv dd { font-weight: 600; text-align: end; }

/* ---------- سلامت آرایه ---------- */
.health { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; }
.ring .trk { stroke: var(--line); }
.ring .val { stroke: var(--out); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring[data-tone="crit"] .val { stroke: var(--crit); } .ring[data-tone="warn"] .val { stroke: var(--sun); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.3; }
.ring .mid b { font-size: 28px; }
.ring .mid small { color: var(--ink-2); font-size: 12px; }
.health-kv { display: grid; gap: 8px; flex: 1 1 180px; }
.health-kv > div { display: flex; align-items: center; gap: 10px; }
.health-kv dt { color: var(--ink-2); flex: 1; display: flex; align-items: center; gap: 8px; }
.health-kv dt::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--idle)); }
.health-kv dd { font-weight: 700; }

.mini-alarms li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.mini-alarms li:last-child { border-bottom: 0; }
.mini-alarms .sv { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; grid-row: span 2; }
.mini-alarms .sv svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mini-alarms .critical .sv { background: var(--crit-soft); color: var(--crit); }
.mini-alarms .warning .sv { background: var(--warn-soft); color: var(--warn); }
.mini-alarms b { font-size: 14px; font-weight: 600; line-height: 1.7; }
.mini-alarms small { color: var(--ink-2); font-size: 12.5px; }
.mini-alarms .none { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 14px 0 4px; grid-template-columns: none; border: 0; }
.mini-alarms .none svg { width: 22px; height: 22px; stroke: var(--out); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- گیج ---------- */
.gauge { position: relative; max-width: 360px; margin-inline: auto; }
.gauge svg { width: 100%; height: auto; overflow: visible; direction: ltr; }
.gauge .trk { stroke: var(--line); }
.gauge .val { stroke: var(--out); transition: stroke-dasharray .8s ease; }
.gauge .tick { stroke: var(--ink-2); stroke-width: 1.2; opacity: .5; }
.gauge text { font-family: var(--font); fill: var(--ink-2); font-size: 11px; }
.gauge .mid { position: absolute; inset-inline: 0; bottom: 4px; text-align: center; line-height: 1.35; }
.gauge .mid b { font-size: clamp(34px, 5vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.gauge .mid b .unit { font-size: .38em; font-weight: 500; }
.gauge .mid small { display: block; color: var(--ink-2); font-size: 13px; }
.bars { display: grid; gap: 14px; margin-top: 18px; }
.bar-row .top-line { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.bar-row .top-line span:first-child { color: var(--ink-2); }
.bar-row .top-line b { font-weight: 700; }
.bar-row .track { height: 9px; border-radius: 9px; background: var(--line); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 9px; background: var(--out); transition: width .6s ease; }
.bar-row .track i.sun { background: var(--sun); }
.bar-row .track i.ink { background: var(--exp); }

/* ---------- نمودارها ---------- */
.chart { position: relative; min-height: 240px; }
.chart svg { display: block; direction: ltr; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 11.5px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .cap { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.chart .area { fill: var(--out); opacity: .16; }
.chart .l-act { fill: none; stroke: var(--out); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .l-exp { fill: none; stroke: var(--exp); stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .l-sun { fill: none; stroke: var(--sun); stroke-width: 1.5; opacity: .95; }
.chart .bar-d { fill: var(--out); }
.chart .bar-d.partial { fill: var(--out); opacity: .45; }
.chart .cursor { stroke: var(--ink); stroke-width: 1; opacity: .45; }
.chart .dot { fill: var(--out); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; line-height: 1.7; white-space: nowrap; z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-inline-end: 6px; }
.legend .l-act { border-color: var(--out); border-top-width: 3px; }
.legend .l-exp { border-color: var(--exp); border-top-style: dashed; }
.legend .l-sun { border-color: var(--sun); }
.empty { padding: 40px 0; text-align: center; color: var(--ink-2); }

/* ---------- تاریخچه: انتخاب روز ---------- */
.datebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.datebar select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.btn.icon { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 12px; }
.live-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--out); background: var(--out-soft); padding: 2px 12px; border-radius: 999px; margin-inline-start: auto; }
.live-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--out); animation: beat 2.4s ease-out infinite; }
.tiles5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles5 .tile .tv { font-size: 19px; }
.chart .bar-d.sel { stroke: var(--ink); stroke-width: 2; }
.chart .bar-hit { cursor: pointer; fill: transparent; }
.chart .bar-hit:hover + .bar-d, .chart .bar-d:hover { opacity: .8; }

/* ---------- آرایه و جدول اینورترها ---------- */
.cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.cell { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); min-width: 0; padding: 0; cursor: pointer; text-align: start; }
.cell .pv { position: relative; height: 50px; background:
    linear-gradient(90deg, transparent 49.2%, color-mix(in srgb, var(--ink-2) 35%, transparent) 49.2%, color-mix(in srgb, var(--ink-2) 35%, transparent) 50.8%, transparent 50.8%),
    linear-gradient(0deg, transparent 32%, var(--line) 32%, var(--line) 34%, transparent 34%, transparent 65%, var(--line) 65%, var(--line) 67%, transparent 67%);
  background-color: var(--surface); }
.cell .fill { position: absolute; inset-inline: 0; bottom: 0; background: var(--out); opacity: .55; transition: height .6s ease; }
.cell.derating .fill { background: var(--sun); opacity: .7; }
.cell.fault .pv, .cell.offline .pv { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, currentColor 35%, transparent) 6px 8px); }
.cell.fault { color: var(--crit); border-color: var(--crit); }
.cell.offline { color: var(--idle); border-style: dashed; border-color: var(--idle); }
.cell.derating { border-color: var(--sun); }
.cell .cap { display: flex; justify-content: space-between; gap: 4px; padding: 4px 8px 5px; font-size: 12.5px; color: var(--ink); }
.cell .cap b { font-weight: 700; }
.cell .cap span { color: var(--ink-2); }
.cell.fault .cap span, .cell.fault .cap b, .cell.offline .cap span { color: inherit; }
.tbl-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { font-weight: 600; font-size: 13px; color: var(--ink-2); text-align: start; padding: 4px 10px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.n, th.n { text-align: end; }
tr.fault td, tr.offline td { background: var(--crit-soft); }
tr.derating td { background: var(--warn-soft); }
.st { display: inline-flex; align-items: center; gap: 7px; }
.st::before { content: ""; width: 9px; height: 9px; background: var(--out); border-radius: 50%; flex: none; }
.st.derating::before { background: var(--sun); border-radius: 2px; transform: rotate(45deg); }
.st.fault::before { background: var(--crit); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st.offline::before { background: transparent; border: 2px solid var(--idle); }
.st.standby::before, .st.sleep::before { background: var(--idle); opacity: .6; }
.mini { display: inline-block; width: 56px; height: 6px; background: var(--line); border-radius: 3px; vertical-align: middle; margin-inline-start: 8px; overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--out); }

/* ---------- هشدارها ---------- */
.alist li { padding: 14px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 2px; }
.alist li:last-child { border-bottom: 0; }
.alist li.closed { opacity: .62; }
.sev { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.sev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sev.critical { color: var(--crit); } .sev.warning { color: var(--warn); }
.alist .msg { font-size: 14.5px; line-height: 1.8; }
.alist .meta { color: var(--ink-2); font-size: 12.5px; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; }
.btn { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 14px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--ink-2); }
.ok-empty { color: var(--ink-2); padding: 18px 0 6px; }
.demo summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.demo summary::after { content: "▾"; margin-inline-start: auto; color: var(--ink-2); }
.demo[open] summary::after { content: "▴"; }
.demo .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.demo select { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.demo .hint { margin-top: 10px; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1180px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: span 2; } .grid-charts { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 0; border-top: 1px solid var(--side-line); }
  .brand, .side-note { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 2px; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11.5px; text-align: center; }
  .nav a[aria-current="page"]::after { inset: 0 28% auto 28%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .badge { position: absolute; top: 2px; inset-inline-start: 50%; margin: 0; transform: translateX(-30%); line-height: 18px; min-width: 18px; font-size: 11px; padding: 0 5px; }
  main { padding-bottom: 96px; }
  .grid2, .grid-dash { grid-template-columns: 1fr; }
  .cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid3 { grid-template-columns: 1fr; } .grid3 > :first-child { grid-column: auto; }
  .tiles3 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px 14px 16px; }
  .banner-body { padding: 20px 18px; }
  .banner-side { justify-items: start; }
  .pill { font-size: 12.5px; padding: 4px 10px; }
}
@media (prefers-reduced-motion: reduce) { .cell .fill, .ring .val, .gauge .val, .bar-row .track i { transition: none; } .conn::before { animation: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; min-width: 38px; padding: 3px 10px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.chips button[aria-pressed="true"] { background: var(--out); border-color: var(--out); color: #fff; font-weight: 700; }
.chart .ln { fill: none; stroke: var(--exp); stroke-width: 1.2; opacity: .45; }
.chart .ln.sel { stroke: var(--out); stroke-width: 2.6; opacity: 1; }
.chart .ln.dim { opacity: .18; }
tr.pick td { background: var(--out-soft); }
.cell.pick { outline: 2px solid var(--out); outline-offset: 2px; }

/* ---------- ورود ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 50;
  background: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--side); }
.login[hidden], .shell[hidden] { display: none; }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 28px 26px; display: grid; gap: 14px; box-shadow: 0 20px 60px -20px rgb(0 0 0 / .5); }
.login-card h2 { font-size: 18px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=password], input:not([type]), input[type=search] { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; min-width: 0; }
input:focus-visible { outline: 2px solid var(--out); outline-offset: 1px; }
.login-err { color: var(--crit); background: var(--crit-soft); border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px; }
.login-note { font-size: 12px; color: var(--ink-2); }
.btn.primary { background: var(--out); border-color: var(--out); color: #fff; font-weight: 700; padding: 6px 18px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; margin-top: 14px; padding: 8px 14px; }
.btn.danger { color: var(--crit); }
.btn:disabled { opacity: .5; cursor: default; }
.pill.acct { cursor: pointer; font: inherit; }
.pill.acct svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 700px) { #acct-name { display: none; } }
.acct-dlg { border: 0; border-radius: var(--r-lg); padding: 22px; width: min(400px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px -20px rgb(0 0 0 / .5); }
.acct-dlg::backdrop { background: rgb(5 12 28 / .55); }
.acct-dlg form { display: grid; gap: 12px; }
.frow-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- نمای ناوگان ---------- */
.fleet-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
.fleet-side { display: grid; gap: var(--gap); }
@media (max-width: 1000px) { .fleet-grid { grid-template-columns: minmax(0, 1fr); } }
.map-wrap { background: color-mix(in srgb, var(--out) 7%, var(--surface-2)); border-radius: var(--r-md); overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-wrap .mgrid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.map-wrap .land { fill: var(--surface); stroke: var(--ink-2); stroke-width: calc(var(--f) * 1.4px); stroke-linejoin: round; }
.map-wrap .sea { fill: var(--ink-2); opacity: .55; font-size: calc(var(--f) * 11px); font-style: italic; }
.map-wrap .city { fill: var(--ink-2); opacity: .5; } .map-wrap .cityn { fill: var(--ink-2); opacity: .75; font-size: calc(var(--f) * 11px); }
.mk { cursor: pointer; outline: none; }
.mk .dot { fill: var(--out); stroke: var(--surface); stroke-width: calc(var(--f) * 2px); }
.mk.night .dot { fill: var(--idle); } .mk.warn .dot { fill: var(--sun); } .mk.fault .dot { fill: var(--crit); }
.mk.offline .dot { fill: var(--surface); stroke: var(--idle); stroke-dasharray: 4 3; stroke-width: calc(var(--f) * 2px); }
.mk .pulse { fill: var(--out); opacity: .35; transform-box: fill-box; transform-origin: center; animation: mkp 2.6s ease-out infinite; }
@keyframes mkp { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mk .pulse { animation: none; opacity: .2; } }
.mk-n { fill: var(--ink); font-size: calc(var(--f) * 12.5px); font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: calc(var(--f) * 3px); }
.mk-p { fill: var(--ink-2); font-size: calc(var(--f) * 11.5px); paint-order: stroke; stroke: var(--surface); stroke-width: calc(var(--f) * 3px); }
.mk:hover .dot, .mk:focus-visible .dot, .mk.sel .dot { stroke: var(--ink); }
.mk.sel .dot { stroke-width: calc(var(--f) * 3px); }
em.dotk, i.dotk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--out); flex: none; margin-inline-end: 6px; }
.dotk.night { background: var(--idle); } .dotk.warn { background: var(--sun); } .dotk.fault { background: var(--crit); }
.dotk.offline { background: transparent; border: 2px dashed var(--idle); }
.st-t.ok { color: var(--out); } .st-t.warn { color: var(--warn); } .st-t.fault, .st-t.offline { color: var(--crit); font-weight: 700; }
.plist { display: grid; gap: 6px; }
.prow { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 12px; cursor: pointer; text-align: start; }
.prow:hover { border-color: var(--line); } .prow.sel { border-color: var(--out); background: var(--out-soft); }
.prow .pn { flex: 1; min-width: 0; display: grid; line-height: 1.5; }
.prow .pn b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow small { font-size: 11.5px; color: var(--ink-2); display: block; }
.prow .pv2 { text-align: end; font-weight: 700; line-height: 1.5; white-space: nowrap; }

/* ---------- کاربران ---------- */
.uform { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; display: grid; gap: 12px; margin-bottom: 16px; }
.uform h4 { font-size: 15px; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.frow select { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.pwrow { display: flex; gap: 6px; } .pwrow input { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px 12px; margin: 0; min-width: 0; }
legend { padding: 0 6px; font-size: 13px; color: var(--ink-2); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; }
label.chk { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13.5px; }
td.acts { white-space: nowrap; text-align: end; } td.acts .btn { padding: 1px 12px; margin-inline-start: 4px; }

#map-legend span::before { display: none; }
#map-legend { gap: 6px 16px; }
.uform h4 { margin: 0; line-height: 1.5; }
#u-body td:nth-child(4) { min-width: 180px; white-space: normal; }
#u-body td:nth-child(5) { white-space: nowrap; font-size: 12.5px; }
.pwrow { min-width: 0; } .pwrow input { width: 100%; min-width: 0; }

.login-logo { display: block; width: min(220px, 70%); height: auto; margin: 0 auto 4px; }
.login-card h2 { text-align: center; }

/* =====================================================================
   لایه‌ی طراحی حرفه‌ای: کاشی‌های خنثی، سربرگ، جدول، نشانگرهای تغییر، اسکلت بارگذاری
   ===================================================================== */
:root { --shadow: 0 1px 2px rgb(10 30 60 / .04), 0 6px 18px -10px rgb(10 30 60 / .14); }
.card { border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.card > header { padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); margin-bottom: 16px; }
.card h3 { font-size: 15px; }
.ic { width: 36px; height: 36px; border-radius: 11px; }
.ic svg { width: 20px; height: 20px; }

/* منو: برچسب بخش‌ها */
.nav-label { font-size: 11.5px; color: var(--side-dim); padding: 14px 14px 4px; letter-spacing: .02em; }
.nav-label:first-child { padding-top: 0; }
@media (max-width: 860px) { .nav-label { display: none; } }

/* سربرگ بالا */
.top { border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.top-head { display: grid; gap: 0; min-width: 0; }
.top-title { font-size: 20px; line-height: 1.5; }
.top-sub { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.top-sub .sd { width: 8px; height: 8px; border-radius: 50%; background: var(--out); flex: none; }
.top-sub .sd.night { background: var(--idle); } .top-sub .sd.warn { background: var(--sun); } .top-sub .sd.fault, .top-sub .sd.offline { background: var(--crit); }
.pill { box-shadow: none; border: 1px solid var(--line); }
.avatar { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 4px; cursor: pointer; color: var(--ink); font-size: 13.5px; }
.avatar:hover { border-color: var(--out); }
.avatar .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #002b5b, #01adae); color: #fff; font-weight: 700; font-size: 14px; }
@media (max-width: 860px) { .hide-sm, .avatar .avn { display: none; } .avatar { padding: 3px; } }
.top-tools select { appearance: none; -webkit-appearance: none; padding: 6px 14px 6px 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7a99' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 10px center; }

/* کاشی‌های خنثی (رنگ فقط روی آیکون) */
.tile { background: var(--surface); border: 1px solid var(--line); }
.tile .ti { background: var(--surface-2); }
.tile[data-tone="out"], .tile[data-tone="sun"], .tile[data-tone="idle"] { background: var(--surface); }
.tile[data-tone="out"] .ti { background: var(--out-soft); }
.tile[data-tone="sun"] .ti { background: var(--sun-soft); }
.tile[data-tone="idle"] .ti { background: var(--idle-soft); }
.tile[data-tone="crit"] { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 25%, transparent); }
.tile .tv { font-weight: 800; letter-spacing: -.01em; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: 999px; line-height: 1.8; width: fit-content; }
.delta.up { background: var(--out-soft); color: var(--out); } .delta.down { background: var(--crit-soft); color: var(--crit); } .delta.flat { background: var(--idle-soft); color: var(--ink-2); }
.delta svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ردیف KPI نمای کلی */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis .tile { padding: 16px 18px 18px; box-shadow: var(--shadow); border-radius: var(--r-lg); min-height: 132px; gap: 3px; }
.kpis .tile .tv { font-size: 28px; }
.kpis .tile .spark { position: absolute; inset-inline-end: 16px; top: 16px; width: 84px; height: 34px; opacity: .95; }
.spark path { fill: none; stroke: var(--out); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark path.fill { fill: color-mix(in srgb, var(--out) 14%, transparent); stroke: none; }
.kpis .meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.kpis .meter i { display: block; height: 100%; background: var(--out); border-radius: 6px; }

.grid-ov { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
.ov-side { display: grid; gap: var(--gap); }
@media (max-width: 1100px) { .grid-ov { grid-template-columns: minmax(0, 1fr); } }
.card > header .more { margin-inline-start: auto; }

/* اسکلت بارگذاری */
.sk { min-height: 132px; border-radius: var(--r-lg); border-color: transparent !important; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%) !important; background-size: 220% 100% !important; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -220% 0; } }

/* جدول‌ها */
table { border-collapse: separate; border-spacing: 0; }
thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-bottom: 1px solid var(--line); padding-block: 10px; white-space: nowrap; }
thead th:first-child { border-start-start-radius: var(--r-sm); } thead th:last-child { border-start-end-radius: var(--r-sm); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--out) 6%, transparent); }
tr.pick td, tr.pick:hover td { background: var(--out-soft); }

/* دکمه‌ها و ورودی‌ها */
.btn { transition: border-color .15s, background .15s, filter .15s; }
.btn:hover { background: var(--surface-2); }
.btn.primary:hover { background: var(--out); }
.btn:active { transform: translateY(1px); }
select, input { transition: border-color .15s, box-shadow .15s; }
input:focus-visible, select:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--out) 25%, transparent); outline: none; border-color: var(--out); }

/* هشدارها: ردیف‌های کارتی */
.alist li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); border-bottom: 1px solid var(--line); }
.alist li:last-child { border-bottom: 1px solid var(--line); }
.alist li:has(.sev.critical) { border-inline-start: 4px solid var(--crit); }
.alist li:has(.sev.warning) { border-inline-start: 4px solid var(--sun); }
.alist li .sev { grid-column: 1; } .alist li .msg { grid-column: 1; } .alist li .meta { grid-column: 1 / -1; }
.alist li.ok-empty { display: flex; justify-content: center; color: var(--ink-2); border-style: dashed; padding: 28px; }
.mini-alarms li { padding: 10px 0; }

/* ورود صفحه */
.page:not([hidden]) { animation: pgin .24s ease both; }
@keyframes pgin { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .page:not([hidden]) { animation: none; } .sk { animation: none; } }

/* نوار اسکرول باریک */
.tbl-scroll { scrollbar-width: thin; }

/* فهرست ناوگان: نمودار کوچک */
.prow .spk { width: 70px; height: 26px; flex: none; }
.prow .spk path { fill: none; stroke: var(--out); stroke-width: 1.6; stroke-linejoin: round; }
.prow .spk path.fill { fill: color-mix(in srgb, var(--out) 15%, transparent); stroke: none; }
.prow.off .spk { opacity: .35; }

main { padding-top: calc(var(--gap) * .8); }
.ov-side .health { gap: 16px; flex-wrap: nowrap; }
.ov-side .ring { width: 112px; height: 112px; }
.ov-side .ring .mid b { font-size: 20px; }
.ov-side .ring .mid small { font-size: 11px; }
.ov-side .health-kv { flex: 1; min-width: 0; }

/* ---------- صفحه‌ی تحلیل ---------- */
.an-h { margin: 22px 0 6px; font-size: 15px; }
#an-body > .hint, .an-h + .hint { margin-bottom: 8px; }
.an-ok { display: flex; gap: 8px; align-items: center; color: var(--out); }
.an-ok svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.an-find { display: grid; gap: 8px; }
.an-find li { border: 1px solid var(--line); border-inline-start: 4px solid var(--idle); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface-2); }
.an-find li[data-sev="critical"] { border-inline-start-color: var(--crit); }
.an-find li[data-sev="warning"] { border-inline-start-color: var(--sun); }
.an-find .fh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.an-find .fh em { font-style: normal; font-size: 12px; color: var(--ink-2); margin-inline-start: auto; }
.an-find p { font-size: 13.5px; color: var(--ink-2); }
.an-find .act, .an-det .act { color: var(--ink); }
.an-item { border-bottom: 1px solid var(--line); }
.an-row { display: grid; grid-template-columns: minmax(70px, 120px) 62px 46px minmax(60px, 1fr) 96px; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 8px 4px; cursor: pointer; text-align: start; }
.an-row:hover { background: var(--surface-2); }
.an-row .idx { font-weight: 700; }
.an-row .idx[data-st="crit"] { color: var(--crit); }
.an-row .idx[data-st="warn"] { color: var(--warn); }
.an-row .av { color: var(--ink-2); font-size: 13px; }
.an-row .bar { display: flex; height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; direction: ltr; }
.an-row .bar i { display: block; height: 100%; }
.an-row .lk { text-align: end; font-size: 13px; }
.an-det { padding: 4px 8px 12px; display: grid; gap: 6px; font-size: 13.5px; }
.an-chart svg { width: 100%; height: auto; }
.heat { --cols: 11; overflow-x: auto; }
.heat .hr { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px; align-items: center; min-width: 360px; }
.heat .hr > span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .hr > div { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2px; direction: ltr; }
.heat .hr > div i { height: 18px; border-radius: 3px; background: color-mix(in srgb, var(--crit) var(--d, 0%), var(--out-soft)); }
.heat .hr > div i.na { background: var(--surface-2); }
.heat .hc b { font-size: 10.5px; font-weight: 400; color: var(--ink-2); text-align: center; }
.heat .hr + .hr { margin-top: 2px; }
@media (max-width: 640px) {
  .an-row { grid-template-columns: 1fr 58px 1fr; }
  .an-row .av { display: none; }
  .an-row .bar { grid-column: 1 / 3; }
}

/* ---------- صفحه‌ی گزارش‌ها ---------- */
.rp-kinds { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.rp-kinds button { background: none; border: 0; padding: 3px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.rp-kinds button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.rp-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; margin-bottom: 8px; }
.rp-row label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.rp-row select { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; color: var(--ink); }
.rdate { display: inline-flex; gap: 6px; }
.rp-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.rp-act .btn { padding: 6px 18px; }
.rp-act .btn:disabled { opacity: .6; cursor: wait; }
.rp-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.rp-list li.hint { grid-column: 1 / -1; }
.rp-list a { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; text-decoration: none; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.rp-list a:hover { outline: 1px solid var(--out); }
.rp-list a svg { grid-row: span 2; width: 24px; height: 24px; fill: none; stroke: var(--out); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; align-self: center; }
.rp-list a span { font-size: 12px; color: var(--ink-2); }

/* ---------- صفحه‌ی مالی ---------- */
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.fin-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.fin-grid input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; color: var(--ink); font: inherit; direction: ltr; text-align: end; }
.fin-act { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.fin-notes { margin: 10px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--ink-2); }
.fin-notes b { color: var(--ink); }
.fin-tbl td.mbar { width: 35%; } .fin-tbl .mbar i { display: block; height: 8px; border-radius: 4px; background: var(--out); }
.fin-cause { display: grid; gap: 6px; }
.fin-cause > div { display: grid; grid-template-columns: minmax(80px, 150px) 1fr minmax(110px, auto); gap: 10px; align-items: center; font-size: 13.5px; }
.fin-cause .bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; direction: ltr; }
.fin-cause .bar i { display: block; height: 100%; }
.fin-cause b { text-align: end; font-weight: 600; }
@media (max-width: 640px) { .fin-cause > div { grid-template-columns: 1fr minmax(100px, auto); } .fin-cause .bar { grid-column: 1 / -1; order: 3; } }

/* گزارش نمایش‌داده‌شده در صفحه: ورق سفید مثل کاغذ، حتی در حالت تیره */
.rp-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
#rp-sheet { background: #fff; color: #0f1e3c; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px 20px; overflow-x: auto; }
#rp-sheet .rpt table { display: block; overflow-x: auto; }
#rp-sheet .rpt header.top { flex-wrap: wrap; }
@media (max-width: 640px) { #rp-sheet { padding: 12px; } }
