/* Filter bar */
.admin-receipts__filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.admin-receipts__filter-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-icon-secondary, #8F8FA3);
  white-space: nowrap;
}

.admin-receipts__filter {
  padding: 8px 12px;
  border: 1px solid var(--stroke-secondary, #E0E0EB);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--Brand-Dark-blue, #1E1753);
  cursor: pointer;
  transition: border-color 0.2s;
}

.admin-receipts__filter:focus {
  outline: none;
  border-color: var(--Brand-Blue, #3A18B5);
}

.admin-receipts__filter--limit {
  width: auto;
  min-width: 80px;
}

.admin-receipts__filter option {
  font-size: 14px;
  color: var(--Brand-Dark-blue, #1E1753);
  background: #fff;
}

/* Table wrapper — контекст для overlay */
.admin-receipts__table-wrapper {
  position: relative;
}

/* Controls */
.admin-receipts__controls {
  padding: 16px 0;
}

.admin-receipts__search-input {
  padding: 8px 12px;
  border: 1px solid var(--stroke-secondary, #E0E0EB);
  border-radius: 8px;
  font-size: 14px;
  min-width: 240px;
  background: #fff;
  color: var(--Brand-Dark-blue, #1E1753);
  transition: border-color 0.2s;
}

.admin-receipts__search-input:focus {
  outline: none;
  border-color: var(--Brand-Blue, #3A18B5);
}

/* Table scroll */
.admin-receipts__table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-receipts__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.admin-receipts__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--stroke-secondary, #E0E0EB);
  border-top-color: var(--Brand-Blue, #3A18B5);
  border-radius: 50%;
  animation: admin-receipts-spin 0.6s linear infinite;
}

@keyframes admin-receipts-spin {
  to { transform: rotate(360deg); }
}

.admin-receipts__table-scroll::-webkit-scrollbar {
  height: 5px;
}

.admin-receipts__table-scroll::-webkit-scrollbar-track {
  background: var(--controls-bg-neutralLight-default, #F6F6F9);
}

.admin-receipts__table-scroll::-webkit-scrollbar-thumb {
  background: var(--stroke-secondary, #E0E0EB);
  border-radius: 3px;
}

.admin-receipts__table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--Brand-Blue, #3A18B5);
}

.admin-receipts__table {
  width: 100%;
  border-collapse: collapse;
}

/* Table header */
.admin-receipts__th {
  background: var(--Brand-Blue, #3A18B5);
  color: #fff;
  white-space: nowrap;
  padding: 12px 28px 12px 16px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border: none;
  user-select: none;
  position: relative;
}

.admin-receipts__th--sortable {
  cursor: pointer;
  transition: background 0.15s;
}

.admin-receipts__th--sortable:hover {
  background: var(--Brand-Dark-blue, #1E1753);
}

/* Sort icon — абсолютно позиционирован, не влияет на ширину th */
.admin-receipts__sort-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  opacity: 0.35;
  pointer-events: none;
}

.admin-receipts__sort-icon::after {
  content: '⇅';
}

.admin-receipts__th--asc .admin-receipts__sort-icon {
  opacity: 1;
}

.admin-receipts__th--asc .admin-receipts__sort-icon::after {
  content: '▲';
}

.admin-receipts__th--desc .admin-receipts__sort-icon {
  opacity: 1;
}

.admin-receipts__th--desc .admin-receipts__sort-icon::after {
  content: '▼';
}

/* Table body */
.admin-receipts__table tbody {
  transition: opacity 0.15s ease;
}

.admin-receipts__table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--stroke-secondary, #E0E0EB);
  white-space: nowrap;
  color: var(--Brand-Dark-blue, #1E1753);
  height: 65px;
}

.admin-receipts__table tbody tr:hover td {
  background: var(--controls-bg-neutralLight-default, #F6F6F9);
}

/* Pagination */
.admin-receipts__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--stroke-secondary, #E0E0EB);
}

.admin-receipts__pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--stroke-secondary, #E0E0EB);
  border-radius: 8px;
  background: #fff;
  color: var(--Brand-Dark-blue, #1E1753);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.admin-receipts__pagination-btn:hover:not(:disabled) {
  background: var(--controls-bg-neutralLight-default, #F6F6F9);
  border-color: var(--Brand-Blue, #3A18B5);
}

.admin-receipts__pagination-btn--disabled,
.admin-receipts__pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.admin-receipts__pagination-info {
  font-size: 14px;
  font-weight: 500;
  color: var(--Brand-Dark-blue, #1E1753);
  min-width: 60px;
  text-align: center;
}

/* Hidden state */
.admin-receipts--hidden {
  display: none;
}

/* Loading, Empty state */
.admin-receipts__loading,
.admin-receipts__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-icon-secondary, #8F8FA3);
  font-size: 16px;
}

/* Receipt button */
.admin-receipts__btn-receipt {
  white-space: nowrap;
  font-size: 13px;
  padding: 8px 16px;
}

.admin-receipts__btn-receipt:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-receipts__btn-receipt--loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Status badges */
.admin-receipts__status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-receipts__status--sent {
  background: #e6f9ed;
  color: #1a8a4a;
}

.admin-receipts__status--error {
  background: #fde8e8;
  color: #c53030;
}

.admin-receipts__status--default {
  background: var(--controls-bg-neutralLight-default, #F6F6F9);
  color: var(--text-icon-secondary, #8F8FA3);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-receipts__filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-receipts__filter {
    min-width: 100%;
    max-width: 100%;
  }

  .admin-receipts__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .admin-receipts__search-input {
    min-width: 100%;
  }
}
