/*
 * اجزای مشترک صفحه‌های ماژول‌های سایت (فرم‌ها، مناقصات، پایداری، مسئولیت اجتماعی، مدیران و کاتالوگ‌ها)
 * سرتیتر صفحه، تب‌ها، دکمه‌های فیلتر، نوار ابزار، کارت آمار، حالت خالی و صفحه‌بندی؛ هماهنگ با archive.css و page.css
 */
.md-page{padding:14px 0 70px;color:#354f54}
.md-page .wrap{max-width:1240px}
.md-page a:focus-visible,.md-page button:focus-visible{outline:2px solid var(--brand);outline-offset:3px}

/* ---------------------------------------------------------------- سرتیتر */
.md-head{position:relative;margin-bottom:30px;padding:4px 0 22px;border-bottom:1px solid #dce7df}
.md-head:after{content:'';position:absolute;inset-inline-start:0;bottom:-2px;width:90px;height:3px;border-radius:3px;background:linear-gradient(90deg,#b9a26c 24%,var(--brand) 24%)}
[dir=ltr] .md-head:after{background:linear-gradient(90deg,var(--brand) 76%,#b9a26c 76%)}
.md-head h1{margin:8px 0 6px;font-size:clamp(26px,2.6vw,34px);line-height:1.7;color:#164c55}
.md-head p{max-width:780px;margin:8px 0 0;font-size:15px;line-height:2.1;color:#637a78}
.md-head-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:18px}
.md-section-title{display:flex;align-items:center;gap:12px;margin:0 0 18px;font-size:21px;line-height:1.8;color:var(--brand)}
.md-section-title:before{content:'';flex:none;width:6px;height:22px;border-radius:3px;background:linear-gradient(180deg,#d9c38b,#b9a26c)}
.md-label{font-size:11px;font-weight:700;color:#897647;letter-spacing:.2px}

/* ---------------------------------------------------------------- تب‌ها (لینک یا دکمه) */
.md-tabs{display:flex;gap:6px;margin:0 0 20px;padding:5px;border-radius:14px;background:#eef4f1;width:max-content;max-width:100%;overflow-x:auto;scrollbar-width:none}
.md-tabs a,.md-tabs button{display:inline-flex;align-items:center;gap:8px;flex:none;min-height:42px;padding:8px 18px;border:0;border-radius:10px;background:none;color:#4b6669;font:inherit;font-size:14px;cursor:pointer;transition:background .2s,color .2s,box-shadow .2s}
.md-tabs a:hover,.md-tabs button:hover{color:var(--brand)}
.md-tabs [aria-current=page],.md-tabs [aria-selected=true]{background:#fff;color:var(--brand);font-weight:700;box-shadow:0 3px 10px #094b5514}
.md-tabs small{min-width:22px;padding:1px 7px;border-radius:999px;background:#dde9e3;font-size:11px;text-align:center;color:#5d7a73}
.md-tabs [aria-current=page] small,.md-tabs [aria-selected=true] small{background:var(--brand);color:#fff}

/* ---------------------------------------------------------------- دکمه‌های فیلتر */
.md-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.md-chips a{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:6px 14px;border:1px solid #d0e0d6;border-radius:999px;background:#fff;color:#42675f;font-size:13px;transition:background .2s,color .2s,border-color .2s}
.md-chips a:hover{background:#e9f2ed;border-color:#8fb5a2}
.md-chips a[aria-current=page]{background:var(--brand);border-color:var(--brand);color:#fff}
.md-chips small{padding:0 6px;border-radius:999px;background:#edf4f1;font-size:11px;color:#6f877e}
.md-chips a[aria-current=page] small{background:#ffffff2e;color:#fff}

/* ---------------------------------------------------------------- نوار ابزار (فیلتر سال و جستجو) */
.md-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px;margin-bottom:26px;padding:14px 16px;border:1px solid #dce7df;border-radius:16px;background:#f7faf8}
.md-toolbar .md-chips{flex:1 1 auto}
.md-filter{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-inline-start:auto}
.md-filter label{font-size:12px;color:#6b827d}
.md-filter select,.md-filter input[type=search]{min-height:40px;padding:6px 12px;border:1px solid #cfdfd6;border-radius:10px;background:#fff;color:var(--text);font:inherit;font-size:13px}
.md-filter input[type=search]{width:220px}
.md-filter select:focus,.md-filter input:focus{outline:2px solid #8fb5a2;outline-offset:0;border-color:#8fb5a2}
.md-filter button{min-height:40px;padding:6px 16px;border:0;border-radius:10px;background:var(--brand);color:#fff;font:inherit;font-size:13px;cursor:pointer}
.md-filter .md-clear{font-size:12px;color:#8a6f2f;text-decoration:underline;text-underline-offset:3px}

/* ---------------------------------------------------------------- کارت‌های آمار */
.md-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:0 0 30px;padding:0}
.md-stat{position:relative;overflow:hidden;padding:20px 22px;border-radius:18px;background:linear-gradient(140deg,var(--brand-deep),var(--brand));color:#fff}
.md-stat:after{content:'';position:absolute;inset-inline-end:-30px;top:-30px;width:110px;height:110px;border-radius:50%;background:radial-gradient(circle,#ffffff1f,transparent 70%)}
.md-stat dt{font-size:12px;color:#cfe6e2}
.md-stat dd{margin:6px 0 0;font-size:clamp(22px,2.2vw,30px);font-weight:800;line-height:1.5}
.md-stat dd small{font-size:13px;font-weight:500;color:#cfe6e2}
.md-stat.is-gold{background:linear-gradient(140deg,#7d6630,#b39752)}

/* ---------------------------------------------------------------- برچسب وضعیت */
.md-badge{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:2px 11px;border-radius:999px;background:#e8f1ec;font-size:12px;font-weight:600;color:#3d6b5f;white-space:nowrap}
.md-badge:before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor}
.md-badge.is-open{background:#e2f3ea;color:#16794b}
.md-badge.is-closed{background:#eef1f1;color:#667a7c}
.md-badge.is-resulted{background:#e6eefb;color:#2c5aa0}
.md-badge.is-cancelled{background:#fdecea;color:#b2392b}
.md-badge.is-upcoming,.md-badge.is-planned{background:#fff4dc;color:#94661a}
.md-badge.is-progress{background:#e4f0f8;color:#24668f}
.md-badge.is-done{background:#e2f3ea;color:#16794b}
.md-badge.is-gold{background:#f6efdc;color:#8a6f2f}
.md-badge.is-gold:before{display:none}

/* ---------------------------------------------------------------- حالت خالی و صفحه‌بندی */
.md-empty{padding:48px 24px;border:1px dashed #bacfc2;border-radius:18px;background:#fbfdfc;text-align:center}
.md-empty svg{width:46px;height:46px;margin-bottom:10px;fill:none;stroke:#8fb5a2;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.md-empty h2{font-size:19px;color:var(--brand)}
.md-empty p{margin-top:10px;font-size:13px;line-height:2}
.md-pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:36px}
.md-pager a,.md-pager .is-current{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 13px;border:1px solid #d3e2d8;border-radius:10px;font-size:13px;color:var(--brand);transition:background .2s}
.md-pager a:hover{background:#eaf3ed}
.md-pager .is-current{border-color:var(--brand);background:var(--brand);color:#fff}
.md-pager .md-step{padding-inline:16px;font-weight:600}
.md-gap{color:#9aada7}

/* دکمه‌ها */
.md-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:9px 20px;border:1px solid var(--brand);border-radius:12px;background:var(--brand);color:#fff;font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .2s,transform .2s,box-shadow .2s}
.md-btn:hover{background:var(--brand-deep);transform:translateY(-1px);box-shadow:0 8px 18px #075b6926}
.md-btn.is-ghost{background:#fff;color:var(--brand)}
.md-btn.is-ghost:hover{background:#eef5f1}
.md-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
[dir=ltr] .md-arrow{display:inline-block;transform:scaleX(-1)}

@media(max-width:760px){
  .md-page{padding-bottom:48px}
  .md-head{margin-bottom:22px}
  .md-toolbar{padding:12px}
  .md-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}
  .md-chips a{white-space:nowrap}
  .md-filter{width:100%;margin:0}
  /* کادر جستجو در موبایل یک خط کامل (همراه دکمه) می‌گیرد تا متن آن بریده نشود */
  .md-filter input[type=search]{flex:1 1 200px;width:auto;min-width:0}
  .md-filter select{flex:1 1 auto}
  .md-tabs{width:100%}
  .md-tabs a,.md-tabs button{flex:1;justify-content:center;padding-inline:12px}
}
@media(prefers-reduced-motion:reduce){
  .md-btn,.md-chips a,.md-tabs a,.md-tabs button{transition:none}
  .md-btn:hover{transform:none}
}
