/* Ügyfélportál – Inaktív lakások (#portal-inactive) és Szennyes-ellenőrzés (#portal-laundry).
   A portál admin-apartments.css-éből átvéve, „pp-” előtaggal; a közös po-* osztályok a portal-ops.css-ben. */

.pp-headrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pp-note { display: flex; flex: 1 1 340px; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.pp-note .po-icon { margin-top: 1px; }
.pp-tabs button b { padding: 1px 7px; border-radius: 9px; background: rgba(40, 87, 107, .1); font-size: 11px; }
.pp-tabs button.active b { background: rgba(255, 255, 255, .22); }
.po-stat.pp-stat-bad b { color: var(--bad); }
.po-stat.pp-stat-good b { color: var(--good); }

/* Eszköztár: a Hub alap select/input szélessége 100%, itt tartalomhoz igazodik */
.pp-toolbar select { width: auto; min-width: 140px; max-width: 220px; min-height: 36px; }
.pp-toolbar .po-search { min-width: 170px; flex-basis: 190px; }
.pp-toolbar > .button { display: inline-flex; align-items: center; gap: 5px; }
.pp-check { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #cedae0; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 650; white-space: nowrap; }
.pp-check input { width: 16px; height: 16px; min-height: 0; flex: none; margin: 0; padding: 0; box-shadow: none; accent-color: var(--blue-dark); }

/* Rendezhető fejléc */
.pp-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.pp-sort:hover, .pp-sort.active { color: var(--blue-deep); }
.pp-sort .po-icon { width: 13px; height: 13px; stroke-width: 2.4; }

/* Táblák */
.pp-table table { min-width: 0; table-layout: auto; }
.pp-table th, .pp-table td { padding: 10px 8px; }
.pp-table th { white-space: nowrap; }
.pp-table th:first-child, .pp-table td:first-child { padding-left: 14px; }
.pp-table th:last-child, .pp-table td:last-child { padding-right: 14px; }
.pp-table td { vertical-align: top; }
.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table tbody tr:hover td { background: #fbfdfe; }
.pp-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; overflow-wrap: anywhere; }
.pp-nowrap { white-space: nowrap; }
.pp-tenant-link { color: var(--blue-deep); font-weight: 800; text-decoration: none; }
.pp-tenant-link:hover { text-decoration: underline; }
.pp-apartment strong { display: block; font-size: 12.5px; line-height: 1.35; }
.pp-apartment .badge { min-height: 19px; margin-top: 3px; padding: 1px 7px; font-size: 9.5px; }
.pp-inactive-table th:nth-child(1) { width: 12%; }
.pp-inactive-table th:nth-child(2) { width: 22%; }
.pp-inactive-table th:nth-child(5) { width: 12%; }
.pp-inactive-table th:nth-child(6) { width: 14%; }
.pp-inactive-table th:nth-child(7) { width: 15%; }
.pp-actions { width: 1%; text-align: right; white-space: nowrap; }
.pp-table .button.small { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pp-table .button.small .po-icon { width: 15px; height: 15px; }
@media (min-width: 1101px) and (max-width: 1599px) { .pp-inactive-table .pp-actions .button .po-icon { display: none; } }

.pp-days { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 9px; border-radius: 12px; background: #edf1f3; color: #52646c; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-days.warn { background: var(--warn-bg); color: var(--warn); }
.pp-days.bad { background: var(--bad-bg); color: var(--bad); }
.pp-days.none { background: transparent; color: var(--muted); }

/* Kis ikongombok (részletezés, törlés) */
.pp-icon-btn { display: inline-grid; width: 28px; height: 28px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; }
.pp-icon-btn .po-icon { width: 15px; height: 15px; }
.pp-icon-btn.pp-info:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.pp-icon-btn.pp-doc-delete { width: 30px; height: 30px; color: var(--bad); }
.pp-icon-btn.pp-doc-delete:hover { border-color: #f0c9c7; background: var(--bad-bg); }

/* Bérleti díj cella */
.pp-fee { display: flex; align-items: flex-start; gap: 6px; }
.pp-fee > div { display: grid; min-width: 0; justify-items: start; }
.pp-amount { color: var(--bad); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-free { color: var(--good); font-size: 12px; font-weight: 750; }
.pp-missing { margin-top: 4px; }

/* Visszavételi jegyzőkönyv cella */
.pp-doc { display: grid; gap: 6px; min-width: 0; }
.pp-doc.legacy { justify-items: start; gap: 4px; }
.pp-doc.legacy small { color: var(--muted); font-size: 10.5px; overflow-wrap: anywhere; }
.pp-doc-link { display: flex; min-width: 0; align-items: flex-start; gap: 7px; color: var(--blue-deep); text-decoration: none; }
.pp-doc-link .po-icon { width: 18px; height: 18px; margin-top: 1px; }
.pp-doc-link > span { display: grid; min-width: 0; }
.pp-doc-link strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.pp-doc-link small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.pp-doc-link:hover strong { text-decoration: underline; }
.pp-doc-actions { display: flex; align-items: center; gap: 6px; }
.pp-uploading { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; font-weight: 650; }

/* Üres állapot és betöltés */
.pp-empty { padding: 18px 14px; }
.pp-empty .pp-empty-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue-dark); }
.pp-empty .pp-empty-icon .po-icon { width: 20px; height: 20px; }
.pp-empty h3 { font-size: 15px; }
.pp-empty p { max-width: 430px; margin: 0; font-size: 12px; }
.pp-loading { display: flex; min-height: 92px; align-items: center; justify-content: center; gap: 10px; padding: 14px; color: var(--muted); font-size: 12.5px; }

/* Részletező ablak */
.po-modal.pp-modal { width: min(650px, calc(100vw - 30px)); }
.pp-fee-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pp-fee-summary > div { display: grid; min-width: 0; align-content: start; gap: 1px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.pp-fee-summary span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .4px; }
.pp-fee-summary b { color: var(--blue-deep); font-size: 15px; font-variant-numeric: tabular-nums; }
.pp-fee-summary small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.pp-lines { display: grid; gap: 6px; }
.pp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.pp-line > div { display: grid; min-width: 0; }
.pp-line strong { font-size: 12.5px; }
.pp-line span { color: var(--muted); font-size: 11px; }
.pp-line small { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.pp-line > b { color: var(--bad); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-line.missing { border-style: dashed; background: #fffcf6; }
.pp-modal .pp-note { margin: 14px 0 0; font-size: 11px; line-height: 1.5; }

/* Szennyes-ellenőrzés: időszak-választó */
.pp-period { display: grid; gap: 8px; padding: 8px 12px; }
.pp-period-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pp-period-selects { display: flex; gap: 6px; }
.pp-period-selects select { width: 96px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
.pp-period-selects select:last-child { width: 130px; }
.pp-period-label { display: flex; flex: 1 1 260px; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.pp-period-label strong { color: var(--blue-deep); font-size: 14px; }
.pp-period-label small { color: var(--muted); font-size: 11px; }
.pp-period-top > .button { display: inline-flex; align-items: center; gap: 5px; }
.pp-period-top > .button .po-icon { width: 15px; height: 15px; }
.pp-period-top > .button:disabled { opacity: .5; cursor: default; }
.pp-day-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; }
.pp-day { min-width: 0; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.pp-day:hover:not([disabled]) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.pp-day.in-range { border-color: #c7dfe8; background: var(--blue-soft); color: var(--blue-deep); }
.pp-day.edge { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }
.pp-day[disabled] { background: #f6f8f9; color: #b7c2c7; cursor: not-allowed; }
.pp-hint { display: inline-grid; place-items: center; color: var(--muted); cursor: help; }
.pp-hint .po-icon { width: 17px; height: 17px; }

/* Termék-chipek */
.pp-items { min-width: 260px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pp-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-deep); font-size: 10.5px; white-space: normal; }
.pp-chip.textile { background: var(--warn-bg); color: var(--warn); }
.pp-chip.pickup { background: var(--good-bg); color: var(--good); font-weight: 750; }
.pp-chip.fee { background: #edf1f3; color: #697a82; }
.pp-chip.more { border: 1px dashed #c9d6dc; background: #fff; color: var(--muted); cursor: help; }
.pp-laundry-table th:nth-child(1) { width: 20%; }
.pp-laundry-table th:nth-child(2) { width: 14%; }
.pp-laundry-table th:nth-child(4) { width: 15%; }

/* Közepes szélesség: a táblázat helyett kártyák (nincs vízszintes görgetés) */
@media (max-width: 1100px) {
  .pp-table.table-wrap { overflow: visible; }
  .pp-table table, .pp-table tbody, .pp-table tr, .pp-table td { display: block; width: auto; min-width: 0; }
  .pp-table thead { display: none; }
  .pp-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
  .pp-table tbody tr:last-child { border-bottom: 0; }
  .pp-table tbody tr:hover td { background: none; }
  .pp-table td, .pp-table td:first-child, .pp-table td:last-child { padding: 0; border: 0; }
  .pp-table td[data-label]::before { display: block; margin-bottom: 3px; color: var(--muted); content: attr(data-label); font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
  .pp-table td.pp-apartment { grid-column: span 2; grid-row: 1; }
  .pp-inactive-table td:first-child { grid-column: 3; grid-row: 1; }
  .pp-table td.pp-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px dashed var(--line); text-align: left; }
  .pp-table td.pp-actions .button { width: 100%; justify-content: center; }
  .pp-laundry-table td.pp-items { grid-column: 1 / -1; min-width: 0; }
  .pp-fee-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .pp-headrow { flex-direction: column; align-items: stretch; }
  .pp-headrow .pp-note { flex: none; }
  .pp-page .pp-tabs { display: grid; width: 100%; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; }
  .pp-page .pp-tabs button { min-width: 0; justify-content: center; gap: 5px; padding: 8px 4px; line-height: 1.25; text-align: center; white-space: normal; }
  .pp-page .pp-tabs button b { flex: none; padding: 1px 6px; }
  .pp-page .pp-toolbar .pp-tabs { grid-template-columns: minmax(0, 1fr) auto; grid-auto-columns: auto; }
  .pp-page .pp-toolbar select, .pp-page .pp-check { width: 100%; max-width: none; }
  .pp-page .pp-toolbar .po-search { max-width: none; }
  .pp-page .pp-toolbar .po-spacer { display: none; }
  .pp-page .pp-toolbar > .button { flex: 1 1 100%; justify-content: center; }
  .pp-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .pp-table td.pp-apartment { grid-column: 1 / -1; }
  .pp-inactive-table td:first-child { grid-column: 1 / -1; grid-row: auto; }
  .pp-period { padding: 10px; }
  .pp-period-selects { width: 100%; }
  .pp-period-selects select, .pp-period-selects select:last-child { width: auto; flex: 1; }
  .pp-period-top > .button { width: 100%; justify-content: center; }
  .pp-day-chips { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pp-day { height: 36px; }
}

@media (max-width: 430px) {
  .pp-table tr { grid-template-columns: minmax(0, 1fr); }
  .pp-fee-summary > div { padding: 9px; }
  .pp-line { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pp-line > b { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) { .pp-day { transition: none; } }
