/* Reimbursement Desk
   Ledger-paper green, ink, and one rubber stamp. The stamp is the only loud thing. */

:root {
  --paper: #e9efe4;
  --sheet: #fbfcf7;
  --ink: #15231b;
  --muted: #56675c;
  --line: #c4d0c1;
  --stamp: #3a36c9;
  --paid: #1b7447;
  --stop: #b5362a;
  --hold: #8f5b00;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: 2rem;
  --step-3: 3.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--step-3);
  font-weight: 700;
}

h2 {
  font-size: var(--step-1);
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.masthead .wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-1);
  text-decoration: none;
}

.page {
  max-width: 36rem;
  margin: 0;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) 4rem;
}

.lede {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 34rem;
}

/* ------------------------------------------------------------ form */

.claim {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
}

.field label,
.field .label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.field .hint {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
}

.field textarea {
  min-height: 6rem;
  resize: vertical;
}

.prefixed {
  display: flex;
  align-items: stretch;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}

.prefixed:focus-within {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
}

.prefixed span {
  display: grid;
  place-items: center;
  padding: 0 0.1rem 0 0.8rem;
  color: var(--muted);
}

.prefixed input {
  border: 0;
  background: transparent;
  padding-left: 0.2rem;
}

.prefixed input:focus-visible {
  outline: none;
}

/* The amount is the question this page exists to ask, so it gets the size. */
.field.amount .prefixed {
  border-width: 0 0 3px;
  border-radius: 0;
  background: transparent;
}

.field.amount .prefixed span,
.field.amount input {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 14vw, 5.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.field.amount .prefixed span {
  padding-left: 0;
  color: var(--ink);
}

.field.amount input {
  padding: 0.1rem 0 0.15rem 0.5rem;
  min-width: 0;
}

.field.amount input::placeholder {
  color: var(--line);
}

.field .error {
  display: block;
  margin-top: 0.35rem;
  color: var(--stop);
  font-size: var(--step--1);
  font-weight: 700;
}

.field.invalid input,
.field.invalid textarea,
.field.invalid .prefixed {
  border-color: var(--stop);
}

.button {
  font: inherit;
  font-weight: 700;
  color: var(--sheet);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  justify-self: start;
}

.button:hover {
  background: #24382c;
}

.button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.button.quiet {
  color: var(--ink);
  background: transparent;
}

.button.quiet:hover {
  background: rgba(21, 35, 27, 0.07);
}

.button.small {
  padding: 0.4rem 0.75rem;
  font-size: var(--step--1);
}

.notice {
  border-left: 4px solid var(--stop);
  background: var(--sheet);
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.fineprint {
  font-size: var(--step--1);
  color: var(--muted);
}

/* ------------------------------------------------------------ status slip */

.slip {
  position: relative;
  margin-top: 2rem;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  padding: 2rem clamp(1.25rem, 4vw, 2.25rem) 1.75rem;
  /* ledger rules */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.9rem - 1px),
    rgba(196, 208, 193, 0.55) calc(1.9rem - 1px),
    rgba(196, 208, 193, 0.55) 1.9rem
  );
}

.slip .sum {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.75rem, 12vw, 4.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.slip .to {
  margin-top: 0.4rem;
  font-size: var(--step-1);
}

.slip dl {
  margin: 1.75rem 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
}

.slip dt {
  color: var(--muted);
}

.slip dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.stamp {
  position: absolute;
  top: 1.25rem;
  right: clamp(0.75rem, 3vw, 1.5rem);
  transform: rotate(-7deg);
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stamp);
  border: 3px double currentColor;
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  background: rgba(251, 252, 247, 0.85);
}

.stamp[data-status='paid'] {
  color: var(--paid);
}

.stamp[data-status='needs_approval'] {
  color: var(--hold);
}

.stamp[data-status='declined'],
.stamp[data-status='failed'] {
  color: var(--stop);
}

@media (prefers-reduced-motion: no-preference) {
  .stamp.fresh {
    animation: press 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
  }
  @keyframes press {
    from {
      transform: rotate(-7deg) scale(1.6);
      opacity: 0;
    }
  }
}

@media (max-width: 30rem) {
  .stamp {
    position: static;
    display: inline-block;
    margin-bottom: 1.25rem;
    transform: rotate(-3deg);
  }
}

.explain {
  margin-top: 1.5rem;
  max-width: 34rem;
}

.keep {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.5rem;
}

.keep .row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.keep input {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: var(--step--1);
  color: var(--ink);
  background: var(--sheet);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
}

/* ------------------------------------------------------------ owner dashboard */

.desk {
  padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
  max-width: 88rem;
}

.desk h1 {
  font-size: var(--step-2);
}

.mode {
  font-size: var(--step--1);
  font-weight: 700;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  padding: 0.1rem 0.5rem;
}

.mode[data-mode='live'] {
  color: var(--stop);
}

.mode[data-mode='dry-run'] {
  color: var(--hold);
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3.5rem;
  margin: 1.75rem 0 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.totals .figure {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.totals .caption {
  color: var(--muted);
  font-size: var(--step--1);
}

.lane {
  min-width: 0;
}

.lane > h2 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--ink);
}

.lane > h2 .count {
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--muted);
}

.lane .empty {
  color: var(--muted);
  padding: 0.9rem 0;
  font-size: var(--step--1);
}

.lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.entry {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.entry .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.entry .who {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.entry .money {
  font-family: var(--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry .what {
  overflow-wrap: anywhere;
}

.entry .meta {
  color: var(--muted);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.entry .why {
  color: var(--hold);
  font-size: var(--step--1);
  font-weight: 700;
}

.entry .problem {
  color: var(--stop);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

/* The approval lane is where the owner acts, so its entries are roomier. */
.lane.pending .entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 2rem;
  align-items: center;
  padding: 1.1rem 0;
}

.lane.pending .entry .money {
  font-size: var(--step-1);
}

.lane.pending .actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 40rem) {
  .lane.pending .entry {
    grid-template-columns: 1fr;
  }
}

.more {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.more summary {
  cursor: pointer;
  font-weight: 700;
}

.more table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: var(--step--1);
}

.more th,
.more td {
  text-align: left;
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.scroll {
  overflow-x: auto;
}

.signin {
  max-width: 26rem;
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

/* ------------------------------------------------------------ Venmo connection */

.venmo {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
  max-width: 34rem;
}

.venmo h2 {
  margin-bottom: 0.5rem;
}

.venmo .notice {
  margin-top: 0.75rem;
}

.venmo-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.venmo > .button {
  margin-top: 1rem;
}
