/* افزوده‌های نسخه وب روی استایل پرتابل. استایل پایه دست‌نخورده می‌ماند تا ظاهر
   دقیقاً همان نسخه لوکال بماند؛ اینجا فقط چیزهایی که در وب اضافه شده‌اند. */

/* نوار بالا — همان ظاهر داشبورد، تا کل سامانه یکدست باشد. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 0 32px; height: 72px;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(15, 76, 69, .1);
}
.tb-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; min-width: 0;
}
.tb-brand img { height: 44px; width: auto; display: block; }
.tb-title {
  font-size: 17px; font-weight: 700; color: #10261F;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-nav { display: flex; align-items: center; gap: 8px; }
.tb-nav a {
  color: #4A5A55; text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transition: background .3s cubic-bezier(.16,1,.3,1), color .3s cubic-bezier(.16,1,.3,1);
}
.tb-nav a:hover { background: rgba(15, 76, 69, .06); color: #0F4C45; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(214, 164, 77, .16); color: #8A6520;
  font-size: 13px; font-weight: 700;
}

/* منوی موبایل (enhanceTopbar در api.js): روی دسکتاپ ظرف پیوندها نامرئی است و پیوندها مثل قبل کنار هم‌اند. */
.tb-links { display: contents; }
.tb-menu-btn { display: none; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; height: 64px; gap: 12px; }
  .tb-title { display: none; }
  .tb-brand { flex-shrink: 0; }
  .tb-brand img { height: 40px; }
  .tb-nav { position: relative; gap: 8px; flex-shrink: 0; }
  .tb-menu-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
    border: 1px solid rgba(15, 76, 69, .16); border-radius: 10px; background: #fff; color: #0F4C45;
  }
  .tb-menu-btn span, .tb-menu-btn span::before, .tb-menu-btn span::after {
    display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative;
    transition: transform .15s ease, opacity .15s ease;
  }
  .tb-menu-btn span::before, .tb-menu-btn span::after { content: ""; position: absolute; inset-inline-start: 0; }
  .tb-menu-btn span::before { top: -6px; }
  .tb-menu-btn span::after { top: 6px; }
  .tb-nav.open .tb-menu-btn span { background: transparent; }
  .tb-nav.open .tb-menu-btn span::before { transform: translateY(6px) rotate(45deg); }
  .tb-nav.open .tb-menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }
  .tb-menu-btn:focus-visible { outline: 2px solid #0F4C45; outline-offset: 2px; }
  .tb-links {
    display: none; position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 40;
    min-width: 200px; padding: 8px; flex-direction: column; gap: 2px;
    background: #fff; border: 1px solid rgba(15, 76, 69, .12); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(8, 60, 54, .14);
  }
  .tb-nav.open .tb-links { display: flex; }
  .tb-links a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; font-size: 15px; }
}

.loading-note { color: var(--muted); padding: 24px; }

/* نوار وضعیت محاسبه کنار دکمه‌ها */
.calc-busy { color: var(--muted); font-size: 13px; margin-inline-start: 10px; }

/* هشدار حالت آزمایشی/اعتبار ناکافی */
.alert.alert-warning { background: #FDF6E3; border-color: #E5D4A1; color: var(--warning); }

/* ——— تأیید کارشناس و مهر مرجع در پایان گزارش ماده صد و عوارض (partials/calculator-form.html) ———
   همان کادرهای خط‌چین گزارش خدمات دیگر (report-print.css .rp-sign)؛ با هم و نشکن، همیشه آخر. */
.report-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; break-inside: avoid; page-break-inside: avoid; }
.report-sign-box { border: 1px dashed #9FB3AE; border-radius: 8px; padding: 10px 12px; min-height: 30mm; display: flex; flex-direction: column; background: #fff; }
.report-sign-box h3 { margin: 0 0 4px; font-size: 14px; color: #0F4C45; }
.report-sign-hint { font-size: 12.5px; color: #7C8C87; line-height: 1.7; }
.report-sign-lines { margin-top: auto; font-size: 13px; color: #5A6B66; }
.report-sign-lines i { display: block; font-style: normal; margin-top: 8px; }
@media (max-width: 600px) { .report-sign { grid-template-columns: 1fr; } }

/* در چاپ فشرده‌تر، مثل حالت یک‌برگی گزارش‌های دیگر: شرح زیر عنوان کادر برداشته می‌شود و کادرها کوتاه‌ترند تا کادر
   تأیید در باقی‌مانده‌ی برگ آخر جا شود و برای خودش برگ تازه‌ی نیمه‌خالی نسازد. خط‌های امضا همه می‌مانند. */
@media print {
  .report-sign { margin-top: 8px; gap: 10px; }
  .report-sign-box { padding: 6px 10px; min-height: 21mm; }
  .report-sign-box h3 { font-size: 9pt; margin-bottom: 0; }
  .report-sign-hint { display: none; }
  .report-sign-lines { font-size: 8pt; }
  .report-sign-lines i { margin-top: 5px; }
}

@media print {
  /* کاغذ سفید: زمینه‌ی کرم صفحه (calculator.css) در PDF و چاپ گزارش ماده صد و عوارض خاکستری درمی‌آمد. */
  html, body { background: #fff !important; }
  /* .topbar نوار بالای همین صفحه‌هاست؛ بی آن در چاپ گزارش عوارض روی سربرگ گزارش می‌افتاد
     (ماده صد همین را در article100-report.css پنهان می‌کند). */
  .site-header, .topbar, .workflow, .header-actions, .form-actions, #global-alert { display: none !important; }
  .app-shell { display: block; }
  .workflow-panel:not(#report-section) { display: none !important; }
}

/* جهت سراسری: صفحات به صورت فرگمنت سرو میشوند و html بدون dir است. */
html { direction: rtl; }
