/* I LOVE MY JOB — Summary Work Done v5 */
.reg-v5-card,
.reg-v5-editor,
.reg-v5-confirm {
  --reg-bg: var(--surface, #fff);
  --reg-bg-soft: var(--surface-soft, #f7f7f5);
  --reg-text: var(--text, #191919);
  --reg-muted: var(--text-muted, #71717a);
  --reg-line: var(--border, #e7e5e4);
  --reg-yellow: var(--accent, #e7b91f);
  --reg-yellow-soft: #fff8dc;
  --reg-red: #b42318;
  --reg-red-soft: #fff1f0;
  --reg-green: #157347;
  --reg-green-soft: #ebf8f1;
  color: var(--reg-text);
  font: inherit;
}

.reg-v5-card {
  margin: 20px 0;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--reg-line);
  border-radius: 26px;
  background: var(--reg-bg);
  box-shadow: 0 16px 46px rgba(24, 24, 27, .07);
}

.reg-v5-card *,
.reg-v5-editor *,
.reg-v5-confirm * {
  box-sizing: border-box;
}

.reg-v5-card-head,
.reg-v5-item-head,
.reg-v5-save-bar,
.reg-v5-add-row,
.reg-v5-inline-actions,
.reg-v5-item-actions,
.reg-v5-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reg-v5-card-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.reg-v5-card h3,
.reg-v5-card h4,
.reg-v5-card h5,
.reg-v5-editor h3,
.reg-v5-confirm h3 {
  margin: 0;
  color: var(--reg-text);
  line-height: 1.28;
}

.reg-v5-card h3 {
  margin-top: 4px;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

.reg-v5-card p,
.reg-v5-card small {
  color: var(--reg-muted);
}

.reg-v5-card-head p,
.reg-v5-item-head p,
.reg-v5-description,
.reg-v5-duplicate p,
.reg-v5-returned p,
.reg-v5-table-note {
  margin: 5px 0 0;
}

.reg-v5-eyebrow {
  color: #9b7600;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.reg-v5-summary-status,
.reg-v5-stage,
.reg-v5-type,
.reg-v5-count,
.reg-v5-participants span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--reg-bg-soft);
  color: var(--reg-muted);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.reg-v5-summary-status.is-approved,
.reg-v5-participants span.is-confirmed {
  background: var(--reg-green-soft);
  color: var(--reg-green);
}

.reg-v5-summary-status.is-pending {
  background: var(--reg-yellow-soft);
  color: #8a6500;
}

.reg-v5-summary-status.is-returned {
  background: var(--reg-red-soft);
  color: var(--reg-red);
}

.reg-v5-deadline,
.reg-v5-returned,
.reg-v5-rerouted {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--reg-yellow-soft);
}

.reg-v5-deadline span,
.reg-v5-deadline small,
.reg-v5-returned p {
  grid-column: 1 / -1;
}

.reg-v5-deadline span {
  color: #8a6500;
  font-size: .78rem;
  font-weight: 750;
}

.reg-v5-deadline b {
  justify-self: end;
}

.reg-v5-returned {
  background: var(--reg-red-soft);
  color: var(--reg-red);
}

.reg-v5-rerouted {
  margin: 14px 0 18px;
  background: var(--reg-yellow-soft);
  color: #765800;
}

.reg-v5-rerouted p {
  grid-column: 1 / -1;
  margin: 0;
}

.reg-v5-filter {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.reg-v5-filter::-webkit-scrollbar {
  display: none;
}

.reg-v5-filter button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--reg-line);
  border-radius: 999px;
  background: var(--reg-bg);
  color: var(--reg-muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.reg-v5-filter button.is-active {
  border-color: var(--reg-yellow);
  background: var(--reg-yellow-soft);
  color: var(--reg-text);
}

.reg-v5-filter span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
}

.reg-v5-add-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 17px;
}

.reg-v5-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--reg-text);
  color: #fff;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}

.reg-v5-button.primary {
  background: var(--reg-yellow);
  color: #171717;
}

.reg-v5-button.secondary {
  border-color: var(--reg-line);
  background: var(--reg-bg-soft);
  color: var(--reg-text);
}

.reg-v5-button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--reg-text);
}

.reg-v5-button.danger {
  color: var(--reg-red);
}

.reg-v5-button:focus-visible,
.reg-v5-filter button:focus-visible,
.reg-v5-field :is(input, select, textarea):focus-visible {
  outline: 3px solid rgba(231, 185, 31, .38);
  outline-offset: 2px;
}

.reg-v5-button:disabled {
  opacity: .44;
  cursor: not-allowed;
}

.reg-v5-items,
.reg-v5-review-list {
  display: grid;
  gap: 14px;
}

.reg-v5-item,
.reg-v5-review-case {
  padding: 18px;
  border: 1px solid var(--reg-line);
  border-radius: 20px;
  background: var(--reg-bg);
}

.reg-v5-item-head {
  align-items: flex-start;
}

.reg-v5-item-head h4 {
  margin-top: 7px;
  font-size: 1.05rem;
}

.reg-v5-type {
  background: var(--reg-yellow-soft);
  color: #765800;
}

.reg-v5-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.reg-v5-meta div,
.reg-v5-review-grid div,
.reg-v5-payroll-totals div {
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--reg-bg-soft);
}

.reg-v5-meta dt,
.reg-v5-review-grid span,
.reg-v5-payroll-totals span {
  color: var(--reg-muted);
  font-size: .75rem;
}

.reg-v5-meta dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.reg-v5-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.reg-v5-duplicate,
.reg-v5-review-match {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #ecd47f;
  border-radius: 15px;
  background: var(--reg-yellow-soft);
}

.reg-v5-duplicate.is-exact,
.reg-v5-review-match.is-exact {
  border-color: #efb5af;
  background: var(--reg-red-soft);
}

.reg-v5-inline-actions,
.reg-v5-item-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.reg-v5-estimate {
  margin-top: 13px;
  padding: 14px;
  border-radius: 16px;
  background: var(--reg-green-soft);
}

.reg-v5-estimate > div,
.reg-v5-estimate li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.reg-v5-estimate ul {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 10px 0;
  border-block: 1px solid rgba(21, 115, 71, .15);
  list-style: none;
}

.reg-v5-estimate small {
  display: block;
  color: #376d52;
}

.reg-v5-save-bar {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  align-items: flex-end;
  margin: 20px -6px -6px;
  padding: 14px;
  border: 1px solid var(--reg-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--reg-bg) 94%, transparent);
  box-shadow: 0 10px 30px rgba(24, 24, 27, .12);
  backdrop-filter: blur(14px);
}

.reg-v5-save-bar > div:first-child {
  display: grid;
  gap: 3px;
}

.reg-v5-save-bar .is-dirty {
  color: #9b6500;
  font-weight: 750;
}

.reg-v5-save-actions {
  display: flex;
  gap: 9px;
}

.reg-v5-empty,
.reg-v5-unavailable {
  padding: 26px 16px;
  text-align: center;
}

.reg-v5-empty-mark {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--reg-yellow);
}

.reg-v5-loading {
  display: flex;
  gap: 8px;
  min-height: 120px;
  align-items: center;
  justify-content: center;
}

.reg-v5-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--reg-yellow);
  animation: reg-v5-pulse 900ms ease-in-out infinite alternate;
}

.reg-v5-loading span:nth-child(2) {
  animation-delay: 180ms;
}

.reg-v5-loading span:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes reg-v5-pulse {
  to { opacity: .25; transform: translateY(-5px); }
}

.reg-v5-editor,
.reg-v5-confirm {
  width: min(640px, calc(100vw - 28px));
  max-height: min(84vh, 780px);
  padding: 22px;
  overflow: auto;
  border-radius: 24px;
  background: var(--reg-bg);
}

.reg-v5-field,
.reg-v5-field-grid {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.reg-v5-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reg-v5-field-grid .reg-v5-field {
  margin: 0;
}

.reg-v5-field label {
  color: var(--reg-text);
  font-size: .84rem;
  font-weight: 750;
}

.reg-v5-field :is(input, select, textarea) {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--reg-line);
  border-radius: 13px;
  background: var(--reg-bg);
  color: var(--reg-text);
  font: inherit;
}

.reg-v5-field textarea {
  min-height: 120px;
  resize: vertical;
}

.reg-v5-editor:not(.is-registration) .reg-v5-registration-only {
  display: none;
}

.reg-v5-editor-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.reg-v5-confirm ul {
  padding-left: 22px;
}

.reg-v5-confirm li {
  margin-block: 7px;
}

.reg-v5-review-grid,
.reg-v5-payroll-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.reg-v5-review-grid div,
.reg-v5-payroll-totals div {
  display: grid;
  gap: 4px;
}

.reg-v5-review-participants ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.reg-v5-review-participants li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--reg-line);
}

.reg-v5-review-participants li div {
  display: grid;
}

.reg-v5-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--reg-line);
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
}

.reg-v5-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--reg-bg);
  font-size: .82rem;
}

.reg-v5-table :is(th, td) {
  padding: 11px 12px;
  border-bottom: 1px solid var(--reg-line);
  text-align: left;
  white-space: nowrap;
}

.reg-v5-table th {
  position: sticky;
  top: 0;
  background: var(--reg-bg-soft);
  color: var(--reg-muted);
  font-weight: 800;
}

.reg-v5-table td.is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reg-v5-table-note {
  font-size: .77rem;
}

[data-theme="dark"] .reg-v5-card,
[data-theme="dark"] .reg-v5-editor,
[data-theme="dark"] .reg-v5-confirm {
  --reg-bg: #171717;
  --reg-bg-soft: #242424;
  --reg-text: #fafafa;
  --reg-muted: #b7b7bd;
  --reg-line: #383838;
  --reg-yellow-soft: #342c12;
  --reg-red-soft: #351d1b;
  --reg-green-soft: #142c20;
}

@media (max-width: 720px) {
  .reg-v5-card {
    margin: 14px 0;
    padding: 17px 14px;
    border-radius: 22px;
  }

  .reg-v5-card-head,
  .reg-v5-item-head,
  .reg-v5-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .reg-v5-summary-status,
  .reg-v5-stage {
    align-self: flex-start;
  }

  .reg-v5-add-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reg-v5-button {
    width: 100%;
  }

  .reg-v5-save-actions,
  .reg-v5-inline-actions,
  .reg-v5-item-actions,
  .reg-v5-editor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .reg-v5-save-bar {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .reg-v5-field-grid,
  .reg-v5-review-grid,
  .reg-v5-payroll-totals {
    grid-template-columns: 1fr;
  }

  .reg-v5-editor,
  .reg-v5-confirm {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 24px);
    padding: 18px 15px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
  }

  .reg-v5-review-participants li {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-v5-loading span {
    animation: none;
  }
}
