/* FJN System — E1 block 10: E1-44 „Rozliczenie klienta” with its windows, E1-45 „Do faktury”. */

.fjn-settle { display: flex; flex-direction: column; gap: 14px; }
.fjn-settle__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fjn-settle__tile { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); }
.fjn-settle__tile span { font-size: 13px; color: var(--fjn-text-2); }
.fjn-settle__tile b { font-size: 22px; }
.fjn-settle__tile.is-negative b, .fjn-settle__tile.is-late b { color: var(--fjn-danger-700); }
.fjn-settle__tile.is-late { border-color: var(--fjn-danger-700); }
.fjn-settle__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fjn-settle__actions .fjn-btn[disabled] { background: var(--fjn-surface); color: #8A929C; border-color: var(--fjn-border); opacity: 1; }
.fjn-settle__consent { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; background: var(--fjn-neutral-100); border-radius: 8px; font-size: 14px; }
.fjn-settle__consent svg { flex: none; }
.fjn-settle__card { background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); overflow: hidden; }
.fjn-settle__cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; min-height: 40px; }
.fjn-settle__h2 { margin: 0; font-size: 15px; }
.fjn-settle__scope { font-size: 13px; color: var(--fjn-text-2); }
.fjn-settle__ops { margin: 0; padding: 0; list-style: none; }
.fjn-settle__op { display: grid; grid-template-columns: 60px minmax(0, 1fr) 120px; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--fjn-border); line-height: 18px; }
.fjn-settle__optext { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fjn-settle__optitle { font-size: 14px; }
.fjn-settle__optext span { font-size: 12px; color: var(--fjn-text-2); }
.fjn-settle__opdate { font-size: 14px; color: var(--fjn-text-2); }
.fjn-settle__opamount { text-align: right; font-size: 14px; }
.fjn-settle__opamount.is-in { color: var(--fjn-success-700); }
.fjn-settle__none { padding: 24px 16px; border-top: 1px solid var(--fjn-border); font-size: 14px; color: var(--fjn-text-2); text-align: center; }
.fjn-settle-card { border-color: var(--fjn-brand-600); }
.fjn-settle-card__dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 14px; }
.fjn-settle-card__dl dt { color: var(--fjn-text-2); }
.fjn-settle-card__dl dd { margin: 0; text-align: right; font-weight: 700; }
.fjn-settle-card__open { justify-content: center; width: 100%; margin-top: 12px; }
.fjn-tag--danger { background: var(--fjn-danger-100); color: var(--fjn-danger-700); font-weight: 700; }
@media (max-width: 1279px) {
  .fjn-settle__actions .fjn-btn { height: 56px; }
  .fjn-settle-card__open { height: 56px; }
}
@media (max-width: 767px) {
  .fjn-settle__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjn-settle__tile b { font-size: 18px; }
  .fjn-settle__actions { flex-wrap: nowrap; }
  .fjn-settle__actions .fjn-btn { flex: 1 1 0; justify-content: center; height: 48px; padding: 0 8px; }
  .fjn-settle__op { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .fjn-settle__optitle, .fjn-settle__optext span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fjn-settle-card__open { height: 48px; }
}

.fjn-paydlg { width: 480px; }
.fjn-paydlg__body { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.fjn-paydlg__title { margin: 0; font-size: 19px; }
.fjn-paydlg__field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.fjn-paydlg__field label, .fjn-paydlg__field legend { padding: 0; font-size: 14px; font-weight: 700; }
.fjn-paydlg__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fjn-paydlg .fjn-rel__amount { height: 44px; }
.fjn-paydlg .fjn-rel__form span { height: 44px; }
.fjn-paydlg__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
.fjn-paydlg__none { margin: 0; font-size: 14px; color: var(--fjn-text-2); }
@media (max-width: 767px) {
  .fjn-paydlg .fjn-rel__forms { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* D193: M 2 × 2 */
  .fjn-paydlg { width: 100%; max-width: 100%; } /* E1-44_M: the sheet fills the width */
  .fjn-paydlg__foot { flex-direction: column-reverse; }
  .fjn-paydlg__foot .fjn-btn { width: 100%; justify-content: center; min-height: 48px; }
}
.fjn-remdlg { width: 480px; }
.fjn-remdlg__head { display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 8px; }
.fjn-remdlg__title { margin: 0; font-size: 19px; }
.fjn-remdlg__sub { font-size: 14px; color: var(--fjn-text-2); }
.fjn-remdlg__body { display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 16px; }
.fjn-remdlg__field { display: flex; flex-direction: column; gap: 6px; }
.fjn-remdlg__field label, .fjn-remdlg__label { font-size: 14px; font-weight: 700; }
.fjn-remdlg__hint { font-size: 13px; color: var(--fjn-text-2); }
.fjn-remdlg__preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--fjn-border); border-radius: 8px; background: var(--fjn-bg); font-size: 14px; line-height: 21px; }
.fjn-remdlg__preview p { margin: 0; }

.fjn-inv { gap: 14px; }
.fjn-inv__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fjn-inv__heading { display: flex; align-items: baseline; gap: 12px; }
.fjn-inv__title { margin: 0; font-size: 28px; }
.fjn-inv__scope { font-size: 15px; color: var(--fjn-text-2); }
.fjn-inv__filters { display: flex; gap: 10px; flex-wrap: wrap; }
.fjn-inv__table { background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); overflow: hidden; }
.fjn-inv__row { display: grid; grid-template-columns: 48px 170px minmax(0, 1.4fr) 150px 110px 110px 190px; gap: 0 12px; align-items: center; min-height: 52px; padding: 0 16px; border-top: 1px solid var(--fjn-surface-2); font-size: 15px; }
.fjn-inv__row.is-checked { background: var(--fjn-brand-50); }
.fjn-inv__row--head { min-height: 40px; border-top: 0; background: var(--fjn-bg); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fjn-text-2); }
.fjn-inv__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fjn-inv__muted { color: var(--fjn-text-2); }
.fjn-inv__num { text-align: right; }
.fjn-inv__nr { height: 38px; }
.fjn-inv__check { position: relative; display: inline-flex; }
.fjn-inv__check input { position: absolute; opacity: 0; }
.fjn-inv__check i { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1.5px solid var(--fjn-border-strong); border-radius: 4px; color: transparent; }
.fjn-inv__check input:checked + i { border: 0; background: var(--fjn-brand-600); color: var(--fjn-text-inverse); }
.fjn-inv__check input:focus-visible + i { box-shadow: var(--fjn-focus); }
.fjn-inv__foot { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 12px 16px; background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); }
.fjn-inv__sum { font-size: 15px; font-weight: 700; }
.fjn-inv__hint { flex: 1; font-size: 13px; color: var(--fjn-text-2); text-align: right; }
.fjn-inv__export { height: 40px; }
.fjn-inv__none { padding: 16px; font-size: 14px; color: var(--fjn-text-2); }
.fjn-inv__main { display: contents; }
.fjn-inv__dot, .fjn-inv__sub, .fjn-inv__crumb, .fjn-inv__title--t, .fjn-inv__tfoot { display: none; }
/* D134 pt 5: tablet and phone — cards, filters Okres and Klient, footer „Zaznaczone n z m” */
@media (max-width: 1279px) {
  .fjn-inv { min-height: calc(100vh - var(--fjn-topbar-h)); gap: 12px; padding-bottom: 0; }
  .fjn-inv__crumb { display: flex; }
  .fjn-inv__title--t { display: block; margin: 0; font-size: 26px; }
  .fjn-inv__head, .fjn-inv__docfilter, .fjn-inv__foot, .fjn-inv__row--head, .fjn-inv__wide { display: none; }
  .fjn-inv__form { display: flex; flex: 1; flex-direction: column; }
  .fjn-inv__table { display: flex; flex-direction: column; gap: 8px; background: none; border: 0; overflow: visible; }
  .fjn-inv__row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; min-height: 60px; padding: 10px 14px; background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); }
  .fjn-inv__row.is-checked { background: var(--fjn-surface); border: 2px solid var(--fjn-brand-600); padding: 9px 13px; }
  .fjn-inv__main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; min-width: 0; }
  .fjn-inv__main > b { font-size: 15px; }
  .fjn-inv__dot { display: inline; }
  .fjn-inv__sub { display: block; grid-column: 1 / -1; font-size: 12px; color: var(--fjn-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fjn-inv__check i { width: 24px; height: 24px; }
  .fjn-inv__tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
  .fjn-inv__tsum { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--fjn-text-2); }
  .fjn-inv__tsum b { font-size: 20px; color: var(--fjn-text); }
  .fjn-inv__tfoot .fjn-btn { height: 56px; }
  .fjn-inv__none { background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); }
}
@media (max-width: 767px) {
  .fjn-inv { min-height: calc(100vh - var(--fjn-topbar-h-m) - var(--fjn-bottomnav-h)); }
  .fjn-inv__crumb, .fjn-inv__title--t { display: none; }
  .fjn-inv__filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjn-inv__tfoot { flex-direction: column; align-items: flex-start; }
  .fjn-inv__tfoot .fjn-btn { height: 48px; }
}

/* D139: E1-44a „Zaległe płatności” */
.fjn-due { gap: 14px; }
.fjn-due__head { display: flex; flex-direction: column; gap: 4px; }
.fjn-due__title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fjn-due__title { margin: 0; font-size: 28px; }
.fjn-due__sum { font-size: 15px; color: var(--fjn-text-2); }
.fjn-due__sum b { font-weight: 400; }
.fjn-due__filters { display: flex; gap: 10px; flex-wrap: wrap; }
.fjn-due__search { position: relative; display: flex; align-items: center; flex: 0 1 400px; }
.fjn-due__search svg { position: absolute; left: 12px; color: var(--fjn-text-2); }
.fjn-due__search input { width: 100%; padding-left: 36px; }
.fjn-due__table { background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); overflow: hidden; }
.fjn-due__row { display: grid; grid-template-columns: minmax(0, 2fr) 130px 130px 130px 40px; gap: 0 16px; align-items: center; min-height: 60px; padding: 6px 16px; border-top: 1px solid var(--fjn-surface-2); color: var(--fjn-text); font-weight: 400; text-decoration: none; }
.fjn-due__table--branch .fjn-due__row { grid-template-columns: minmax(0, 2fr) 150px 140px 150px 110px 48px; }
a.fjn-due__row:hover { background: var(--fjn-brand-50); }
.fjn-due__row--head { min-height: 40px; border-top: 0; background: var(--fjn-bg); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fjn-text-2); }
.fjn-due__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fjn-due__who b { color: var(--fjn-brand-600); font-size: 16px; }
.fjn-due__who span { font-size: 15px; color: var(--fjn-text-2); }
.fjn-due__num { text-align: right; }
.fjn-due__days { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.fjn-due__days i { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.fjn-due__days--warn { background: #FCEFD6; color: #8A5300; }
.fjn-due__days--late { background: #FBE6E4; color: var(--fjn-danger-700); }
.fjn-due__date, .fjn-due__branch { font-size: 14px; color: var(--fjn-text-2); }
.fjn-due__go { color: var(--fjn-text-2); display: flex; justify-content: flex-end; }
.fjn-due__hint { margin: 0; font-size: 14px; color: var(--fjn-text-2); }
.fjn-due__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); text-align: center; }
.fjn-due__empty b { font-size: 17px; }
.fjn-due__empty span:last-child { font-size: 14px; color: var(--fjn-text-2); }
.fjn-due__empty-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 8px; background: var(--fjn-success-100); color: var(--fjn-success-700); }
@media (max-width: 767px) {
  .fjn-due__title-row { justify-content: space-between; }
  .fjn-due__sum { display: flex; justify-content: space-between; width: 100%; }
  .fjn-due__sum b { font-size: 18px; font-weight: 700; color: var(--fjn-text); }
  .fjn-due__filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjn-due__search { grid-column: 1 / -1; }
  .fjn-due__table { display: flex; flex-direction: column; gap: 10px; background: none; border: 0; overflow: visible; }
  .fjn-due__row--head { display: none; }
  .fjn-due__row, .fjn-due__table--branch .fjn-due__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who num" "who days"; gap: 6px 10px; padding: 14px 16px; background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: var(--fjn-r-lg); }
  .fjn-due__who { grid-area: who; }
  .fjn-due__num { grid-area: num; }
  .fjn-due__dayscell { grid-area: days; justify-self: end; }
}
.fjn-due__sort { display: inline-flex; align-items: center; gap: 4px; color: var(--fjn-text); text-decoration: none; }
