/* Payments workspace v2 ("Wer hat diesen Monat bezahlt?"): one page, totals first, one charge per row.
   Design source: docs/design/zahlungen-v2. Colours and sizes come from the shared tokens (--ui-*); light, dark and the
   HAYO brand follow theme.css. Every red fill carries white text (--ui-on-action). Main case: office desktop; also 375 px. */
.pv-body { --pv-soft: var(--ui-soft); font-family: var(--ui-font); }
.pv-body .pv-shell { max-width: 80rem; }
.pv-body [hidden] { display: none !important; }
.pv-body .pv-shell :is(a, button, input, select, [tabindex="-1"]):focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
.pv-body .pv-shell h1:focus, .pv-body .pv-shell h2:focus, .pv-body .pv-shell :is(h1, h2)[tabindex="-1"]:focus-visible { outline: none; }
.pv-body .pv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.pv-body .pv-skip { position: absolute; left: -999px; top: 0; min-height: 48px; padding: .6rem 1rem; background: var(--ui-surface); color: var(--ui-ink); border: 2px solid var(--ui-focus); z-index: 10; }
.pv-body .pv-skip:focus { left: .5rem; top: .5rem; }

/* Heading and month */
.pv-body .pv-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.pv-body .pv-eyebrow { margin: 0 0 .4rem; color: var(--ui-primary); font-size: .8rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.pv-body.ui .pv-heading h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.08; }
.pv-body .pv-month label { display: grid; gap: .3rem; font-weight: 700; }
.pv-body .pv-month input, .pv-body .pv-search input, .pv-body .pv-field input { min-height: 48px; width: 100%; padding: .55rem .8rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-small);
  background: var(--ui-surface); color: var(--ui-ink); font: inherit; }
.pv-body .pv-month input { min-width: 12.5rem; font-weight: 650; }
.pv-body .pv-howto { display: flex; gap: .9rem; align-items: baseline; max-width: none; margin: 0 0 1.25rem; padding: .9rem 1.2rem; border-radius: var(--ui-radius-small); background: var(--pv-soft); }
.pv-body .pv-howto strong { flex-shrink: 0; }
.pv-body .pv-alert, .pv-body .pv-status:not(:empty) { max-width: none; margin: 0 0 1rem; padding: .8rem 1.1rem; border-radius: var(--ui-radius-small); font-weight: 650; }
.pv-body .pv-alert { background: var(--ui-warn-bg); color: var(--ui-warn); }
.pv-body .pv-status:not(:empty) { background: var(--ui-success-bg); color: var(--ui-success); }
.pv-body .pv-card { padding: 1.2rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); }

/* Three totals */
.pv-body .pv-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pv-body .pv-total { position: relative; padding: 1rem 1.2rem 1.15rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); overflow: hidden; }
.pv-body .pv-total::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .35rem; background: var(--pv-accent, var(--ui-ink)); }
.pv-body .pv-total-expected { --pv-accent: var(--ui-ink); }
.pv-body .pv-total-paid { --pv-accent: var(--ui-success); }
.pv-body .pv-total-open { --pv-accent: var(--ui-warn); }
.pv-body .pv-total-head { min-height: 2.2rem; padding-right: 2.2rem; font-size: 1.05rem; }
.pv-body .pv-total strong { display: block; margin-top: .4rem; font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pv-body .pv-total-paid strong { color: var(--ui-success); }
.pv-body .pv-total-open strong { color: var(--ui-warn); }
.pv-body .pv-scope { max-width: none; margin: .6rem 0 1.4rem; color: var(--ui-muted); font-size: .92rem; }
.pv-body .pv-total .hint-text { grid-column: auto; font-size: .92rem; }

/* Tabs */
.pv-body .pv-tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--ui-line); margin-bottom: 1.2rem; }
.pv-body .pv-tab { min-height: 48px; padding: .6rem 1.4rem; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ui-ink); font: inherit; font-weight: 700; cursor: pointer; margin-bottom: -1px; }
.pv-body .pv-tab[aria-selected="true"] { border-bottom-color: var(--ui-primary); color: var(--ui-primary); }

/* Panel head, filters, search */
.pv-body .pv-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pv-body .pv-panel-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-right: 2.2rem; }
.pv-body .pv-panel-title h2 { font-size: 1.5rem; }
.ui .pv-panel-title > .hint-btn { position: static; }
.pv-body .hint-btn { width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
.pv-body .pv-field[data-hint] { grid-template-columns: minmax(0, 1fr) 3rem; column-gap: .5rem; }
.pv-body .pv-field[data-hint] > span { grid-column: 1; align-self: center; }
.pv-body .pv-field[data-hint] > .hint-btn { position: static; grid-column: 2; grid-row: 1; width: 3rem; height: 3rem; min-height: 3rem; }
.pv-body .pv-field[data-hint] > input { grid-column: 1 / -1; }
.pv-body .pv-panel-title .hint-text { flex-basis: 100%; }
.pv-body .pv-filters { display: flex; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.pv-body .pv-filters label { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 5rem; padding: .5rem 1.1rem; border: 1px solid var(--ui-line);
  border-radius: 999px; background: var(--ui-surface); font-weight: 700; cursor: pointer; }
.pv-body .pv-filters input { position: absolute; opacity: 0; pointer-events: none; }
.pv-body .pv-filters label:has(input:checked) { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-bg); }
.pv-body .pv-filters label:has(input:focus-visible) { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
.pv-body .pv-search { display: block; margin-bottom: .6rem; }
.pv-body .pv-count { max-width: none; margin: 0 0 .6rem; color: var(--ui-muted); font-size: .9rem; }
.pv-body .pv-count:empty { display: none; }

/* Charge rows */
.pv-body .pv-list-head, .pv-body .pv-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 1.5rem; gap: 1rem; align-items: center; }
.pv-body .pv-list-head { padding: .5rem 1rem; border-bottom: 1px solid var(--ui-line); color: var(--ui-muted); font-size: .85rem; font-weight: 700; }
.pv-body .pv-list-head span:last-child { grid-column: 3; text-align: right; }
.pv-body .pv-list { list-style: none; margin: 0; padding: 0; }
.pv-body .pv-list li { border-bottom: 1px solid var(--ui-line); }
.pv-body .pv-row { width: 100%; min-height: 48px; padding: 1rem; border: 0; background: transparent; color: var(--ui-ink); font: inherit; font-weight: 400; text-align: left; cursor: pointer; }
.pv-body .pv-row:hover { background: var(--pv-soft); }
.pv-body .pv-who strong, .pv-body .pv-amount strong { display: block; font-size: 1.15rem; font-weight: 750; overflow-wrap: anywhere; }
.pv-body .pv-who span, .pv-body .pv-amount span { display: block; color: var(--ui-muted); font-size: .92rem; font-weight: 400; overflow-wrap: anywhere; }
.pv-body .pv-amount { text-align: right; font-variant-numeric: tabular-nums; }
.pv-body .pv-amount strong { font-size: 1.3rem; }
.pv-body .pv-go { color: var(--ui-muted); font-size: 1.6rem; }
.pv-body .pv-state-col { display: grid; gap: .3rem; justify-items: start; }
.pv-body .pv-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; border-radius: 999px; font-weight: 750; font-size: .95rem; }
.pv-body .pv-chip-paid { background: var(--ui-success-bg); color: var(--ui-success); }
.pv-body .pv-chip-open { background: var(--ui-warn-bg); color: var(--ui-warn); }
.pv-body .pv-chip-overdue { background: var(--ui-danger-bg); color: var(--ui-danger); }
.pv-body .pv-state-col .pv-sub { color: var(--ui-muted); font-size: .9rem; }

/* States */
.pv-body .pv-state { display: grid; gap: .5rem; justify-items: center; margin-top: 1rem; padding: 1.5rem; border: 1px dashed var(--ui-line); border-radius: var(--ui-radius-small); color: var(--ui-muted); text-align: center; }
.pv-body .pv-state strong { color: var(--ui-ink); font-size: 1.1rem; }
.pv-body .pv-error { border-style: solid; border-color: var(--ui-danger); background: var(--ui-danger-bg); }
.pv-body .pv-error strong { color: var(--ui-danger); }

/* More */
.pv-body .pv-more { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.pv-body .pv-more-card { display: grid; gap: .5rem; align-content: start; height: 100%; padding: 1.2rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); text-decoration: none; }
.pv-body .pv-more-card:hover { border-color: var(--ui-primary); }
.pv-body .pv-more-card strong { font-size: 1.2rem; }
.pv-body .pv-more-card span { color: var(--ui-muted); }
.pv-body .pv-more-card .pv-more-go { color: var(--ui-primary); font-weight: 750; margin-top: .3rem; }

/* Buttons and links */
.pv-body .pv-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.3rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-small);
  background: var(--ui-surface); color: var(--ui-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.pv-body .pv-button:hover:not(:disabled) { border-color: var(--ui-primary); }
.pv-body .pv-button.primary { background: var(--ui-action); border-color: var(--ui-action); color: var(--ui-on-action); }
.pv-body .pv-button.quiet { background: transparent; }
.pv-body .pv-button:disabled { opacity: .55; cursor: not-allowed; }
.pv-body .pv-link { display: inline-flex; align-items: center; min-height: 48px; color: var(--ui-primary); font-weight: 700; }
.pv-body .pv-back { margin-top: 2rem; }

/* Dialogs */
.pv-body .pv-dialog { width: min(100% - 2rem, 34rem); max-height: calc(100dvh - 2rem); padding: 1.4rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow); }
.pv-body .pv-dialog::backdrop { background: color-mix(in srgb, var(--ui-band) 68%, transparent); }
.pv-body .pv-dialog p { max-width: none; line-height: 1.5; }
.pv-body .pv-dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.pv-body .pv-dialog-top h2 { font-size: 1.7rem; letter-spacing: -.02em; }
.pv-body .pv-close { width: 48px; height: 48px; flex-shrink: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-small); background: var(--ui-surface); color: var(--ui-ink); font-size: 1.3rem; cursor: pointer; }
.pv-body .pv-summary { display: grid; gap: .25rem; margin: 1rem 0; padding: 1rem 1.2rem; border-radius: var(--ui-radius-small); background: var(--pv-soft); }
.pv-body .pv-summary div { display: flex; justify-content: space-between; gap: 1rem; }
.pv-body .pv-summary dt { color: var(--ui-muted); }
.pv-body .pv-summary dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pv-body .pv-detail-chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pv-body .pv-dialog h3 { margin: 1.2rem 0 .3rem; }
.pv-body .pv-hint { color: var(--ui-muted); font-size: .95rem; margin: .2rem 0 .6rem; }
.pv-body .pv-ok { padding: .8rem 1rem; border-radius: var(--ui-radius-small); background: var(--ui-success-bg); color: var(--ui-success); font-weight: 700; }
.pv-body .pv-note { padding: .75rem 1rem; border-left: 4px solid var(--ui-warn); background: var(--ui-warn-bg); color: var(--ui-ink); }
.pv-review { display: grid; gap: .5rem; margin: .75rem 0; padding: .75rem 1rem; border-left: 4px solid var(--ui-warn); background: var(--ui-warn-bg); color: var(--ui-ink); }
.pv-review h3 { margin: 0; }
.pv-review[hidden], .pv-review [hidden] { display: none !important; }
.pv-review p { margin: 0; overflow-wrap: anywhere; }
.pv-review-confirm { display: grid; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--ui-line); }
.pv-body .pv-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.pv-body .pv-actions-stack { flex-direction: column; align-items: stretch; margin-top: .6rem; }
.pv-body .pv-form-error { min-height: 1.3rem; margin: .5rem 0 0; color: var(--ui-danger); font-weight: 700; }
.pv-body .pv-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.pv-body .pv-field { display: grid; gap: .3rem; align-content: start; font-weight: 700; }
.pv-body .pv-field input.german-date { min-height: 48px; }
.pv-body .pv-methods { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0 0 1rem; padding: 0; border: 0; }
.pv-body .pv-methods legend { margin-bottom: .4rem; padding: 0; font-weight: 700; }
.pv-body .pv-methods label { display: flex; align-items: center; gap: .6rem; min-height: 56px; padding: .6rem 1rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-small); cursor: pointer; font-weight: 650; }
.pv-body .pv-methods input { width: 1.2rem; height: 1.2rem; accent-color: var(--ui-action); }
.pv-body .pv-methods label:has(input:checked) { border-color: var(--ui-primary); background: var(--pv-soft); }
.pv-body .pv-methods label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pv-body .pv-payment-options { grid-column: 1 / -1; display: grid; gap: .7rem; }
.pv-body .pv-preview { min-height: 1.4rem; color: var(--ui-muted); font-size: .95rem; margin: 0; }
.pv-body .pv-dialog .hint-text { grid-column: 1 / -1; }

@media (max-width: 64rem) {
 .pv-body .pv-list-head { display: none; }
  .pv-body .pv-row { grid-template-columns: minmax(0, 1fr) auto 1.2rem; grid-template-areas: "who amount go" "state state state"; row-gap: .5rem; }
  .pv-body .pv-who { grid-area: who; }
  .pv-body .pv-amount { grid-area: amount; }
  .pv-body .pv-go { grid-area: go; }
  .pv-body .pv-state-col { grid-area: state; grid-auto-flow: column; justify-content: start; align-items: center; }
}

@media (max-width: 40rem) {
 .pv-body .pv-heading { align-items: stretch; }
  .pv-body .pv-month input { width: 100%; }
  .pv-body .pv-howto { flex-direction: column; gap: .3rem; }
  .pv-body .pv-totals { grid-template-columns: 1fr; gap: .6rem; }
  .pv-body .pv-total { padding: .7rem 1rem .95rem; }
  .pv-body .pv-total-head { min-height: 0; }
  .pv-body .pv-total .hint-btn { width: 3rem; height: 3rem; min-height: 3rem; top: 0; }
  .pv-body .pv-total strong { margin-top: .1rem; font-size: 1.7rem; }
  .pv-body .pv-tab { flex: 1; }
  .pv-body .pv-row { grid-template-columns: minmax(0, 1fr) 1.2rem; grid-template-areas: "who go" "state go" "amount go"; }
  .pv-body .pv-amount { text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
  .pv-body .pv-amount strong, .pv-body .pv-amount span { display: inline; }
  .pv-body .pv-filters { width: 100%; }
  .pv-body .pv-filters label { flex: 1; min-width: 0; padding-inline: .5rem; }
  .pv-body .pv-fields, .pv-body .pv-methods { grid-template-columns: 1fr; }
  .pv-body .pv-dialog { padding: 1.1rem; }
  .pv-body .pv-dialog-top h2 { font-size: 1.4rem; }
  .pv-body .pv-actions:not(.pv-actions-stack) { flex-direction: column-reverse; }
  .pv-body .pv-actions .pv-button { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
 .pv-body .pv-row, .pv-body .pv-more-card, .pv-body .pv-button { transition: background-color .15s, border-color .15s; }
}
