/* Older pages (overview, invoices, reports, synchronization, messages) and sign-in.
   Page-specific rules only. Tokens, shell, type, tables, tags, notices, forms and buttons come from classy.css. */

/* ---------- Page widths: each page keeps its head, filters and table on one measure ---------- */
.page { max-width: 76rem; }
.page--narrow { max-width: 56rem; }
.page .t td, .page .t th { vertical-align: baseline; }
.page .t thead th { vertical-align: bottom; }
.page h2:first-child { margin-top: 0; }
.page .filters { margin: 0; }
.note { margin-top: var(--s3); color: var(--muted); }
.page > .note, .block > .note { margin-bottom: 0; }
.block { margin-top: var(--s6); }
.block__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--s2) var(--s4);
  margin-bottom: var(--s3);
}
.block__head h2 { margin: 0; }
/* Counts are Archivo and right-aligned; money and invoice numbers use .num. */
.t .count { text-align: right; }
.t .nowrap { white-space: nowrap; }
/* Invoice numbers sit near the left edge, right-aligned under their own header. */
.t th.col-number { width: 11rem; }
.t--reports th:first-child { width: 48%; }

/* ---------- Key figures: one white strip, divided ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.stats > div { padding: var(--s4) var(--s5); }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-weight: 600; }
.stats dd { margin: var(--s1) 0 0; }
.stats .fig { display: block; }
.stats .note { display: block; margin: var(--s1) 0 0; }

/* ---------- Daily invoice chart (pure CSS; every value is printed above its bar) ---------- */
.chart-panel {
  position: relative; /* keeps the hidden bar descriptions inside the scroller on phones */
  padding: var(--s5) var(--s4) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.chart { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.chart li {
  display: flex; flex-direction: column; flex: 1 1 0; align-items: stretch;
  min-width: 0; margin: 0;
  text-align: center; font-variant-numeric: tabular-nums;
}
.chart__n { font-weight: 600; }
.chart__track {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 8rem;
  margin-top: var(--s1);
  border-bottom: 1px solid var(--field);
}
.chart__bar { display: block; width: 70%; max-width: var(--s7); background: var(--classy); }
.chart__day { margin-top: var(--s2); color: var(--muted); }
.chart__day span { display: block; min-height: 1.5rem; }
.chart li.is-today .chart__bar { background: var(--link); }
.chart li.is-today .chart__day { color: var(--ink); font-weight: 600; }
.level-0 { height: 0; }
.level-1 { height: 5%; }
.level-2 { height: 10%; }
.level-3 { height: 15%; }
.level-4 { height: 20%; }
.level-5 { height: 25%; }
.level-6 { height: 30%; }
.level-7 { height: 35%; }
.level-8 { height: 40%; }
.level-9 { height: 45%; }
.level-10 { height: 50%; }
.level-11 { height: 55%; }
.level-12 { height: 60%; }
.level-13 { height: 65%; }
.level-14 { height: 70%; }
.level-15 { height: 75%; }
.level-16 { height: 80%; }
.level-17 { height: 85%; }
.level-18 { height: 90%; }
.level-19 { height: 95%; }
.level-20 { height: 100%; }

/* ---------- Overview: recent invoices beside the state of the Trams data ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.split > section { margin: 0; }
.split .panel { margin: 0; }
.split .facts > div { grid-template-columns: minmax(0, 1fr); }

/* ---------- Filters and report period: unboxed rows above their result ---------- */
.page .form--inline { margin-bottom: var(--s5); }
.page .form--inline input:not([type="hidden"]) { min-width: 11rem; width: 11rem; }
.form__clear { display: inline-flex; align-items: center; min-height: var(--control); }
.page .panel .form--inline { margin-bottom: 0; }
.panel > p.note { margin: calc(-1 * var(--s2)) 0 var(--s4); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s4); margin-top: var(--s4); }
.pager p { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Sign-in ---------- */
.signin { display: flex; flex-direction: column; align-items: center; padding: var(--s4); }
.signin__surface {
  width: 100%; max-width: 28rem;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.signin__logo { width: 220px; margin: 0 auto var(--s2); }
.signin h1 { margin-bottom: var(--s4); text-align: center; }
.signin .notice { margin-bottom: var(--s4); padding: var(--s2) var(--s3); }
.signin .notice__title { margin: 0; }
.signin label { display: block; margin-bottom: var(--s3); font-weight: 600; }
.signin label input { margin-top: var(--s1); max-width: none; font-weight: 400; }
.signin .button { width: 100%; margin-top: var(--s2); }
.signin__demo {
  margin-top: var(--s4); padding: var(--s3) var(--s4) var(--s4);
  background: var(--page);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.signin__demo h2 { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; }
.signin__demo p { margin: var(--s1) 0 var(--s2); }
.signin__demo form { margin: 0; }
.signin__note { margin-top: var(--s3); color: var(--muted); text-align: center; }

/* ---------- Narrow windows ---------- */
@media (min-width: 100rem) {
  .chart__track { height: 14rem; }
}
@media (max-width: 70rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  /* Wrapping sticky tables in a scroller only here keeps their headers stuck on wider screens. */
  .scroll-narrow { overflow-x: auto; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div + div { border-left: 0; border-top: 1px solid var(--line); }
  /* Thirty bars cannot keep their labels on a phone: the chart scrolls inside its panel. */
  .chart-panel { overflow-x: auto; }
  .chart li { min-width: 2.5rem; }
  .signin__surface { padding: var(--s4); }
}
