/* Refunds, credits and cancellations (2026-09-28, release 7 phase 2): refunds-place.js,
   refunds-cancellation.js and refunds-credits.js. Every class starts refund-, so nothing here can
   restyle another part of the dashboard. The modules also use the course modules' ct- classes
   (course-templates.css) for buttons, fields, callouts, pills and tables, so they look like the
   screens beside them. Every colour, radius and ring is an Ember custom property from the top of
   styles.css; none is written here. */

/* ---------------------------------------------------------------- the "Cancel this place" panel */
.refund-panel {
  border: 0; padding: 0; border-radius: var(--radius-panel); box-shadow: var(--shadow-raised);
  border-top: var(--marker-thickness) solid var(--color-amber); background: var(--color-surface);
  color: var(--color-text); width: min(760px, calc(100vw - 2rem)); max-width: 100%;
  max-height: calc(100vh - 2rem); overflow-y: auto;
}
.refund-panel::backdrop { background: var(--color-backdrop); }
.refund-panel-inner { padding: 1rem 1.15rem 1.15rem; }
.refund-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .3rem 1rem; }
.refund-panel-head .ct-hwh { flex: 1 1 auto; }
.refund-panel-head h2 { font-size: var(--font-size-heading-2); margin: 0; }
.refund-panel-head h2:focus, .refund-block h3:focus { outline: none; }
.refund-panel-head > .ct-muted { flex-basis: 100%; margin: .1rem 0 0; }
.refund-block { border-top: 1px solid var(--color-line); margin-top: .8rem; padding-top: .6rem; }
.refund-block h3 { margin: .2rem 0 .45rem; font-size: var(--font-size-heading-3); }
.refund-payments, .refund-credit-list, .refund-copy-list { list-style: none; margin: .3rem 0; padding: 0; }
.refund-payment, .refund-credit, .refund-copy { border: 1px solid var(--color-line); border-radius: var(--radius-panel);
  padding: .55rem .75rem; margin: .45rem 0; background: var(--color-surface-raised); }
.refund-payment p, .refund-credit p, .refund-copy p { margin: .2rem 0; }
.refund-facts { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; margin: .35rem 0; font-size: .92rem; }
.refund-facts dt { color: var(--color-text-secondary); font-weight: 600; }
.refund-facts dd { margin: 0; overflow-wrap: anywhere; }
.refund-source { margin: .35rem 0 .1rem; padding: .35rem .6rem; border-radius: var(--radius-panel); font-size: .9rem;
  border-left: var(--marker-thickness) solid var(--color-line); background: var(--color-surface-quiet); }
.refund-source-ok { border-left-color: var(--color-ok-line); background: var(--color-ok-wash); color: var(--color-text); }
.refund-source-stop { border-left-color: var(--color-error-line); background: var(--color-error-wash); color: var(--color-error-text); font-weight: 600; }
.refund-source-quiet { color: var(--color-text-muted); }
.refund-source-adopt { border-left-color: var(--color-warning-line); background: var(--color-warning-wash); color: var(--color-text); }
/* review R7 F1: card refunds made outside the dashboard, each with "Adopt the refund" */
.refund-adoptable { border: 1px solid var(--color-line); border-left: var(--marker-thickness) solid var(--color-warning-line);
  border-radius: var(--radius-panel); padding: .4rem .7rem; margin: .45rem 0 .1rem; background: var(--color-surface); }
.refund-adoptable ul { list-style: none; margin: .25rem 0; padding: 0; }
.refund-adoptable li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; padding: .25rem 0; }
.refund-adoptable li > span:first-child { flex: 1 1 14rem; overflow-wrap: anywhere; }
.refund-outcomes { border: 0; margin: 0; padding: 0; }
.refund-outcomes legend { font-weight: 600; font-size: 1rem; padding: 0; margin-bottom: .3rem; }
.ct-root label.refund-outcome { display: block; border: 1px solid var(--color-line); border-radius: var(--radius-panel);
  padding: .5rem .7rem; margin: .35rem 0; background: var(--color-surface-raised); cursor: pointer; }
.ct-root label.refund-outcome:has(input:checked) { border-color: var(--color-text); background: var(--color-surface-selected); }
.ct-root label.refund-outcome-off { cursor: not-allowed; background: var(--color-disabled-surface); color: var(--color-disabled-text); }
.refund-hint { display: block; margin: .15rem 0 0 1.6rem; font-size: .88rem; color: var(--color-text-muted); }
.refund-form fieldset { border: 1px solid var(--color-line); border-radius: var(--radius-panel); margin: .6rem 0; padding: .4rem .75rem .55rem; }
.refund-form fieldset legend { font-weight: 600; padding: 0 .3rem; }
.refund-form textarea, .refund-form select { width: 100%; box-sizing: border-box; }
.refund-goes-back { border-left: var(--marker-thickness) solid var(--color-info-line); background: var(--color-info-wash);
  border-radius: var(--radius-panel); padding: .4rem .75rem; margin: .6rem 0; }
.refund-goes-back h4 { margin: .2rem 0; }
.refund-goes-back p { margin: .25rem 0; }
.refund-lines { margin: .3rem 0 .6rem 1.1rem; padding: 0; }
.refund-lines li { margin: .25rem 0; }
.refund-see { background: var(--color-surface-quiet); border-radius: var(--radius-panel); padding: .45rem .7rem; }
.refund-only-nick { border: 1px solid var(--color-line); border-left: var(--marker-thickness) solid var(--color-warning-line);
  background: var(--color-warning-wash); color: var(--color-text); border-radius: var(--radius-panel); padding: .45rem .7rem; margin: .5rem 0; }
.refund-steps { list-style: none; margin: .4rem 0; padding: 0; }
.refund-step { padding: .2rem 0; }
.refund-step-mark { display: inline-block; width: 1.4rem; font-weight: 700; }
.refund-step-done .refund-step-mark { color: var(--color-ok-text); }
.refund-step-now { font-weight: 600; }
.refund-step-waiting { color: var(--color-text-muted); }
.refund-step-failed { color: var(--color-error-text); }
.refund-references { border-top: 1px dashed var(--color-line); padding-top: .4rem; }

/* ---------------------------------------------------------------- to-dos */
.refund-todo-list { list-style: none; margin: .3rem 0; padding: 0; }
.refund-todo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .8rem;
  border-top: 1px solid var(--color-line); padding: .45rem 0; }
.refund-todo:first-child { border-top: 0; }
.refund-todo > span:first-child { flex: 1 1 18rem; overflow-wrap: anywhere; }
.refund-todo-warn > span:first-child { color: var(--color-warning-text); font-weight: 600; }
.refund-todo-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.refund-todo-actions a { min-height: 40px; display: inline-flex; align-items: center; }

/* ---------------------------------------------------------------- cancelling a whole delivery */
.refund-cancel-root { padding: 0; background: transparent; }
.refund-cancel { border: 1px solid var(--color-line); border-radius: var(--radius-panel); padding: .6rem .85rem; margin: .6rem 0; }
.refund-cancelling { border-left: var(--marker-thickness) solid var(--color-warning-line); }
.refund-cancel h3 { margin: 0 0 .3rem; }
.refund-lines-box { margin: .3rem 0 .6rem; }
.refund-line { margin: .3rem 0; padding: .4rem .7rem; border-radius: var(--radius-panel); border: 1px solid var(--color-line);
  border-left: var(--marker-thickness) solid var(--color-line); background: var(--color-surface-quiet); font-size: .92rem; }
.refund-line-warn { background: var(--color-warning-wash); border-left-color: var(--color-warning-line); }
.refund-line-ok { background: var(--color-ok-wash); border-left-color: var(--color-ok-line); }
.refund-progress { margin: .6rem 0; }
.refund-progress-words { margin: 0 0 .3rem; }
.refund-progress progress { width: 100%; height: .9rem; accent-color: var(--color-ok-text); }
.refund-checklist .refund-row-done td { color: var(--color-text-secondary); }
.refund-message { margin: .8rem 0 .2rem; }
.refund-message > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.refund-message > summary:focus-visible { outline: var(--focus-ring-width) solid var(--color-focus-ring); outline-offset: 2px; }
.refund-message-body { border: 1px solid var(--color-line); border-radius: var(--radius-panel); padding: .5rem .8rem; background: var(--color-surface-quiet); }
.refund-copy textarea { width: 100%; box-sizing: border-box; font-family: inherit; background: var(--color-surface); }
.refund-cancel-todos { margin: .6rem 0; }

/* ---------------------------------------------------------------- credits and the accountant's list */
.refund-person-credits { margin-top: .8rem; border: 1px solid var(--color-line); }
.refund-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .4rem 1.4rem; }
.refund-credit-total { margin: .2rem 0 .4rem; }
.refund-table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.refund-table th { color: var(--color-text-secondary); font-weight: 600; text-align: left; }
.refund-table th, .refund-table td { border-bottom: 1px solid var(--color-line); padding: .35rem .4rem; vertical-align: top; }
.refund-table th.r, .refund-table td.r { text-align: right; }
.refund-credit-hint { margin: .3rem 0; padding: .4rem .7rem; border-radius: var(--radius-panel); background: var(--color-info-wash);
  border-left: var(--marker-thickness) solid var(--color-info-line); color: var(--color-text); font-size: .92rem; }
.refund-pay-credit { margin-top: .8rem; border: 1px solid var(--color-line); }

/* ---------------------------------------------------------------- phone width */
@media (max-width: 600px) {
  .refund-panel { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; margin: 0; border-radius: 0; }
  .refund-panel-inner { padding: .75rem; }
  .refund-facts { grid-template-columns: 1fr; gap: 0; }
  .refund-facts dd { margin-bottom: .3rem; }
  .refund-cancel { padding: .55rem .6rem; }
  .refund-table thead { display: none; }
  .refund-table tr { display: block; border-bottom: 1px solid var(--color-line); padding: .3rem 0; }
  .refund-table th, .refund-table td { display: block; border: 0; padding: .1rem 0; text-align: left; }
  .refund-table td.r { text-align: left; }
  .refund-table td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; font-weight: 600; color: var(--color-text-secondary); }
  .refund-panel .ct-actions button, .refund-cancel .ct-actions button { flex: 1 1 auto; min-height: 44px; }
  .refund-todo-actions { width: 100%; }
}
