/* products/rpt/css/screens.css — this product's own screens. */

.rpt-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 20px);
}

.rpt-list { margin: 0; padding-left: 1.2em; }
.rpt-list__item { margin: 0.2em 0; }

.rpt-rule { color: var(--text-secondary); }

.rpt-actions { display: flex; gap: var(--space-sm, 8px); flex-wrap: wrap; margin-top: var(--space-md, 12px); }
.rpt-field--check { display: flex; align-items: center; gap: var(--space-sm, 8px); }

.rpt-table { width: 100%; border-collapse: collapse; margin-top: var(--space-sm, 8px); }
.rpt-table th, .rpt-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}
.rpt-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Capital spending is marked by a word in its own column, never by colour
   alone — this list gets printed and photocopied. The tint is a second
   signal, not the only one. */
.rpt-row--capital { background: var(--surface-canvas); }

.rpt-row--head td { font-weight: 600; }
.rpt-row--total td { font-weight: 600; border-top: 2px solid var(--border-hairline); }

/* Capital is marked by its LABEL, which says what it is in words. The tint is
   a second signal for people who can see it, never the only one — this page
   gets printed and photocopied. */
.rpt-row--capital td { background: var(--surface-canvas); font-style: italic; }

.rpt-rent-row { margin-bottom: var(--space-lg, 20px); }
.rpt-basis { font-style: italic; }

/* ---------------------------------------------------------------------------
 * GRIDS — typing several things at once.
 *
 * The column heading is the label, so the cells have to line up under it and
 * stay narrow enough that six columns fit without the page scrolling sideways.
 * The table scrolls inside its own container instead, which is the only place
 * a sideways scroll is acceptable.
 * ------------------------------------------------------------------------- */
.rpt-grid { table-layout: auto; }
.rpt-grid th { white-space: nowrap; }
.rpt-grid td { padding: 4px 6px; vertical-align: middle; }
.rpt-grid__input { width: 100%; min-width: 7ch; padding: 4px 6px; font-size: 0.95em; }
.rpt-grid__input.is-inactive { opacity: 0.45; }
.rpt-grid__narrow { width: 1%; }

.rpt-obligations__add {
  display: flex;
  gap: var(--space-sm, 8px);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--space-md, 12px);
}
.rpt-obligations__add .rpt-grid__input { width: auto; min-width: 12ch; }
.rpt-obligations__name-holder { display: contents; }
.rpt-obligations__rules { margin-top: var(--space-sm, 8px); }
.rpt-obligations__what,
.rpt-obligations__due,
.rpt-diary__what { display: flex; flex-direction: column; gap: 2px; }
.rpt-obligations__name,
.rpt-diary__title { font-weight: 600; }

/* A month with nothing in it is still a row, and reads as quieter than one
   that has something in it — the gap is information. */
.rpt-row--quiet td { color: var(--text-secondary); }

/* Finance costs sit below the total they are not part of, marked the same way
   capital is: by their own label first, and a tint second. */
.rpt-row--aside td { font-style: italic; }

.rpt-diary__late { color: var(--status-attention-text, var(--accent-coral)); font-weight: 600; }

/* A table that cannot fit scrolls inside its card rather than taking the page
   sideways with it. */
.rpt-obligations .rpt-table,
.rpt-grid { display: block; overflow-x: auto; max-width: 100%; }
@media (min-width: 900px) {
  .rpt-grid { display: table; }
}

/* A chip says how close something is. It never wraps: "113 days ago" broken
   across two lines in a narrow column reads as two separate facts. */
.rpt-obligations .status-chip,
.rpt-diary__what + td .status-chip,
.rpt-grid .status-chip { white-space: nowrap; }

/* A property name is the thing that tells two rows apart, so the picker that
   holds one gets room for it rather than the width the table would give it. */
.rpt-grid select.rpt-grid__input { min-width: 13ch; }

/* A money cell holds "12,450.00" and is typed into. It gets the room for the
   longest figure a landlord will enter, and the digits line up down the
   column so a mistyped one is visible. */
.rpt-grid__input--money {
  min-width: 11ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Two buttons that are one control. The chosen one carries aria-pressed as
   well as the colour, so the choice is readable without seeing it. */
.rpt-basis-switch {
  display: flex;
  gap: var(--space-sm, 8px);
  flex-wrap: wrap;
  margin: var(--space-sm, 8px) 0 var(--space-md, 12px);
}

/* A row open for editing. Marked by a tint AND a left edge, because a row that
   behaves differently from its neighbours must not rely on colour alone. */
.rpt-row--editing td {
  background: var(--surface-canvas);
  vertical-align: top;
}
.rpt-row--editing td:first-child { box-shadow: inset 3px 0 0 var(--accent-teal); }

/* The kind and its SA105 box, stacked in one cell. */
.rpt-edit-stack { display: flex; flex-direction: column; gap: 4px; }

/* Edit and Remove belong on ONE line. Wrapping them doubled the height of
   every row in the list, which is most of the length of a screen that is
   mostly list. */
.rpt-grid .rpt-actions {
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 0;
}
.rpt-grid .rpt-actions .button {
  padding: 4px 10px;
  font-size: 0.9em;
  white-space: nowrap;
}

/* A chip sizes to its words. Inside a flex column it stretched the full width
   of its cell, which made "In 68 days" read as a progress bar. */
.rpt-obligations__due,
.rpt-obligations__what,
.rpt-diary__what { align-items: flex-start; }

/* The way back, above the heading of a property's own page. */
.rpt-backbar { margin-bottom: calc(-1 * var(--space-sm, 8px)); }

/* A property's name in a table, which opens its page. A real <button>, because
   it does something rather than going somewhere a link could describe — styled
   as a link so it reads as the way in. */
.rpt-linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-teal-text, var(--accent-teal));
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
}
.rpt-linkish:hover { text-decoration-thickness: 2px; }

/* Tenancies sit INSIDE their property's card. The inner cards lose their own
   shadow and border so the group reads as one thing with parts, rather than
   three cards that happen to be adjacent. */
.rpt-tenancy-group__list { display: flex; flex-direction: column; gap: var(--space-md, 12px); margin-top: var(--space-md, 12px); }
.rpt-tenancy-group__list > .card {
  box-shadow: none;
  border: 1px solid var(--border-hairline);
  background: var(--surface-canvas);
}

/* The tenant's name at the top of an open tenancy. A collapsed card shows it
   in its summary; an open one showed nothing at all. */
.rpt-tenancy__name { margin: 0 0 var(--space-sm, 8px); }

/* The diary's own controls: how far ahead, and what to show. */
.rpt-diary-custom { display: flex; align-items: center; gap: var(--space-sm, 8px); margin-bottom: var(--space-sm, 8px); }
.rpt-diary-custom input { max-width: 8ch; }
.rpt-diary-kinds { display: flex; gap: var(--space-lg, 20px); flex-wrap: wrap; margin-bottom: var(--space-md, 12px); }
.rpt-diary-kinds label { display: flex; align-items: center; gap: 6px; }
.rpt-diary__beyond { display: flex; align-items: center; gap: var(--space-sm, 8px); flex-wrap: wrap; margin-top: var(--space-sm, 12px); }

/* An EXPECTED cost is not a record. Marked by its own words in the row first —
   "expected, not recorded" — and by a dashed edge second, never colour alone. */
.rpt-row--expected td { font-style: italic; }
.rpt-row--expected td:first-child { box-shadow: inset 3px 0 0 var(--border-hairline); }

.rpt-recurring { font-size: 0.9em; white-space: nowrap; }

/* ---------------------------------------------------------------------------
   GUEST STAYS [26 September 2026]
   ------------------------------------------------------------------------ */

/* The add form is a wrapping row of labelled fields rather than the bare row of
   controls the obligations form uses. A stay has six things in it, and six
   unlabelled boxes side by side is a puzzle — the labels are what make it
   answerable without opening the guide. */
.rpt-stays__add {
  display: flex;
  gap: var(--space-md, 12px);
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: var(--space-md, 12px);
}
.rpt-stays__add-field { display: flex; flex-direction: column; gap: 2px; }
.rpt-stays__add .rpt-grid__input { width: auto; min-width: 14ch; }

/* The reconciliation line, which is the point of the form: it appears as soon as
   there is an amount to work with, so seeing it agree with a bank statement is
   how a landlord knows they entered the guest's payment and not the payout. */
.rpt-stays__check:not(:empty) {
  margin-top: var(--space-sm, 8px);
  font-weight: 600;
}

/* Two stacked fields inside one cell — the platform above the reference, and the
   departure date above the nights it works out to. The same shape the
   obligations table uses for "what" and "when". */
.rpt-stay__what,
.rpt-stay__left { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }

/* The stay's own cell needs REAL WIDTH, and this is not a nicety. The grid's
   default input is 7ch, and against two date pickers — which are wide because
   the browser draws them that way and will not shrink — the auto layout gave
   this column about ten characters. "Direct booking" rendered as "Dire" and
   "Okonkwo" as "Okonk", which is the one column whose whole job is telling two
   rows apart. Found by looking at the guide's photograph of it. */
.rpt-stay__platform { display: flex; width: 100%; }
.rpt-stay__what { width: 100%; }
.rpt-stay__what .rpt-grid__input { min-width: 19ch; width: 100%; }

/* The dates are as narrow as a date picker goes, so the width they are not
   using goes to the column above rather than to padding. */
.rpt-stays .rpt-grid td:nth-child(2) .rpt-grid__input,
.rpt-stays .rpt-grid td:nth-child(3) .rpt-grid__input { min-width: 0; }

/* EIGHT COLUMNS IS ONE MORE THAN THIS TABLE HAS ROOM FOR at the default cell
   padding, and the way that shows is the Remove button hanging 20px outside the
   card and being clipped. Measured, not guessed — and found in the user guide's
   photograph of the screen, where a button reading "Remov" is the kind of thing
   a reader notices before anything else on the page.
   Two pixels a side, eight columns, is 32px back: more than the overflow, and
   it comes out of space that was doing nothing. */
.rpt-stays .rpt-grid td,
.rpt-stays .rpt-grid th { padding-left: 4px; padding-right: 4px; }

/* The year's stays, under the table. Label left, figure right, so the numbers
   line up down the right-hand edge the way they do in every other total in this
   product. */
.rpt-stay-totals {
  margin-top: var(--space-md, 12px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rpt-stay-totals__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md, 12px);
  padding: 2px 0;
  border-bottom: 1px solid var(--border-hairline);
}

/* A property's name above its stays. The heading card and the stays card below
   it read as one thing with parts, as tenancies do inside their property. */
.rpt-stays-group { margin-bottom: calc(-1 * var(--space-sm, 8px)); }
