/* =============================================================================
   پارسی شو — حسابداری پیشرفته: هستهٔ مالی
   ============================================================================= */
.fin {
  margin: 22px 0 10px;
  padding: 16px;
  border: 1px solid #e3eaf3;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 22px 44px -38px rgba(15, 34, 55, .55);
}
.fin-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fin-head b { display: block; font-size: 14px; font-weight: 900; color: #16283b; }
.fin-head i { display: block; font-style: normal; font-size: 11px; color: #7b8797; margin-top: 3px; }
.fin-refresh { border: 1px solid #e3eaf3; background: #fff; color: #4b5b6e; font: inherit; font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.fin-refresh:hover { border-color: #c9d8e8; color: #1d4ed8; }

.fin-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.fin-tab { border: 1px solid #e3eaf3; background: #fff; color: #4b5b6e; font: inherit; font-size: 11.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.fin-tab.is-on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; box-shadow: 0 8px 18px -12px rgba(29, 78, 216, .9); }
.fin-loading, .fin-empty { padding: 20px; text-align: center; color: #6b7c90; font-size: 12px; border: 1px dashed #dbe5f1; border-radius: 12px; }
.fin-note { margin: 10px 2px 0; font-size: 10.5px; line-height: 1.9; color: #8a97a8; }

/* روش‌های پرداخت */
.fin-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fin-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid #e6edf6; border-radius: 13px; background: #fff; cursor: pointer; }
.fin-switch:hover { border-color: #cfe0f7; }
.fin-sw-tx b { display: block; font-size: 12.5px; font-weight: 800; color: #16283b; }
.fin-sw-tx i { display: block; font-style: normal; font-size: 10.5px; color: #7b8797; margin-top: 2px; line-height: 1.6; }
.fin-sw { position: relative; width: 44px; height: 24px; flex: 0 0 44px; }
.fin-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fin-knob { position: absolute; inset: 0; border-radius: 999px; background: #dfe8f3; transition: background .18s ease; }
.fin-knob::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 34, 55, .25); transition: transform .18s ease; }
.fin-sw input:checked + .fin-knob { background: #16a34a; }
.fin-sw input:checked + .fin-knob::after { transform: translateX(-20px); }
.fin-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fin-save { border: 0; border-radius: 10px; padding: 9px 18px; background: linear-gradient(120deg, #2563eb, #1d4ed8); color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .9); }
.fin-save:disabled { opacity: .6; cursor: default; }
.fin-msg { font-size: 11px; color: #0d7a5f; }

/* تفکیک */
.fin-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fin-card { position: relative; padding: 12px 14px; border-radius: 14px; border: 1px solid #e6edf6; background: #fff; overflow: hidden; }
.fin-card span { display: block; font-size: 10.5px; color: #7b8797; }
.fin-card b { display: block; font-size: 16px; font-weight: 900; color: #16283b; margin-top: 4px; font-variant-numeric: tabular-nums; }
.fin-card b small { font-size: 9px; font-weight: 700; color: #9aa6b5; }
.fin-card i { display: block; font-style: normal; font-size: 10px; color: #9aa6b5; margin-top: 3px; }
.fin-bar { height: 4px; border-radius: 99px; background: #eef2f7; margin-top: 8px; overflow: hidden; }
.fin-bar span { display: block; height: 100%; background: var(--c, #1d4ed8); border-radius: 99px; }

/* KPI */
.fin-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-kpi { padding: 12px 14px; border-radius: 13px; border: 1px solid #e6edf6; background: #fff; }
.fin-kpi span { display: block; font-size: 10.5px; color: #7b8797; }
.fin-kpi b { display: block; font-size: 18px; font-weight: 900; color: #16283b; margin-top: 3px; font-variant-numeric: tabular-nums; }
.fin-kpi i { display: block; font-style: normal; font-size: 10px; color: #9aa6b5; }
.fin-kpi.is-ok { border-color: #c7ecdd; background: #f2fcf7; }
.fin-kpi.is-ok b { color: #0d7a5f; }
.fin-kpi.is-err { border-color: #f6cccc; background: #fff7f7; }
.fin-kpi.is-err b { color: #b91c1c; }

/* جدول */
.fin-scroll { overflow-x: auto; }
.fin-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.fin-tbl th { text-align: right; font-weight: 800; color: #fff; background: linear-gradient(120deg, #1d4ed8, #2563eb); padding: 9px 10px; white-space: nowrap; }
.fin-tbl td { padding: 9px 10px; border-bottom: 1px solid #eef2f7; color: #26313f; }
.fin-tbl tr:hover td { background: #f8fbff; }
.fin-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-num.is-pos { color: #0d7a5f; font-weight: 800; }
.fin-num.is-neg { color: #b91c1c; font-weight: 800; }
.fin-ref { display: flex; gap: 6px; align-items: center; }
.fin-ref input { width: 110px; height: 30px; padding: 0 8px; border: 1px solid #e3eaf3; border-radius: 8px; font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; }
.fin-do { border: 0; border-radius: 8px; padding: 6px 12px; background: #b91c1c; color: #fff; font: inherit; font-size: 10.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.fin-do.is-ok { background: #16a34a; }
.fin-do:disabled { opacity: .6; cursor: default; }

html.ph-night .fin { background: #101f2f; border-color: #23394f; box-shadow: none; }
html.ph-night .fin-head b { color: #e6eef8; }
html.ph-night .fin-tab { background: #13263b; border-color: #24384d; color: #b9cbdd; }
html.ph-night .fin-tab.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
html.ph-night .fin-switch, html.ph-night .fin-card, html.ph-night .fin-kpi { background: #13263b; border-color: #24384d; }
html.ph-night .fin-sw-tx b, html.ph-night .fin-card b, html.ph-night .fin-kpi b { color: #e6eef8; }
html.ph-night .fin-tbl td { color: #dbe7f3; border-color: #23394f; }
html.ph-night .fin-tbl tr:hover td { background: #13263b; }
html.ph-night .fin-ref input { background: #13263b; border-color: #24384d; color: #e6eef8; }
html.ph-night .fin-loading, html.ph-night .fin-empty { background: #0f1e2e; border-color: #24384d; color: #9fb3c8; }

@media (max-width: 1023.98px) {
  .fin-methods { grid-template-columns: 1fr; }
  .fin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-kpis { grid-template-columns: 1fr; }
}
