/* SPDX-License-Identifier: AGPL-3.0-only */
/* Copyright (C) 2026 DIY Accounting Ltd */

/* books/se.css -- the Self Employed page's sheet: the shared books sheet,
   plus the rules the views only this product has need. */

@import url("books.css");

/* The journal switch above the entries grid, and the bank book's own
   account switch: a second tab row, one line that scrolls on a phone
   rather than wrapping, the chosen one underlined the way the sheet tabs
   mark the open view. */
.journal-switch,
.account-switch {
  display: flex;
  gap: 0.1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  border-bottom: 1px solid var(--rule-faint);
  scrollbar-width: thin;
}

.journal-switch-btn,
.account-switch-btn {
  flex: none;
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--pencil);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0 0.75rem;
  white-space: nowrap;
  cursor: pointer;
}

.journal-switch-btn:hover,
.account-switch-btn:hover {
  color: var(--ink);
}

.journal-switch-btn[aria-pressed="true"],
.account-switch-btn[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.account-switch-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: 0.3rem;
}

/* On a phone the month opens inside its card, and the journal switch runs
   edge to edge of that card so its rule reads as the card's own tab row. */
@media (max-width: 899px) and (orientation: portrait) {
  .month-card .journal-switch {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding: 0 0.85rem;
  }
}

/* A table wider than the view -- the statement's twelve month columns,
   the bank book's balances and analysis columns, the payroll tables --
   scrolls inside its own box rather than pushing the page sideways. The
   cells stay on one line so the box scrolls instead of squeezing a name
   onto two. */
.se-table-scroll {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.se-table-scroll table {
  min-width: 100%;
}

.se-table-scroll .register-table th,
.se-table-scroll .register-table td {
  white-space: nowrap;
}

.se-months-table th:first-child {
  text-align: left;
  white-space: nowrap;
}

/* One settlement a row: what is missing, then the preview and the two
   controls that apply or drop it. */
.settlement-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settlement {
  border-top: 1px solid var(--rule-faint);
  padding: 0.6rem 0;
}

.settlement:first-child {
  border-top: none;
}

.settlement p {
  margin: 0 0 0.4rem;
}

.settlement-title {
  font-weight: 700;
}

.settlement-meta {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.settlement-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* The mileage-and-CIS strip under a month's summary grid: the same
   label/value grid the month card's own figures use, ruled off above so it
   reads as the sheet's own extra row rather than part of the summary. */
.month-card-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.6rem;
  max-width: 26rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule-faint);
  font-size: 0.8rem;
  text-align: left;
}

.month-card-strip .figure-label {
  font-family: var(--font-ui);
  color: var(--ink-faint);
}

.month-card-strip .figure-value {
  font-family: var(--font-mono);
  text-align: right;
}

/* The VAT hub table, under the five return forms: a disclosure, closed
   until a reader asks for the workings behind a box. */
.vat-interface {
  border: 1px solid var(--rule-faint);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}

.vat-interface > summary {
  min-height: 44px;
  padding: 0.7rem 0;
  cursor: pointer;
  font-weight: 600;
}

.vat-interface[open] > summary {
  margin-bottom: 0.75rem;
}

.vat-interface .register-table th {
  white-space: normal;
  min-width: 6rem;
}

/* The period a VAT return covers and the day its payment falls due: two
   dates above box 1, in the form's register but not in a money box. */
.form-period {
  padding: 0.75rem 1rem 0;
}

.form-period-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.2rem 0;
}

.form-period-label {
  flex: 1;
  font-weight: 600;
}

.form-period-date {
  flex: none;
  min-width: 8rem;
  border-bottom: 2px solid var(--ink);
  padding: 0.2rem 0.5rem;
  font-family: var(--font-mono);
  text-align: right;
}
