/* ---------------------------------------------------------------
 * The invoice screens' own layout — the draft's lines, the sums, the filter row. Everything
 * else is the kit's (cards, panels, badges, tables, dialogs); load this after its index.css,
 * because the order is the override.
 * --------------------------------------------------------------- */

.inv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.inv-head-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.inv-panel .setting strong .badge {
  margin-left: 0.4rem;
  vertical-align: 1px;
}
.inv-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The lines of a draft: text wide, the numbers narrow, a row per line; two columns on a phone. */
.inv-lines {
  display: grid;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}
.inv-line {
  display: grid;
  grid-template-columns: minmax(10rem, 3fr) 5.5rem 7rem 7rem 5.5rem auto;
  align-items: end;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft, var(--line));
}
.inv-line .field {
  margin: 0;
}
.inv-line .inv-line-detail {
  grid-column: 1 / 6;
}
.inv-line .inv-line-remove {
  align-self: end;
}
@media (max-width: 760px) {
  .inv-line {
    grid-template-columns: 1fr 1fr;
  }
  .inv-line > :first-child,
  .inv-line .inv-line-detail {
    grid-column: 1 / -1;
  }
}

.inv-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  font-variant-numeric: tabular-nums;
}
.inv-total b {
  font-size: 1.3rem;
}

/* The sums as they stand on the document: net, one line per rate, gross. */
.inv-sums {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1.5rem;
  max-width: 24rem;
  margin: 0.75rem 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.inv-sums dt,
.inv-sums dd {
  margin: 0;
}
.inv-sums dd {
  text-align: right;
}
.inv-sums .inv-strong {
  font-weight: 700;
  border-top: 1px solid var(--line-strong, var(--fg));
  padding-top: 0.35rem;
}

.inv-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0 0 1rem;
}
.inv-facts dt {
  color: var(--muted);
  font-size: 0.8rem;
}
.inv-facts dd {
  margin: 0.15rem 0 0;
}

.inv-missing {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.inv-missing li + li {
  margin-top: 0.3rem;
}

.inv-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.inv-filter .btn[aria-pressed="true"] {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.inv-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.inv-note ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.inv-period-quarter td,
.inv-period-year td {
  font-weight: 700;
}
/* One column that may shrink: a grid item's min-width is its content, and a wide table would
   push the whole screen past a phone's edge instead of scrolling inside `.table-scroll`. */
.inv-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* The state cell when there is more to say than the badge: „nie gesendet", „gemahnt 12.09.". */
.inv-state {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.inv-state .small {
  font-size: 0.8em;
}
.inv-warn {
  color: var(--bad);
}
.inv-acts {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
