/* Source Sans 3 © Adobe, IBM Plex Mono © IBM. Both SIL OFL 1.1. Licenses are in ../fonts/. */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  font-family: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  --paper: #e4e6ea;
  --sheet: #fbfbfc;
  --ink: #1a1e24;
  --mute: #5e6772;
  --rule: #d8dbe1;
  --bronze: #d69a50;
  --secondary: #3062ac;
  --brass: #7a5618;
  --timer-wash: #f3eadc;
  --danger: #8d2c38;
  --font-figures: "IBM Plex Mono", ui-monospace, monospace;
  --accent: var(--ink);
  --border: var(--rule);
  --muted: var(--mute);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--ink);
  text-underline-offset: 3px;
}
h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-weight: 600;
}
h1 {
  font-size: 2rem;
  margin: 0 0 0.35rem;
}
h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
p {
  margin: 0.5rem 0 1rem;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: var(--sheet);
  border-right: 1px solid var(--rule);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 10px 35px;
}
.brand-mark {
  background: var(--ink);
  color: var(--sheet);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.sidebar nav a {
  padding: 10px 14px;
  color: var(--mute);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.sidebar nav a:hover,
.sidebar nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper);
}
.sidebar footer {
  margin-top: auto;
  padding: 24px 10px 0;
}
.app-main {
  margin-left: 220px;
  padding: 40px clamp(20px, 4vw, 64px);
  max-width: 1600px;
}
.guest-main {
  max-width: 460px;
  margin: 10vh auto;
  padding: 24px;
}
.mobile-header {
  display: none;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading .actions {
  margin-top: 0;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
}
label.check input {
  width: auto;
  min-height: 0;
}
.eyebrow {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
  margin-bottom: 0.15rem;
}
.muted,
.mute {
  color: var(--mute);
}
.card,
.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px;
  margin: 0 0 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}
.time-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 4px 0 16px;
}
.time-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time-mode input {
  width: auto;
  min-height: 0;
}
.time-inputs {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
}
.entry-time:has(input[value="hours"]:checked) .clock-fields,
.entry-time:has(input[value="clock"]:checked) .hours-fields {
  display: none;
}
.wide {
  grid-column: 1 / -1;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.figures,
.numeric,
.stat,
.elapsed {
  font-family: var(--font-figures);
  font-variant-numeric: tabular-nums;
}
.stat {
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.timer-panel {
  border-top: 3px solid var(--rule);
}
.timer-panel.is-running {
  background: var(--timer-wash);
  border-color: #e4d3b8;
  border-top-color: var(--brass);
}
.timer-panel.is-running > h2 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0;
  margin-bottom: 0.75rem;
}
.timer-readout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 28px;
  align-items: center;
}
.timer-readout .actions,
.timer-strip .actions {
  margin-top: 0;
}
.timer-readout p {
  margin: 0.15rem 0 0;
}
.elapsed {
  font-size: 3.25rem;
  font-weight: 500;
  color: var(--brass);
  letter-spacing: -0.04em;
  line-height: 1;
}
.timer-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--timer-wash);
  border: 1px solid #e4d3b8;
  border-top: 3px solid var(--brass);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
}
.timer-strip[hidden],
main:has([data-today]) .timer-strip {
  display: none;
}
.timer-strip a {
  color: var(--ink);
  font-weight: 600;
}
.timer-strip .elapsed {
  font-size: 1.35rem;
}
.notice {
  padding: 14px 18px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  border-radius: 10px;
  margin-bottom: 20px;
  color: var(--ink);
}
.danger,
.validation-summary-errors,
.field-validation-error {
  color: var(--danger);
}
.validation-summary-valid,
.field-validation-valid {
  display: none;
}
.badge {
  display: inline-block;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mute);
}
.badge.Active,
.badge.Finalized,
.badge.Open {
  color: var(--ink);
}
.badge.Paid {
  color: #1f6b45;
}
.badge.Running {
  color: var(--brass);
}
.day-offset {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--mute);
  font-size: 0.72rem;
  line-height: 1.45;
  vertical-align: 1px;
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--mute);
}
.summary-grid {
  margin-top: 24px;
}
.summary-grid summary {
  margin-bottom: 16px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  margin-bottom: 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  margin-bottom: 24px;
}
.table-wrap table {
  margin: 0;
}
th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mute);
  background: var(--rule);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #f3f4f6;
}
.numeric {
  text-align: right;
  white-space: nowrap;
}
td small {
  display: block;
  color: var(--mute);
  margin-top: 2px;
}
.table-wrap td:last-child a {
  color: var(--mute);
  font-size: 0.88rem;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 240px;
  top: 5px;
  background: var(--sheet);
  z-index: 20;
}
details > summary {
  cursor: pointer;
  font-weight: 600;
}
details[open] > summary {
  margin-bottom: 16px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
}
legend {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--ink);
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
  width: 100%;
  min-height: 44px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--bronze);
  color: white;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
a.button {
  text-decoration: none;
}
form > button,
.grid + button {
  margin-top: 20px;
}
button.secondary,
.button.secondary {
  background: var(--secondary);
  border-color: var(--rule);
  color: var(--paper);
}
button.link {
  background: transparent;
  color: var(--mute);
  padding: 0;
  border: 0;
  min-height: 0;
}
button.danger,
.button.danger {
  background: #f8f1f1;
  color: var(--danger);
  border-color: #e4c8cc;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--ink);
}
.filters {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filters label {
  min-width: 150px;
}
.filters button {
  margin: 0;
}
.filters a.button {
  background: transparent;
  border-color: transparent;
  color: var(--mute);
}
.filters a.button.is-selected {
  background: var(--sheet);
  border-color: var(--rule);
  color: var(--ink);
}
.form-page {
  max-width: 850px;
}
.invoice-fields {
  align-items: start;
}
.invoice-fields input:not([type="hidden"]),
.invoice-fields select:not([multiple]) {
  height: 44px;
}
.invoice-fields select[multiple] {
  height: auto;
  min-height: 8rem;
}
.invoice-sheet,
.invoice-follow {
  max-width: 920px;
}
.invoice-sheet {
  padding: 0;
  overflow: hidden;
}
.invoice-sheet > .grid {
  padding: 24px 24px 8px;
}
.invoice-sheet .table-wrap {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.pre {
  white-space: pre-line;
}
.draft-line {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.draft-line p {
  margin: 0 0 8px;
}
.draft-line p strong + strong {
  margin-left: 0.6rem;
}
.line-charges {
  width: 100%;
  margin: 4px 0 16px;
}
.line-charges th,
.line-charges td {
  padding: 8px 10px;
}
.back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.help {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--mute);
}
.line-edit {
  display: flex;
  gap: 8px;
  align-items: end;
}
.line-edit label {
  min-width: 85px;
}
.line-edit button {
  margin: 0;
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
    top: 68px;
    width: 100%;
    bottom: auto;
    padding: 20px;
  }
  .sidebar.open {
    display: flex;
  }
  .sidebar .brand {
    display: none;
  }
  .sidebar footer {
    padding-top: 14px;
  }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--sheet);
    border-bottom: 1px solid var(--rule);
  }
  .mobile-header .brand {
    margin: 0;
  }
  .app-main {
    margin: 0;
    padding: 24px 16px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 1.7rem;
  }
  .card,
  .panel {
    padding: 18px;
  }
  .invoice-sheet > .grid {
    padding: 18px 18px 4px;
  }
  .grid,
  .timer-readout {
    grid-template-columns: 1fr;
  }
  .timer-strip {
    font-size: 0.85rem;
    padding: 10px;
  }
  .timer-strip .elapsed,
  .elapsed {
    font-size: 2rem;
  }
  .timer-strip .elapsed {
    font-size: 1.15rem;
  }
  .entries thead {
    display: none;
  }
  .entries,
  .entries tbody,
  .entries tr,
  .entries td {
    display: block;
  }
  .entries tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--rule);
  }
  .entries td {
    border: 0;
    padding: 4px 0;
    text-align: left;
  }
  .entries td[data-label]:before {
    content: attr(data-label) " ";
    font-size: 0.78rem;
    color: var(--mute);
  }
  .entries td:last-child {
    margin-top: 8px;
  }
  .actions {
    gap: 8px;
  }
  .guest-main {
    margin: 5vh auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
a.card {
  text-decoration: none;
  color: inherit;
}
a.card:hover {
  border-color: var(--ink);
}
hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 22px 0;
}
.timer-panel.is-running hr {
  border-top-color: #e4d3b8;
}
.notice.error {
  background: #f8f1f1;
  border-color: #e4c8cc;
  color: var(--danger);
}
.page-heading > div {
  min-width: 0;
}
.card strong,
td {
  overflow-wrap: anywhere;
}
tfoot th,
tfoot td {
  background: var(--sheet);
  border-bottom: 0;
  border-top: 1px solid var(--ink);
}
