.orca-documents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.orca-documents-header--with-views {
  display: block;
}

.orca-documents-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.orca-documents-title--desktop {
  display: none;
}

.orca-documents-title--with-hint {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.125rem;
}

.orca-documents-title--with-hint h2 {
  flex: 0 0 auto;
  line-height: 1.15;
}

.orca-documents-view-hint {
  overflow: hidden;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orca-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 0.75rem;
  min-width: 0;
}

.orca-filter-toolbar--with-views {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  gap: 0;
}

.orca-documents-heading-row {
  display: none;
}

.orca-documents-filter-row {
  display: contents;
}

.orca-documents-filter-row--client {
  display: contents;
}

.orca-receipt-view-switcher {
  display: none;
}

.orca-sort-menu {
  display: none;
}

.orca-receipt-view-option {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: #45464d;
  font-size: 0.875rem;
  font-weight: 700;
  gap: 0.375rem;
  line-height: 1;
  padding: 0 0.375rem 0 0.75rem;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}

.orca-receipt-view-option:hover,
.orca-receipt-view-option:focus-visible {
  border-color: #c6c6cd;
  background: #ffffff;
  color: #1b1b1d;
}

.orca-receipt-view-option.is-active {
  border-color: #c6c6cd;
  background: #ffffff;
  color: #1b1b1d;
}

.orca-receipt-view-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  min-height: 1.625rem;
  border-radius: 9999px;
  background: #f0edef;
  color: #45464d;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 0.5rem;
}

.orca-receipt-view-option.is-active .orca-receipt-view-count {
  background: #000000;
  color: #ffffff;
}

.orca-mobile-filter-row {
  display: contents;
}

.orca-mobile-filter-toggle {
  display: none;
}

.orca-mobile-filter-fields,
.orca-mobile-filter-actions {
  display: none;
}

.orca-search-field {
  position: relative;
  flex: 1 1 20rem;
  max-width: 24rem;
  min-width: 15rem;
}

.receipt-search {
  box-sizing: border-box;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.receipt-search::-webkit-search-cancel-button {
  display: none;
  appearance: none;
}

.orca-search-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  color: #64748b;
  transform: translateY(-50%);
  transition: background-color 120ms ease, color 120ms ease;
}

.orca-search-clear:hover,
.orca-search-clear:focus-visible {
  background: #e4e2e4;
  color: #1b1b1d;
}

.orca-search-clear .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.orca-search-clear.hidden {
  display: none;
}

.orca-filter-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.orca-receipt-results-body {
  --orca-receipt-min-rows: 10;
}

#documents.orca-documents-loading .orca-receipt-results-body,
#documents.orca-documents-loading .orca-pagination {
  opacity: 0.62;
  transition: opacity 120ms ease;
}

.orca-date-range-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(9rem, 1fr));
  gap: 0.5rem;
  flex: 0 0 19.5rem;
}

.orca-filter-date-field,
.orca-status-filter-summary,
.orca-payment-source-filter-summary,
.orca-note-filter-summary,
.orca-overflow-filter-summary,
.orca-sort-summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  border: 1px solid #c6c6cd;
  border-radius: 0.5rem;
  background: #f6f3f5;
  color: #45464d;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 0.375rem;
  letter-spacing: 0;
  padding: 0 0.75rem;
  text-transform: none;
}

.orca-filter-date-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  color: #1b1b1d;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  outline: none;
  text-transform: none;
}

.orca-filter-date-field {
  gap: 0.25rem;
}

.orca-filter-date-input::placeholder {
  color: #8f9098;
}

.orca-status-filter-field,
.orca-payment-source-filter-field,
.orca-note-filter-menu,
.orca-overflow-filter-menu,
.orca-sort-menu {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}

.orca-status-filter-field *,
.orca-payment-source-filter-field *,
.orca-note-filter-menu *,
.orca-overflow-filter-menu *,
.orca-sort-menu * {
  cursor: pointer;
}

.orca-status-filter-summary,
.orca-payment-source-filter-summary,
.orca-note-filter-summary,
.orca-overflow-filter-summary,
.orca-sort-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.orca-status-filter-menu,
.orca-status-filter-summary,
.orca-payment-source-filter-menu,
.orca-payment-source-filter-summary,
.orca-note-filter-menu,
.orca-note-filter-summary {
  width: 100%;
}

.orca-sort-summary {
  text-transform: none;
}

.orca-status-filter-current,
.orca-payment-source-filter-current,
.orca-note-filter-current,
.orca-sort-current {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 1.5rem;
  border-radius: 9999px;
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
  overflow: visible;
  padding: 0.125rem 0;
  text-overflow: clip;
  text-transform: none;
  white-space: nowrap;
}

.orca-payment-source-filter-current {
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.orca-filter-control-label {
  color: #45464d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.orca-status-filter-panel {
  z-index: 85;
  min-width: 12rem;
}

.orca-payment-source-filter-panel {
  z-index: 85;
  min-width: 17rem;
}

.orca-sort-panel {
  z-index: 85;
  min-width: 14.5rem;
}

.orca-overflow-filter-summary {
  position: relative;
  justify-content: center;
  width: 2.5rem;
  min-width: 2.5rem;
  gap: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #45464d;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 0;
  transition: background-color 120ms ease, color 120ms ease;
}

.orca-overflow-filter-summary:hover,
.orca-overflow-filter-summary:focus-visible {
  background: #f6f3f5;
  color: #0058be;
}

.orca-overflow-filter-count {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  min-height: 1.125rem;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  background: #d8e2ff;
  color: #1d4ed8;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 0.25rem;
}

.orca-overflow-filter-count.hidden {
  display: none;
}

.orca-overflow-filter-panel {
  z-index: 90;
  width: min(25rem, calc(100vw - 2rem));
  gap: 0.875rem;
  padding: 1rem;
}

.orca-overflow-filter-summary::after {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  z-index: 95;
  border-radius: 0.375rem;
  background: #111827;
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  padding: 0.375rem 0.5rem;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.125rem);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.orca-overflow-filter-summary:hover::after,
.orca-overflow-filter-summary:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.orca-overflow-filter-header,
.orca-overflow-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.orca-overflow-filter-header {
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 800;
}

.orca-overflow-filter-clear {
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 700;
}

.orca-overflow-filter-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.orca-overflow-filter-label {
  color: #45464d;
  font-size: 0.8125rem;
  font-weight: 800;
}

.orca-note-filter-control {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(7rem, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.orca-note-query-input {
  min-width: 0;
  min-height: 2.5rem;
  border: 1px solid #c6c6cd;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 600;
  outline: none;
  padding: 0 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.orca-note-query-input:focus {
  border-color: #0058be;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.18);
}

.orca-note-query-input::placeholder {
  color: #8f9098;
}

.orca-note-query-input.hidden {
  display: none;
}

.orca-note-filter-panel {
  z-index: 95;
  min-width: 10rem;
}

.orca-note-filter-option {
  justify-content: space-between;
  min-height: 2.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.75rem;
  padding: 0.375rem 0.625rem;
}

.orca-note-filter-option:hover,
.orca-note-filter-option:focus-visible,
.orca-note-filter-option.is-selected {
  background: #f6f3f5;
  outline: none;
}

.orca-note-filter-check {
  color: #0058be;
  opacity: 0;
}

.orca-note-filter-check.is-visible,
.orca-note-filter-option.is-selected .orca-note-filter-check {
  opacity: 1;
}

.orca-overflow-filter-actions {
  justify-content: flex-end;
  padding-top: 0.125rem;
}

.orca-overflow-filter-cancel,
.orca-overflow-filter-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.375rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 0 0.875rem;
}

.orca-overflow-filter-cancel {
  color: #45464d;
}

.orca-overflow-filter-cancel:hover,
.orca-overflow-filter-cancel:focus-visible {
  background: #f6f3f5;
  color: #1b1b1d;
}

.orca-overflow-filter-apply {
  background: #0058be;
  color: #ffffff;
}

.orca-overflow-filter-apply:hover,
.orca-overflow-filter-apply:focus-visible {
  background: #004395;
}

.orca-active-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.875rem;
}

.orca-active-filter-row.hidden {
  display: none;
}

.orca-active-filter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 2.25rem;
  gap: 0.5rem;
  border: 1px solid #d8d6dc;
  border-radius: 0.5rem;
  background: #f6f3f5;
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0 0.75rem;
  text-decoration: none;
}

.orca-active-filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orca-filter-clear-all {
  width: auto;
  min-height: 2.25rem;
  border-radius: 0.5rem;
  color: #1d4ed8;
  gap: 0;
  padding: 0 0.25rem;
}

.orca-filter-clear-all::after {
  display: none;
}

.orca-sort-option-group {
  display: grid;
  gap: 0.125rem;
}

.orca-sort-option-group + .orca-sort-option-group {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid #f0edef;
}

.orca-sort-option-group-label {
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.625rem 0.25rem;
  text-transform: uppercase;
}

.orca-status-filter-option {
  padding: 0.375rem;
}

.orca-payment-source-filter-option {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
}

.orca-payment-source-filter-option:hover,
.orca-payment-source-filter-option:focus-visible,
.orca-payment-source-filter-option.is-selected {
  background: #f6f3f5;
  outline: none;
}

.orca-payment-source-filter-option-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.125rem;
}

.orca-payment-source-filter-option-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.375rem;
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.orca-payment-source-filter-option-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orca-payment-source-filter-option-description {
  overflow: hidden;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orca-payment-source-filter-check {
  flex: 0 0 auto;
  margin-left: auto;
  margin-top: 0.125rem;
  color: #0058be;
  opacity: 0;
}

.orca-payment-source-filter-check.is-visible,
.orca-payment-source-filter-option.is-selected .orca-payment-source-filter-check {
  opacity: 1;
}

.orca-sort-option {
  justify-content: space-between;
  min-height: 2.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.75rem;
  padding: 0.375rem 0.625rem;
}

.orca-sort-option:hover,
.orca-sort-option:focus-visible,
.orca-sort-option.is-selected {
  background: #f6f3f5;
  outline: none;
}

.orca-sort-check {
  color: #0058be;
  opacity: 0;
}

.orca-sort-option.is-selected .orca-sort-check {
  opacity: 1;
}

@media (min-width: 768px) {
  .orca-filter-toolbar {
    flex-wrap: nowrap;
  }

  .orca-documents-header:not(.orca-documents-header--with-views) {
    display: block;
  }

  .orca-documents-header:not(.orca-documents-header--with-views) .orca-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    margin-top: 0.875rem;
  }

  .orca-documents-title--desktop {
    display: flex;
  }

  .orca-documents-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
  }

  .orca-documents-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e4e2e4;
  }

  .orca-documents-filter-row--client {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
  }

  .orca-documents-filter-row .orca-mobile-filter-row,
  .orca-documents-filter-row--client .orca-mobile-filter-row,
  .orca-filter-toolbar > .orca-mobile-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
  }

  .orca-documents-filter-row .orca-search-field,
  .orca-documents-filter-row--client .orca-search-field,
  .orca-filter-toolbar > .orca-mobile-filter-row .orca-search-field {
    flex: 0 0 20rem;
    min-width: 0;
    max-width: none;
    width: 20rem;
  }

  .orca-filter-toolbar--with-views .orca-search-field {
    max-width: none;
  }

  .orca-filter-panel {
    flex: 0 0 46.25rem;
    width: 46.25rem;
    max-width: none;
    gap: 0.5rem;
  }

  .orca-date-range-filter {
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
    flex: 0 0 18rem;
    gap: 0.625rem;
  }

  .orca-status-filter-field,
  .orca-payment-source-filter-field,
  .orca-overflow-filter-menu,
  .orca-sort-menu {
    max-width: none;
  }

  .orca-status-filter-field {
    width: 10.5rem;
  }

  .orca-sort-menu {
    width: 13.75rem;
  }

  .orca-overflow-filter-menu {
    width: 2.5rem;
  }

  .orca-payment-source-filter-panel {
    width: max-content;
    min-width: 24rem;
    max-width: min(26rem, calc(100vw - 3rem));
  }

  .orca-sort-summary {
    max-width: 100%;
  }

  .orca-receipt-view-switcher {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.25rem;
  }

  .orca-sort-menu {
    display: block;
  }
}

@media (max-width: 767px) {
  .orca-filter-toolbar {
    gap: 0;
  }

  .orca-documents-filter-row,
  .orca-documents-filter-row--client {
    display: block;
    width: 100%;
  }

  .orca-documents-filter-row .orca-mobile-filter-row,
  .orca-documents-filter-row--client .orca-mobile-filter-row,
  .orca-filter-toolbar > .orca-mobile-filter-row {
    width: 100%;
  }

  .orca-mobile-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: 0.625rem;
    align-items: center;
  }

  .orca-mobile-filter-row .orca-search-field {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .orca-mobile-filter-row .receipt-search {
    height: 2.75rem;
    border-radius: 0.875rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  .orca-mobile-filter-row .orca-search-field > .lucide-icon {
    top: 50%;
    width: 1.375rem;
    height: 1.375rem;
    transform: translateY(-50%);
  }

  .orca-mobile-filter-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 0.875rem;
    background: transparent;
    color: #45464d;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  }

  .orca-mobile-filter-toggle .lucide-icon {
    width: 1.375rem;
    height: 1.375rem;
  }

  .orca-mobile-filter-toggle:hover,
  .orca-mobile-filter-toggle:focus-visible,
  .orca-mobile-filter-toggle--active {
    background: #f6f3f5;
    color: #0058be;
  }

  .orca-mobile-filter-dot {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    background: #0058be;
  }

  .orca-filter-panel {
    display: none;
  }

  .orca-mobile-filter-dialog .orca-mobile-filter-fields {
    display: grid;
    gap: 0.875rem;
  }

  .orca-mobile-filter-body {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
  }

  .orca-status-filter-field {
    width: 100%;
  }

  .orca-payment-source-filter-field,
  .orca-payment-source-filter-menu,
  .orca-payment-source-filter-summary,
  .orca-note-filter-menu,
  .orca-note-filter-summary {
    width: 100%;
  }

  .orca-payment-source-filter-panel,
  .orca-note-filter-panel {
    right: 0;
    left: 0;
    min-width: 0;
  }

  .orca-status-filter-summary,
  .orca-payment-source-filter-summary,
  .orca-note-filter-summary,
  .orca-overflow-filter-summary {
    min-height: 3rem;
  }

  .orca-overflow-filter-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0.375rem;
  }

  .orca-note-filter-control {
    grid-template-columns: minmax(8rem, 0.9fr) minmax(7rem, 1fr);
  }

  .orca-filter-clear-all {
    width: auto;
    min-height: 2.25rem;
    border: 0;
    background: transparent;
  }

  .orca-mobile-filter-actions {
    position: sticky;
    bottom: calc(-1rem - env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0 -1rem calc(-1rem - env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e4e2e4;
    background: #ffffff;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .orca-mobile-filter-clear,
  .orca-mobile-filter-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 800;
    padding: 0 0.875rem;
  }

  .orca-mobile-filter-clear {
    color: #1d4ed8;
  }

  .orca-mobile-filter-clear.hidden {
    display: none;
  }

  .orca-mobile-filter-apply {
    background: #0058be;
    color: #ffffff;
  }

  .orca-mobile-focused-field-body .orca-mobile-filter-options-mobile {
    padding: 0;
  }

  .orca-status-filter-menu {
    position: static;
  }

  #documents:focus-within .orca-receipt-results-body {
    min-height: calc(var(--orca-receipt-min-rows) * 3.95rem);
  }

  .orca-status-filter-panel {
    top: auto;
    bottom: calc(100% + 0.375rem);
    right: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    max-height: min(18rem, calc(100dvh - 2rem));
    overflow-y: auto;
  }
}
