/* Record › reimbursements (2026-10-03)
   Design: Claude, 2026-10-03. Zentrum tokens only. Colours mean states:
   green done, blue in progress, amber needs a person, red wrong, grey draft. */

/* --- state chips ------------------------------------------------------------ */
.r-chip {
  --c: var(--amino-text-muted);
  --bg: var(--amino-surface-sunk);
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 10px 3px 8px;
  background: var(--bg); color: var(--c);
  font: 600 11.5px/1.3 var(--amino-font-sans); white-space: nowrap;
}
.r-chip .r-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.r-chip.done { --c: var(--z-good); --bg: var(--z-good-bg); }
.r-chip.progress { --c: var(--z-accent); --bg: var(--z-accent-soft); }
.r-chip.person { --c: var(--z-warn); --bg: var(--z-warn-bg); }
.r-chip.wrong { --c: var(--z-bad); --bg: var(--z-bad-bg); }
.r-chip.draft { --c: var(--amino-text-muted); --bg: var(--amino-surface-sunk); }

/* --- the journey, in the record dialog ------------------------------------- */
.r-steps {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 0;
  font-size: 12.5px; color: var(--amino-text-muted);
}
.r-steps li { display: inline-flex; align-items: center; gap: 6px; }
.r-steps li + li::before {
  content: ""; width: 26px; height: 2px; margin: 0 8px; border-radius: 2px;
  background: var(--amino-border);
}
.r-steps .r-step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--amino-border); background: var(--amino-surface);
}
.r-steps li.done { color: var(--amino-text); }
.r-steps li.done .r-step-dot { background: var(--z-good); border-color: var(--z-good); }
.r-steps li.done + li.done::before, .r-steps li.done + li.now::before { background: var(--z-good); }
.r-steps li.now { color: var(--z-accent); font-weight: 600; }
.r-steps li.now .r-step-dot { border-color: var(--z-accent); }
.r-steps li.wrong { color: var(--z-bad); font-weight: 600; }
.r-steps li.wrong .r-step-dot { background: var(--z-bad); border-color: var(--z-bad); }

/* --- owed-to-you cards ------------------------------------------------------ */
.reimb .r-people {
  display: grid; gap: 12px; margin: 4px 0 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.r-person {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--amino-surface); border-radius: var(--amino-radius-lg);
  box-shadow: var(--z-paper-shadow); padding: 14px 16px 14px;
}
.r-person.me { box-shadow: var(--z-paper-shadow), inset 0 0 0 2px var(--z-accent-soft); }
.r-person-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.r-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--z-accent-soft); color: var(--z-accent);
  font: 700 12px/1 var(--amino-font-sans);
}
.r-person-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-owed-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--amino-text-muted);
}
.r-owed {
  font: 650 26px/1.1 var(--amino-font-display); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--amino-text-muted);
}
.r-owed.due { color: var(--amino-text); }
.r-person-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.r-person-lines li { display: flex; align-items: baseline; gap: 7px; color: var(--amino-text-muted); }
.r-person-lines li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--amino-border); transform: translateY(-1px);
}
.r-person-lines li.progress::before { background: var(--z-accent); }
.r-person-lines li.person::before { background: var(--z-warn); }
.r-person-lines li.done::before { background: var(--z-good); }
.r-person-lines li.plain::before { background: transparent; }
.r-person-lines li.plain { color: var(--amino-text); font-weight: 600; }
.r-person-go { align-self: flex-start; margin-top: 8px; }

/* --- totals + list switcher ------------------------------------------------- */
.reimb .r-totals { margin: 0 0 6px; }
.r-queues { margin: 16px 0 12px; display: grid; gap: 8px; }
.r-seg { flex-wrap: wrap; }
.r-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(127, 140, 155, .16);
}
.r-count.hot { background: var(--z-warn-bg); color: var(--z-warn); }
.z-seg button[aria-pressed="true"] .r-count { background: rgba(255, 255, 255, .2); color: inherit; }
.r-queue-title { display: flex; align-items: center; gap: 8px; font-size: 20px; margin: 0; }
.r-queue-note { margin: 0; font-size: 13px; }

/* --- the list --------------------------------------------------------------- */
.r-list .r-what { min-width: 180px; }
.r-list .r-vendor { display: block; font-weight: 500; }
.r-list .r-state { white-space: normal; }
.r-list .r-state .pill { margin-left: 4px; }
.r-list .r-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.r-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 12px; text-align: center; white-space: normal;
}
.r-empty strong { font-size: 15px; }
.r-empty .btn { margin-top: 6px; }

/* Phones: each record becomes a small card — no sideways scrolling to find
   the amount or the state. */
@media (max-width: 720px) {
  .reimb .r-people { grid-template-columns: 1fr; }
  .reimb .view-head .row { flex-wrap: wrap; }
  .r-list-card .table-scroll { overflow: visible; }
  .reimb table.r-list { display: block; overflow: visible; }
  .r-list thead { display: none; }
  .r-list tbody { display: grid; gap: 8px; }
  .r-list tr.r-row {
    display: grid; align-items: center; gap: 2px 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pick what amt"
      "pick who  date"
      "pick state age"
      "pick act  act";
    padding: 10px 12px; border-radius: var(--amino-radius-md);
    background: var(--amino-surface-sunk);
  }
  .r-list tr.r-row td { display: block; padding: 0; border: 0; min-width: 0; }
  .r-list tr.r-row .pick-cell { grid-area: pick; align-self: start; padding-top: 2px; }
  .r-list tr.r-row .r-what { grid-area: what; min-width: 0; }
  .r-list tr.r-row .r-amt { grid-area: amt; text-align: right; }
  .r-list tr.r-row .r-who { grid-area: who; font-size: 12.5px; color: var(--amino-text-muted); }
  .r-list tr.r-row .r-date { grid-area: date; text-align: right; font-size: 12.5px; }
  .r-list tr.r-row .r-month { display: none; }
  .r-list tr.r-row .r-age { grid-area: age; text-align: right; font-size: 12.5px; margin-top: 6px; align-self: start; }
  .r-list tr.r-row .r-state { grid-area: state; margin-top: 6px; }
  .r-list tr.r-row .actions { grid-area: act; margin-top: 6px; }
  .r-list tr.r-row .actions-cell { justify-content: flex-start; }
  .r-list tr.empty, .r-list tr.empty td { display: block; }
}

/* --- receipt photos (UX overhaul, change 8) ------------------------------- */
.rp-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-thumb, .rp-add {
  width: 76px; height: 76px; border-radius: var(--amino-radius-sm);
  flex: none; overflow: hidden;
}
.rp-thumb {
  padding: 0; border: 1px solid var(--amino-border); background: var(--amino-surface-sunk);
  cursor: zoom-in;
}
.rp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--amino-border); color: var(--z-accent);
  position: relative;
  font: 600 11.5px/1.2 var(--amino-font-sans); text-align: center; cursor: pointer;
  background: var(--amino-surface);
}
/* The tile is a <label> so the whole tile opens the picker; keep form-label caps off it. */
.field .rp-add { text-transform: none; letter-spacing: normal; font-size: 11.5px; color: var(--z-accent); }
.field .rp-add.busy { color: var(--amino-text-muted); }
.rp-add:hover { border-color: var(--z-accent); background: var(--z-accent-soft); }
.rp-add.busy { color: var(--amino-text-muted); cursor: progress; }
.rp-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rp-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.rp-none { font-size: 12px; margin: 0; }

.rp-view {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11, 11, 12, 0.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.rp-view img {
  max-width: 100%; max-height: calc(100dvh - 110px); object-fit: contain;
  border-radius: var(--amino-radius-sm); background: #fff;
}
.rp-view-bar { display: flex; gap: 8px; }
.rp-view .rp-remove { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* Bigger tap targets on phones, where the photos are taken. */
@media (max-width: 640px) {
  .rp-thumb, .rp-add { width: 84px; height: 84px; }
  /* "Fill in Amount and Category to submit." gets its own line above the buttons. */
  .modal-foot { flex-wrap: wrap; }
  .modal-foot > span.muted { flex: 1 0 100%; margin-right: 0 !important; }
}
.r-has-photo { color: var(--z-good); }
