:root {
  --papaya: #fca07f;
  --navy: #113366;
  --ink: #ffefe8;
  --quiet: #c3cee6;
  --context: #5b7fc4;
  --line: rgb(195 206 230 / 0.2);
  --edge: rgb(195 206 230 / 0.45);
  --well: #0c264f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 1.4rem; }
h2 { font-size: 0.95rem; }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--edge); }
a:hover { text-decoration-color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.topbar__name { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.topbar form { margin-left: auto; }

.tabs { display: flex; gap: 20px; }
.tabs__tab { padding: 6px 0; color: var(--quiet); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs__tab--active { color: var(--ink); border-bottom-color: var(--ink); }
.tabs__count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--papaya); color: var(--navy); font-size: 0.75rem; font-weight: 650; text-align: center; }

.page { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 12px; }

.card, .tile {
  border: 3px solid var(--papaya);
  border-radius: 14px;
  min-width: 0;
}

.card { padding: 20px; }
.card--narrow { max-width: 360px; width: 100%; margin: 12vh auto 0; display: grid; gap: 16px; }
.card__header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; }

.quiet { margin: 2px 0 0; color: var(--quiet); font-size: 0.875rem; }
.quiet a { color: var(--quiet); }


.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.tile { padding: 18px 20px; }
.tile h2 { color: var(--quiet); font-weight: 500; }
.tile__figure { margin: 6px 0 2px; font-variant-numeric: normal; font-size: 1.75rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.tile__note { margin: 0; color: var(--quiet); font-size: 0.875rem; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; color: var(--quiet); font-size: 0.8125rem; }
.legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend__paid::before { background: var(--papaya); }
.legend__waiting::before { background: var(--ink); }
.legend__last-year::before { background: var(--context); }

.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.chart__month { display: grid; grid-template-rows: auto 200px auto; gap: 6px; text-align: center; min-width: 0; }
.chart__value { font-size: 0.75rem; color: var(--quiet); white-space: nowrap; }
.chart__bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.chart__last-year { width: 22%; max-width: 10px; background: var(--context); border-radius: 3px 3px 0 0; }
.chart__stack { width: 56%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.chart__paid { background: var(--papaya); }
.chart__waiting { background: var(--ink); }
.chart__label { font-size: 0.8125rem; }
.chart__label small { color: var(--quiet); }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; color: var(--quiet); font-weight: 500; font-size: 0.8125rem; padding: 0 8px 8px 0; white-space: nowrap; }
.table td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .table__amount { text-align: right; white-space: nowrap; }
.table__quiet { color: var(--quiet); white-space: nowrap; }
.table__struck { color: var(--quiet); text-decoration: line-through; }
.table__group th { padding-top: 16px; color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.table__group td, .table__group + tr td { border-top: 0; }
.table__group th .table__quiet { font-weight: 400; margin-left: 6px; }
.table tfoot th { padding: 12px 8px 0 0; border-top: 2px solid var(--edge); color: var(--ink); font-size: 1rem; }
.table tfoot td { border-top: 0; padding-top: 2px; }

.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--papaya); color: var(--navy); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

.status { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; border: 1px solid var(--edge); color: var(--quiet); vertical-align: middle; }
.status--confirmed { border-color: var(--ink); color: var(--ink); }
.status--confirmed::before { content: "✓ "; }
.status--skipped { text-decoration: line-through; }

.progress { margin: 0 0 16px; }
.empty { margin: 0; color: var(--quiet); }

.form { display: grid; gap: 6px; }
.form label { font-size: 0.875rem; color: var(--quiet); margin-top: 8px; }
.form input[type="email"], .form input[type="password"] {
  font: inherit;
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 10px 12px;
}

.actions { display: flex; align-items: center; gap: 8px; }
.actions .button { margin: 0; }

.button {
  font: inherit;
  font-weight: 650;
  color: var(--navy);
  background: var(--papaya);
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 14px;
  cursor: pointer;
}

.button:disabled { opacity: 0.4; cursor: not-allowed; }
.button--plain { background: none; color: var(--ink); border: 1px solid var(--edge); font-weight: 500; }
.button--quiet { background: none; color: var(--quiet); font-weight: 500; padding: 6px 0; margin: 0; }
.button--link { background: none; color: var(--quiet); font-weight: 400; font-size: 0.8125rem; padding: 0; margin: 0; text-decoration: underline; }

.quiet-link { color: var(--quiet); font-size: 0.875rem; }

.flash { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--edge); }
.flash--alert { border: 3px solid var(--papaya); font-weight: 600; }

@media (max-width: 560px) {
  .chart { gap: 2px; }
  .chart__value { font-size: 0.625rem; }
  .chart__label small { display: none; }
}

.checks { border: 2px solid var(--papaya); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.checks--normal { border: 1px solid var(--edge); }
.checks p { margin: 0; }
.checks ul { margin: 6px 0 0; padding-left: 20px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt { color: var(--quiet); font-size: 0.8125rem; }
.facts dd { margin: 0; }

.badge--first { margin-left: 0; }

.stack { display: grid; gap: 12px; }
.card--fill { display: flex; flex-direction: column; }

.plot__line { fill: none; stroke: var(--context); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot__dot { fill: var(--ink); stroke: var(--navy); stroke-width: 2; }

.stat { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 16px; }
.stat__figure { grid-column: 1; margin: 0; font-variant-numeric: normal; font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.stat .quiet { grid-column: 1; }
.spark { grid-column: 2; grid-row: 1 / span 2; justify-self: end; width: 100%; max-width: 200px; height: auto; }

.meter { height: 8px; margin: 14px 0 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter__fill { display: block; height: 100%; min-width: 8px; border-radius: 999px; background: var(--ink); }

.scale { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--quiet); font-size: 0.8125rem; }
.scale__ramp { width: 64px; height: 10px; border-radius: 3px; background: linear-gradient(to right, rgb(252 160 127 / 0.08), var(--papaya)); }

.heat { flex: 1; display: grid; grid-template-columns: 44px repeat(var(--days), minmax(0, 1fr)); grid-auto-rows: minmax(20px, 1fr); gap: 2px; }
.heat__day, .heat__hour { color: var(--quiet); font-size: 0.75rem; }
.heat__day { text-align: center; align-self: end; }
.heat__hour { text-align: right; padding-right: 6px; align-self: center; }
.heat__cell { border-radius: 4px; background: rgb(252 160 127 / max(var(--level), 0.06)); }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search .button { margin: 0; }
.search__field { flex: 1 1 220px; max-width: 420px; font: inherit; color: var(--ink); background: var(--well); border: 1px solid var(--edge); border-radius: 8px; padding: 10px 12px; }
.search__field::placeholder { color: var(--quiet); }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager--end { margin: 0; padding: 0; border: 0; justify-content: flex-end; }
.pager .quiet { margin: 0; }
.table--paged { margin-top: 16px; }
.pagy { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.875rem; }
.pagy a { min-width: 2.2em; padding: 4px 9px; border: 1px solid var(--edge); border-radius: 8px; color: var(--quiet); text-align: center; text-decoration: none; }
.pagy a[href]:hover { border-color: var(--ink); color: var(--ink); }
.pagy a[aria-current] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.pagy a[role="separator"] { border-color: transparent; }
.pagy a[aria-disabled]:not([aria-current]) { opacity: 0.4; }

.note { scroll-margin-top: 12px; }
.note__body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note__body div:empty { height: 0.75em; }
.note__body h3, .note__body h4, .note__body h5 { margin: 14px 0 4px; font-size: 1rem; }
.note__body h4, .note__body h5 { font-size: 0.9rem; color: var(--quiet); }
.note__body ul, .note__body ol { margin: 4px 0; padding-left: 20px; }
.note__body hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.note__body blockquote { margin: 8px 0; padding-left: 12px; border-left: 2px solid var(--edge); }
.note__body a { color: var(--ink); }
.note__body .note__checks { padding-left: 0; list-style: none; color: var(--quiet); }
.note__checks > li::before { content: "☐ "; }
.note__checks > .note__check--done { color: var(--ink); font-weight: 600; }
.note__checks > .note__check--done::before { content: "☑ "; }
.note__scroll { overflow-x: auto; margin: 8px 0; }
.note__table { width: 100%; border-collapse: collapse; }
.note__table td { padding: 5px 8px; border: 1px solid var(--edge); vertical-align: top; }
.note__picture { display: inline-block; max-width: 100%; max-height: 320px; width: auto; height: auto; margin: 4px 4px 4px 0; border-radius: 8px; vertical-align: top; }
.note__picture--signature { max-height: 72px; padding: 4px 8px; background: var(--ink); }
.note__mark { color: var(--quiet); }
