@font-face { font-family: Vazirmatn; src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: oklch(0.975 0.004 260); --card: #fff; --ink: oklch(0.25 0.02 260); --muted: oklch(0.52 0.015 260); --line: oklch(0.92 0.006 260);
  --soft: oklch(0.955 0.006 260); --accent: oklch(0.52 0.15 255); --accent-soft: oklch(0.94 0.04 255);
  --ok: oklch(0.55 0.13 150); --ok-soft: oklch(0.95 0.05 150); --bad: oklch(0.55 0.17 30); --bad-soft: oklch(0.95 0.04 30);
  --warn: oklch(0.62 0.13 75); --warn-soft: oklch(0.96 0.05 85);
  --hero1: oklch(0.32 0.06 255); --hero2: oklch(0.2 0.025 260);
  --r: 18px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Vazirmatn, system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-size: 15px; }
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); }
.mono, .code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .3px; direction: ltr; unicode-bidi: isolate; }
.ic { flex: none; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 760px; margin: 0 auto; min-height: 100vh; padding: calc(var(--safe-t) + 10px) 16px calc(110px + var(--safe-b)); }
.page { display: flex; flex-direction: column; gap: 14px; animation: up .25s ease; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

/* ---------- top bar */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.topbar h1 { font-size: 20px; font-weight: 800; flex: 1; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--card); box-shadow: 0 0 0 1px var(--line); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.iconbtn.soft { background: var(--soft); box-shadow: none; }
.iconbtn.dark { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.flip .ic { transform: scaleX(-1); }
.back .ic { transform: none; }

/* ---------- buttons */
.btn { min-height: 46px; padding: 0 18px; border-radius: 14px; border: none; background: var(--soft); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger.ghost { background: var(--bad-soft); color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

/* ---------- cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); padding: 16px; }
.card.tight { padding: 12px 14px; }
.card h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 .grow { flex: 1; }
.hero { background: radial-gradient(120% 120% at 100% 0%, var(--hero1), var(--hero2)); color: #fff; border-radius: 26px; padding: 18px; position: relative; overflow: hidden; }
.hero .muted, .hero small { color: oklch(0.8 0.02 260); }
.hero .big { font-size: 38px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.hero .unit { font-size: 14px; color: oklch(0.8 0.02 260); margin-inline-start: 6px; }
.hero .code { font-size: 26px; font-weight: 800; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px -18px -18px; border-top: 1px solid rgba(255,255,255,.1); }
.hero-stats > div { padding: 12px 14px; border-inline-start: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 3px; }
.hero-stats > div:first-child { border-inline-start: none; }
.hero-stats span { font-size: 12px; color: oklch(0.78 0.02 260); }
.hero-stats strong { font-size: 17px; font-weight: 800; }
.hero .spark { width: calc(100% + 36px); height: 64px; margin: 8px -18px 0; display: block; color: oklch(0.85 0.05 255); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; cursor: pointer; border: none; }
.tile strong { font-size: 21px; font-weight: 800; }
.tile span { font-size: 12px; color: var(--muted); }
.tile.bad { background: var(--bad-soft); box-shadow: none; } .tile.bad strong, .tile.bad span { color: var(--bad); }
.tile.warn { background: var(--warn-soft); box-shadow: none; } .tile.warn strong, .tile.warn span { color: oklch(0.5 0.12 70); }
.tile.ok { background: var(--ok-soft); box-shadow: none; } .tile.ok strong, .tile.ok span { color: var(--ok); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--soft); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-l { font-size: 12px; color: var(--muted); }
.stat-v { font-size: 16px; font-weight: 800; }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.ok .stat-v { color: var(--ok); } .stat.bad .stat-v { color: var(--bad); } .stat.accent .stat-v { color: var(--accent); }

/* ---------- list rows */
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.item { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 14px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; position: relative; }
.item.accent-bar::before { content: ''; position: absolute; inset-inline-end: -1px; top: 16px; bottom: 16px; width: 4px; border-radius: 4px; background: var(--accent); }
.item.accent-bar.done::before { background: var(--ok); }
.item.accent-bar.late::before { background: var(--bad); }
.item .t { font-weight: 800; font-size: 15.5px; }
.item .s { font-size: 12.5px; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; font-weight: 800; }
.avatar.ok { background: var(--ok-soft); color: var(--ok); }
.line-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }

.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 9px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: oklch(0.5 0.12 70); }
.badge.gray { background: var(--soft); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip { height: 38px; padding: 0 15px; border-radius: 13px; border: none; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-weight: 700; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.fchip.on { background: var(--ink); color: #fff; box-shadow: none; }
.prog { display: flex; gap: 4px; }
.prog span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.prog span.on { background: var(--accent); }
.done .prog span.on { background: var(--ok); }
.prog span.bad { background: var(--bad); }

.seg { display: flex; background: oklch(0.94 0.006 260); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 38px; border: none; background: transparent; border-radius: 11px; font-weight: 700; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.search { display: flex; align-items: center; gap: 8px; background: var(--card); box-shadow: 0 0 0 1px var(--line); border-radius: 15px; padding: 0 14px; height: 50px; }
.search input { border: none; outline: none; flex: 1; background: transparent; font-size: 15px; min-width: 0; }
.search .ic { color: var(--muted); }

.warns { display: flex; flex-direction: column; gap: 4px; }
.warn-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: oklch(0.5 0.12 70); }
.alert { border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: oklch(0.45 0.12 70); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.inp { width: 100%; min-height: 48px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); padding: 10px 12px; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
textarea.inp { min-height: 70px; resize: vertical; }
select.inp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23778' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-position: left 12px center; background-size: 16px; background-repeat: no-repeat; padding-left: 36px; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp.num { text-align: left; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14.5px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.dateinput .row { gap: 6px; }
.dateinput .inp { padding: 10px 8px; min-width: 0; letter-spacing: -.2px; }
.dateinput .iconbtn { width: 44px; height: 48px; }
.dateinput .greg, .datebox .greg { font-size: 11.5px; color: var(--muted); display: block; }
.datebox { display: inline-flex; flex-direction: column; line-height: 1.35; }
.qty-input { width: 92px; min-height: 42px; text-align: center; }

/* ---------- sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(15,18,25,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet-wrap.show { opacity: 1; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; transform: translateY(30px); transition: transform .22s; }
.sheet.wide { max-width: 760px; }
.sheet-wrap.show .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; padding: 14px 16px 8px; gap: 10px; position: relative; }
.sheet-head h3 { flex: 1; font-size: 17px; font-weight: 800; }
.sheet-head .grab { position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
.sheet-body { overflow-y: auto; padding: 6px 16px 16px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; } }
.confirm-msg { font-size: 15px; line-height: 1.9; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid.wd span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.day { height: 48px; border-radius: 12px; border: none; background: var(--card); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.day small { font-size: 9.5px; color: var(--muted); font-weight: 400; }
.day.today { box-shadow: 0 0 0 2px var(--accent); }
.day.sel { background: var(--accent); color: #fff; } .day.sel small { color: #fff; }
.cal-foot { margin-top: 10px; display: flex; justify-content: center; }

/* ---------- bottom nav */
.nav { position: fixed; bottom: calc(10px + var(--safe-b)); left: 50%; transform: translateX(-50%); width: min(728px, calc(100% - 24px)); height: 66px; background: oklch(0.22 0.02 260); border-radius: 22px; display: flex; align-items: center; justify-content: space-around; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: oklch(0.72 0.015 260); font-size: 11.5px; font-weight: 600; width: 66px; }
.nav a .pill { width: 50px; height: 30px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.nav a.on { color: #fff; } .nav a.on .pill { background: var(--accent); }
.nav .fab { width: 62px; height: 62px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -30px; box-shadow: 0 0 0 5px var(--bg), 0 8px 20px oklch(0.52 0.15 255 / .4); border: none; cursor: pointer; }

/* ---------- misc */
.toast { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translate(-50%, -20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 100; opacity: 0; transition: all .25s; font-weight: 600; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.loading { display: flex; flex-direction: column; gap: 12px; }
.shimmer { height: 90px; border-radius: 18px; background: linear-gradient(90deg, var(--soft), #fff, var(--soft)); background-size: 200% 100%; animation: sh 1.2s infinite; }
.shimmer.short { height: 50px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.section-title { font-size: 14px; font-weight: 800; color: var(--muted); margin: 6px 4px -4px; display: flex; align-items: center; gap: 8px; }
.section-title .grow { flex: 1; }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--accent-soft); }
.tl { position: relative; padding: 0 0 16px; }
.tl::before { content: ''; position: absolute; inset-inline-start: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.tl.final::before { background: var(--ok); }
.tl .tt { font-weight: 800; }
.tl .ts { font-size: 12.5px; color: var(--muted); }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.doc { border-radius: 14px; overflow: hidden; background: var(--soft); aspect-ratio: 1; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.doc img { width: 100%; height: 100%; object-fit: cover; }
.doc .cap { position: absolute; bottom: 0; inset-inline: 0; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 11px; padding: 14px 6px 5px; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-card { border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 22px; cursor: pointer; border: none; text-align: right; min-height: 120px; }
.menu-card .mi { width: 42px; height: 42px; border-radius: 13px; color: #fff; display: flex; align-items: center; justify-content: center; }
.menu-card strong { font-size: 16px; font-weight: 800; display: block; }
.menu-card small { font-size: 12.5px; font-weight: 600; }
.c-blue { background: oklch(0.95 0.035 255); } .c-blue .mi { background: oklch(0.55 0.15 255); } .c-blue small { color: oklch(0.45 0.13 255); }
.c-green { background: oklch(0.95 0.045 150); } .c-green .mi { background: oklch(0.55 0.13 150); } .c-green small { color: oklch(0.45 0.12 150); }
.c-violet { background: oklch(0.95 0.035 300); } .c-violet .mi { background: oklch(0.55 0.15 300); } .c-violet small { color: oklch(0.45 0.13 300); }
.c-cyan { background: oklch(0.95 0.04 210); } .c-cyan .mi { background: oklch(0.55 0.11 210); } .c-cyan small { color: oklch(0.42 0.1 210); }
.c-red { background: oklch(0.95 0.035 30); } .c-red .mi { background: oklch(0.57 0.15 30); } .c-red small { color: oklch(0.47 0.14 30); }
.c-amber { background: oklch(0.96 0.045 80); } .c-amber .mi { background: oklch(0.62 0.13 70); } .c-amber small { color: oklch(0.48 0.11 70); }
.c-gray { background: oklch(0.95 0.005 260); } .c-gray .mi { background: oklch(0.45 0.02 260); } .c-gray small { color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--card); border-radius: 14px; overflow: hidden; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th { background: var(--soft); font-size: 12.5px; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
.tbl td.n { text-align: left; font-variant-numeric: tabular-nums; direction: ltr; }
.tbl tr.total td { font-weight: 800; background: var(--soft); }
.tbl input.cell { width: 104px; border: 1px solid transparent; background: transparent; padding: 6px; border-radius: 8px; text-align: left; direction: ltr; font-size: 13.5px; }
.tbl input.cell:focus { border-color: var(--accent); background: #fff; outline: none; }
.tbl td.unv { background: var(--warn-soft); }
.tbl.sticky1 td:first-child, .tbl.sticky1 th:first-child { position: sticky; right: 0; background: var(--card); z-index: 1; box-shadow: -1px 0 0 var(--line); }
.tbl.sticky1 th:first-child { background: var(--soft); z-index: 2; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.login { max-width: 400px; margin: 12vh auto 0; }
.logo { width: 64px; height: 64px; border-radius: 20px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; margin: 0 auto 14px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick-row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.stage-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.stage-row:last-child { border-bottom: none; }
.stage-row .bar { height: 8px; border-radius: 4px; background: var(--accent); min-width: 4px; }
.dot-steps { display: flex; justify-content: space-between; position: relative; margin: 18px 4px 4px; }
.dot-steps::before { content: ''; position: absolute; top: 6px; inset-inline: 6px; height: 3px; background: rgba(255,255,255,.18); border-radius: 2px; }
.dot-steps .ds { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; color: oklch(0.78 0.02 260); flex: 1; text-align: center; }
.dot-steps .ds i { width: 14px; height: 14px; border-radius: 50%; background: oklch(0.4 0.03 260); box-shadow: 0 0 0 3px var(--hero2); }
.dot-steps .ds.on i { background: oklch(0.75 0.15 150); }
.dot-steps .ds.cur i { background: #fff; box-shadow: 0 0 0 3px var(--hero2), 0 0 0 6px oklch(0.75 0.15 150 / .5); }
.dot-steps .ds.cur { color: #fff; font-weight: 700; }
.print-only { display: none; }

@media (min-width: 900px) { #app { padding-top: 24px; } }
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, 1fr); } .hero .big { font-size: 32px; } }
@media print {
  .nav, .no-print, .topbar .iconbtn, .btn { display: none !important; }
  .print-only { display: block; }
  body, #app { background: #fff; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ================= نمودارها (viz) ================= */
:root { --s-sale: #2a78d6; --s-cost: #eb6834; --s-profit: #1baf7a; --s-paid: #86b6ef;
  --st1: #86b6ef; --st2: #5598e7; --st3: #2a78d6; --st4: #1c5cab; --st5: #104281; --st6: #0d366b; }
.viz { position: relative; }
.viz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.viz-li { display: inline-flex; align-items: center; gap: 6px; }
.viz-li b { color: var(--ink); font-weight: 700; }
.viz-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.viz-toggle { border: none; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.viz-plot { position: relative; direction: ltr; }
.viz-svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-zero { stroke: oklch(0.82 0.01 260); stroke-width: 1; }
.viz-axis { fill: var(--muted); font-size: 10.5px; font-family: Vazirmatn, sans-serif; }
.viz-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: vizDraw 1.1s ease forwards; }
.viz-line-d { animation: vizFade 1.2s ease; }
@keyframes vizDraw { to { stroke-dashoffset: 0; } }
.viz-area { animation: vizFade .9s ease; }
@keyframes vizFade { from { opacity: 0; } }
.viz-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-dot { stroke: var(--card); stroke-width: 2; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; background: oklch(0.22 0.02 260); color: #fff; border-radius: 12px; padding: 8px 10px; font-size: 12.5px; min-width: 150px; opacity: 0; transition: opacity .12s; direction: rtl; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.viz-tip.on { opacity: 1; }
.viz-tip-h { font-weight: 700; margin-bottom: 5px; color: oklch(0.85 0.02 260); }
.viz-tip-r { display: flex; align-items: center; gap: 7px; line-height: 1.8; }
.viz-tip-r span { flex: 1; }
.viz-tip-s { color: oklch(0.8 0.02 260); font-size: 11.5px; }
.viz-table { margin-top: 4px; max-height: 320px; overflow: auto; }

.viz-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.viz-donut-box { position: relative; flex: none; margin: 0 auto; }
.viz-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.viz-donut-c strong { font-size: 24px; font-weight: 800; }
.viz-donut-c span { font-size: 11.5px; color: var(--muted); }
.viz-seg { transition: transform .15s, opacity .15s; transform-origin: center; cursor: pointer; outline: none; animation: vizPop .6s ease backwards; }
.viz-seg.on { transform: scale(1.04); }
@keyframes vizPop { from { opacity: 0; transform: scale(.85); } }
.viz-dlegend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.viz-drow { display: flex; align-items: center; gap: 8px; border: none; background: transparent; padding: 7px 4px; border-radius: 10px; font-size: 13.5px; cursor: pointer; text-align: right; }
.viz-drow:hover { background: var(--soft); }
.viz-drow b { font-weight: 800; }
.viz-drow small { color: var(--muted); width: 38px; text-align: left; }

.viz-hbars { display: flex; flex-direction: column; gap: 10px; }
.viz-hrow { display: grid; grid-template-columns: minmax(84px, 32%) 1fr; gap: 10px; align-items: center; }
.viz-hrow.click { cursor: pointer; }
.viz-hl { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-hl small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.viz-hb { display: flex; flex-direction: column; gap: 4px; }
.viz-barline { display: flex; align-items: center; gap: 8px; }
.viz-track { flex: 1; height: 16px; display: flex; align-items: center; cursor: default; }
.viz-bar { height: 10px; border-radius: 4px 0 0 4px; animation: vizGrow .8s cubic-bezier(.2,.8,.2,1) backwards; transform-origin: right; }
.viz-bar.neg { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255,255,255,.6) 3px 5px) !important; }
@keyframes vizGrow { from { transform: scaleX(0); } }
.viz-bv { font-size: 12px; font-weight: 700; min-width: 64px; text-align: left; color: var(--ink); font-variant-numeric: tabular-nums; }

.viz-ringbox { position: relative; width: 84px; height: 84px; flex: none; }
.viz-ring-arc { animation: vizRing 1.2s ease backwards; }
@keyframes vizRing { from { stroke-dasharray: 0 999; } }
.viz-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.viz-ring-c strong { font-size: 17px; font-weight: 800; }
.viz-ring-c span { font-size: 10.5px; color: oklch(0.8 0.02 260); }
.viz-mini { display: flex; align-items: flex-end; gap: 2px; direction: ltr; }
.viz-mini i { flex: 1; border-radius: 2px 2px 0 0; min-width: 2px; animation: vizGrowY .7s ease backwards; transform-origin: bottom; }
@keyframes vizGrowY { from { transform: scaleY(0); } }

/* ---- چیدمان داشبورد */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .dash-grid.two { grid-template-columns: 1fr 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border: none; text-align: right; cursor: pointer; position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.kpi strong { font-size: 22px; font-weight: 800; line-height: 1.15; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.bad .kpi-ic { background: var(--bad-soft); color: var(--bad); }
.kpi.warn .kpi-ic { background: var(--warn-soft); color: oklch(0.5 0.12 70); }
.kpi.ok .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi.bad strong { color: var(--bad); }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero .delta { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.hero .delta.up { background: oklch(0.45 0.1 150 / .35); color: oklch(0.88 0.12 150); }
.hero .delta.down { background: oklch(0.45 0.12 30 / .35); color: oklch(0.88 0.1 30); }
.hero .viz-mini { margin-top: 12px; }
.card-sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.today-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
