/* ═══════════════════════════════════════════════════════════════════
   سامانه داشبوردهای تحلیلی — اندیشکده اقتصاد مقاومتی
   سیستم طراحی ۲٫۱ — بر پایه هویت بصری اندیشکده (سبز سازمانی، نارنجی تأکیدی)
   ═══════════════════════════════════════════════════════════════════ */
@font-face { font-family: Vazirmatn; src: url(/assets/fonts/Vazirmatn.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* رنگ‌های برند */
  --brand: #056839;
  --brand-d: #03492A;
  --brand-dd: #022C1A;
  --brand-l: #0B9444;
  --brand-soft: #E8F3EB;
  --brand-tint: #F2F8F3;
  --accent: #E8730A;
  --accent-soft: #FDF1E4;
  /* خنثی‌ها (کمی متمایل به سبز) */
  --ink: #142019;
  --ink-2: #3A4841;
  --muted: #6A7871;
  --faint: #A2AEA7;
  --bg: #F4F6F3;
  --paper: #FFFFFF;
  --line: #DFE6E1;
  --line-2: #ECF0ED;
  /* رنگ‌های داده و وضعیت */
  --navy: #1B416A;
  --green: #0E7C47;
  --green-soft: #E4F3EA;
  --red: #B3372E;
  --red-soft: #F9E7E5;
  --amber: #A4620B;
  --amber-soft: #FCF0DD;
  /* مقیاس */
  --fs: 15px;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 25, .04), 0 8px 28px rgba(20, 32, 25, .05);
  --shadow-lg: 0 2px 6px rgba(20, 32, 25, .05), 0 24px 64px rgba(20, 32, 25, .13);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --kh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23056839' stroke-opacity='0.13' stroke-width='1'%3E %3Cpath d='M26.4 26.4H61.6V61.6H26.4Z'/%3E%3Cpath d='M44.0 19.1L68.9 44.0L44.0 68.9L19.1 44.0Z'/%3E %3Cpath d='M44.0 19.1V0M44.0 68.9V88M19.1 44.0H0M68.9 44.0H88M26.4 26.4L0 0M61.6 26.4L88 0M26.4 61.6L0 88M61.6 61.6L88 88'/%3E %3Ccircle cx='44.0' cy='44.0' r='7.9'/%3E%3C/g%3E%3C/svg%3E");
  --kh-w: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.09' stroke-width='1'%3E %3Cpath d='M26.4 26.4H61.6V61.6H26.4Z'/%3E%3Cpath d='M44.0 19.1L68.9 44.0L44.0 68.9L19.1 44.0Z'/%3E %3Cpath d='M44.0 19.1V0M44.0 68.9V88M19.1 44.0H0M68.9 44.0H88M26.4 26.4L0 0M61.6 26.4L88 0M26.4 61.6L0 88M61.6 61.6L88 88'/%3E %3Ccircle cx='44.0' cy='44.0' r='7.9'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif; color: var(--ink); background: var(--bg);
  font-size: var(--fs); line-height: 1.75; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
::selection { background: rgba(5, 104, 57, .16); }
.num { font-feature-settings: "tnum"; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
td.ltr, th.ltr { display: table-cell; text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }

/* ── دکمه‌ها ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s, color .2s; white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible { outline: 3px solid rgba(5, 104, 57, .25); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); box-shadow: 0 8px 20px rgba(5, 104, 57, .24); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #D0650A; box-shadow: 0 8px 20px rgba(232, 115, 10, .25); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #B9D3C1; color: var(--brand-d); }
.btn-danger { background: #fff; border-color: #EBC9C5; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ── فرم ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 44px; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 0 14px;
  outline: none; transition: border-color .2s, box-shadow .2s; font-size: 14.5px;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand-l); box-shadow: 0 0 0 4px rgba(11, 148, 68, .12); }
.input:disabled { background: var(--bg); color: var(--muted); }
.input.ltr { direction: ltr; text-align: left; }
.input-sm { height: 36px; font-size: 13.5px; border-radius: 9px; padding: 0 11px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.alert { padding: 11px 15px; border-radius: 11px; font-size: 14px; }
.alert-err { background: var(--red-soft); color: var(--red); }
.alert-ok { background: var(--green-soft); color: var(--green); }
.alert-info { background: var(--accent-soft); color: #8A4A08; }

/* ── سربرگ ────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(150%) blur(14px); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(270deg, var(--accent) 0 72px, var(--brand) 72px); }
.topbar .in { height: 78px; display: flex; align-items: center; gap: 18px; max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 3.5vw, 44px); }
.brand { display: flex; align-items: center; gap: 16px; flex: none; }
.brand img { height: 50px; width: auto; }
.brand .vr { width: 1px; height: 34px; background: var(--line); }
.brand b { font-size: 16.5px; font-weight: 800; display: block; line-height: 1.35; color: var(--ink); }
.brand small { font-size: 12.5px; color: var(--muted); display: block; line-height: 1.4; }
.topbar .sp { flex: 1; }
.nav-links { display: flex; gap: 4px; margin-right: 18px; }
.nav-links a { position: relative; white-space: nowrap; padding: 9px 15px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--brand-tint); color: var(--brand-d); }
.nav-links a.on { color: var(--brand-d); background: var(--brand-soft); font-weight: 700; }

.usermenu { position: relative; }
.usermenu > button {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s;
}
.usermenu > button:hover { border-color: #B9D3C1; }
.usermenu > button svg { width: 15px; height: 15px; color: var(--faint); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-d); flex: none;
}
.usermenu .who { font-size: 14px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .16s, transform .16s; z-index: 60;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu .mh { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu .mh b { display: block; font-size: 14px; }
.menu .mh span { font-size: 12px; color: var(--muted); }
.menu a, .menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: none;
  font-size: 14px; cursor: pointer; text-align: right; color: var(--ink-2);
}
.menu a:hover, .menu button:hover { background: var(--brand-tint); color: var(--brand-d); }
.menu svg { width: 17px; height: 17px; opacity: .75; }
.menu .sep { height: 1px; background: var(--line-2); margin: 4px 6px; }

/* ── نوار برند صفحات داخلی (الگوی خاتم) ─────────────────── */
.band { position: relative; overflow: hidden; background: linear-gradient(180deg, #EAF3EC 0%, #F1F6F2 70%, var(--bg) 100%); border-bottom: 1px solid transparent; }
.band::before { content: ""; position: absolute; inset: 0; background-image: var(--kh); background-size: 88px 88px; background-position: center top;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.35) 70%, transparent); mask-image: linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.35) 70%, transparent); }
.band .bars { position: absolute; left: 3%; bottom: -30px; width: 260px; opacity: .045; pointer-events: none; }
.band .in { position: relative; max-width: 1360px; margin: 0 auto; padding: 44px clamp(16px, 3.5vw, 44px) 40px; }
.band .kick { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--brand); }
.band .kick::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--accent); }
.band h1 { margin: 8px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.3px; line-height: 1.45; }
.band p { margin: 0; color: var(--muted); font-size: 15px; }

/* ── چیدمان ───────────────────────────────────────────────── */
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 3.5vw, 44px); width: 100%; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 17px 22px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.card-h .sp { flex: 1; }
.card-b { padding: 20px 22px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin: 32px 0 22px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
.page-h p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.page-h .sp { flex: 1; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.err { background: var(--red-soft); color: var(--red); }
.chip.accent { background: var(--accent-soft); color: #8A4A08; }
.chip.brand { background: var(--brand-soft); color: var(--brand-d); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: #1FA463; box-shadow: 0 0 0 3px rgba(31, 164, 99, .16); }

/* ── جدول ─────────────────────────────────────────────────── */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.t th { position: sticky; top: 0; background: #F8FAF8; color: var(--muted); font-weight: 600; font-size: 12.5px; text-align: right; padding: 12px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.t td { padding: 12px 15px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: #FAFCFA; }
.t tr.click { cursor: pointer; }
.t .sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.t td.wrap-cell { white-space: normal; min-width: 240px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── پانویس ───────────────────────────────────────────────── */
.foot { margin-top: 64px; background: var(--brand-dd); color: rgba(255, 255, 255, .72); position: relative; overflow: hidden; font-size: 13px; }
.foot::before { content: ""; position: absolute; inset: 0; background-image: var(--kh-w); background-size: 88px 88px; opacity: .8; }
.foot .in { position: relative; max-width: 1360px; margin: 0 auto; padding: 22px clamp(16px, 3.5vw, 44px); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot img { height: 30px; }
.foot b { color: #fff; font-weight: 600; }
.foot .sp { flex: 1; }
.foot a:hover { color: #fff; }

/* ── اعلان ────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 22px; left: 22px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 17px; border-radius: 11px; font-size: 14px; box-shadow: var(--shadow-lg); animation: tin .25s var(--ease); max-width: 380px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--brand); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ── پنجره کشویی ──────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(20, 32, 25, .3); backdrop-filter: blur(2px); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(600px, 100vw); background: var(--bg); z-index: 201;
  transform: translateX(-102%); transition: transform .28s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 20px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-size: 17px; }
.drawer-b { flex: 1; overflow: auto; padding: 22px 24px 40px; }
.drawer-f { padding: 14px 24px; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .brand .vr, .brand > span { display: none; }
  .nav-links { margin-right: 0; }
}
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .usermenu .who { display: none; }
  .topbar .in { height: 66px; }
  .brand img { height: 40px; }
  .band h1 { font-size: 24px; }
}
.band.band-sm .in { padding-top: 30px; padding-bottom: 26px; }
.band.band-sm h1 { font-size: 26px; }
.band.band-sm .bars { width: 200px; }
@media (max-width: 560px) { .nav-links { display: none; } .facts small { font-size: 11px; } }

/* ── اعلانات و ارتباط با مدیر (۲٫۸) ── */
.tbx { position: relative; }
.tbi { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s; }
.tbi:hover, .tbi.on { border-color: #B9D3C1; background: var(--brand-tint); color: var(--brand-d); }
.tbi svg { width: 21px; height: 21px; }
.rdot { position: absolute; top: 8px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: #E0322B; box-shadow: 0 0 0 2px #fff; }
.rdot[hidden] { display: none; }
.rnum { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #E0322B; color: #fff; font: 700 11.5px/20px Vazirmatn, Tahoma, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
.newsp { position: absolute; top: calc(100% + 12px); left: -120px; width: min(460px, 92vw); max-height: min(72vh, 640px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .16s, transform .16s; z-index: 70; }
.newsp.open { opacity: 1; transform: none; pointer-events: auto; }
.newsp .nh { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line-2); }
.newsp .nh b { font-size: 15.5px; }
.newsp .sp { flex: 1; }
.newsp .nv { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; background: var(--brand-tint); border-bottom: 1px solid var(--line-2); }
.vchip { display: inline-flex; flex-direction: column; padding: 4px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); line-height: 1.5; }
.vchip small { font-size: 11px; color: var(--muted); }
.vchip b { font-size: 12.5px; color: var(--brand-d); }
.newsp .nl { overflow: auto; padding: 4px 0 8px; }
.newsp article { padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.newsp article:last-child { border-bottom: 0; }
.newsp article.new { background: linear-gradient(90deg, #fff, #FFF8EE); }
.newsp .am { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.newsp .am .chip { height: 22px; font-size: 11.5px; padding: 0 9px; }
.newsp .ver { font-weight: 700; color: var(--ink-2); }
.newsp .nw { color: #fff; background: #E0322B; border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 700; line-height: 19px; }
.newsp h4 { margin: 7px 0 4px; font-size: 14.5px; }
.newsp .ab { font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.newsp .ab ul { margin: 2px 0; padding-right: 18px; }
.newsp .ab p { margin: 2px 0; }
.newsp .empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 700px) { .newsp { position: fixed; top: 84px; left: 8px; right: 8px; width: auto; } .tbi { width: 40px; height: 40px; } }
