body.auth-pending .sales-workspace { visibility: hidden; }

.sales-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(249, 115, 22, .06), transparent 26rem),
    #f5f6f8;
}

.sales-page .topbar {
  height: 64px;
  padding: 0 26px;
}

.sales-page .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 17px;
}

.sales-workspace {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.sales-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.sales-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(25px, 2.5vw, 31px);
}

.sales-heading p { margin: 0; color: var(--muted); }

.sales-updated {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .82);
}

.sales-updated span { color: var(--muted); font-size: 10px; }
.sales-updated strong { font-size: 10px; }

.sales-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.sales-kpis > button {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: white;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .045);
  text-align: left;
  transition: border-color 140ms, box-shadow 140ms, transform 140ms;
}

.sales-kpis > button:hover {
  border-color: #f4b183;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}

.sales-kpis > button.active {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .1);
}

.sales-kpis .kpi-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #344054;
  background: #f2f4f7;
  font-size: 17px;
  font-weight: 900;
}

.sales-kpis .action .kpi-icon { color: #c2410c; background: #fff7ed; }
.sales-kpis .review .kpi-icon { color: #6941c6; background: #f4f3ff; }
.sales-kpis .tickets .kpi-icon { color: #067647; background: #ecfdf3; }
.sales-kpis .all .kpi-icon { color: #026aa2; background: #f0f9ff; }

.sales-kpis button > div > span,
.sales-kpis button > div > strong { display: block; }
.sales-kpis button > div > span { color: var(--muted); font-size: 11px; }
.sales-kpis button > div > strong {
  margin-top: 2px;
  font-size: 21px;
  letter-spacing: -.04em;
}

.sales-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.sales-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px 10px;
}

.sales-board-heading h2 { font-size: 17px; }
.sales-board-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }

.sales-board-tools {
  width: min(760px, 64%);
  display: grid;
  grid-template-columns: minmax(190px, .75fr) minmax(260px, 1.25fr);
  align-items: end;
  gap: 10px;
}

.sales-event-filter {
  display: grid;
  gap: 5px;
  margin: 0;
}

.sales-event-filter > span {
  display: none;
}

.sales-event-filter select {
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid #d0d5dd;
  border-radius: 11px;
  color: #344054;
  background-color: white;
  font-size: 11px;
  font-weight: 700;
}

.sales-event-filter select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .1);
  outline: 0;
}

.sales-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid #d0d5dd;
  border-radius: 11px;
  background: white;
  color: #98a2b3;
}

.sales-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .1);
}

.sales-search input { border: 0; padding: 8px 0; box-shadow: none !important; }

.sales-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.sales-filters button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #667085;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.sales-filters button:hover { color: var(--ink); background: #f9fafb; }
.sales-filters button.active { color: var(--ink); border-color: var(--line); background: #f2f4f7; }

.sales-table-wrap {
  min-height: 300px;
  position: relative;
  overflow-x: auto;
}

.sales-table { width: 100%; border-collapse: collapse; }

.sales-table th {
  padding: 11px 14px;
  color: #667085;
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.sales-table td {
  padding: 14px;
  border-bottom: 1px solid #eef0f3;
  vertical-align: middle;
  font-size: 12px;
}

.sales-table th:nth-child(1) { width: 21%; }
.sales-table th:nth-child(2) { width: 17%; }
.sales-table th:nth-child(5) { width: 32%; }
.sales-table tbody tr { transition: background 140ms, box-shadow 140ms; }
.sales-table tbody tr:hover { background: #fcfcfd; }
.sales-table tbody tr[data-priority="review"] { box-shadow: inset 3px 0 #7f56d9; }
.sales-table tbody tr[data-priority="tickets"] { box-shadow: inset 3px 0 #17b26a; }
.sales-table tbody tr:last-child td { border-bottom: 0; }

.sales-customer strong,
.sales-purchase strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.sales-customer a,
.sales-purchase span {
  display: block;
  max-width: 250px;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  text-decoration: none;
}

.sales-customer a:hover { color: #175cd3; text-decoration: underline; }
.sales-total-cell { white-space: nowrap; }
.sales-order-total,
.mobile-order-total { display: grid; gap: 3px; }
.sales-order-total strong,
.mobile-order-total strong { color: var(--ink); font-size: 12px; font-weight: 850; }
.sales-coupon-summary { color: #067647; font-size: 9px; font-weight: 750; }
.sales-purchase .sales-coupon-tag {
  display: inline-flex;
  width: fit-content;
  max-width: none;
  padding: 3px 6px;
  border-radius: 6px;
  color: #067647;
  background: #ecfdf3;
  font-size: 9px;
  font-weight: 800;
}
.sales-date-cell { white-space: nowrap; color: #475467; font-size: 11px !important; }
.sales-action-cell { min-width: 300px; }

.sales-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.sales-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sales-status.review { color: #6941c6; border-color: #d9d6fe; background: #f4f3ff; }
.sales-status.waiting { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.sales-status.tickets { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.sales-status.sent { color: #026aa2; border-color: #b9e6fe; background: #f0f9ff; }
.sales-status.cancelled,
.sales-status.rejected { color: #b42318; border-color: #fecdca; background: #fef3f2; }

.sales-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sales-action-button,
.sales-action-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  background: white;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.sales-action-button:hover,
.sales-action-link:hover { border-color: #98a2b3; background: #f9fafb; }

.sales-action-button.primary {
  color: white;
  border-color: #111827;
  background: #111827;
}

.sales-action-button.primary:hover { border-color: #344054; background: #344054; }
.sales-action-button.secondary { color: #175cd3; border-color: #b2ccff; background: #eff4ff; }
.sales-action-button.warning { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.sales-action-button.warning:hover { border-color: #fdb022; background: #fef0c7; }
.sales-action-button.danger { color: #b42318; border-color: #fecdca; background: #fff; }
.sales-action-button.danger:hover { background: #fef3f2; }
.sales-action-button:disabled { opacity: .55; cursor: wait; }
.sales-action-muted { color: #98a2b3; font-size: 10px; }
.sales-reservation-timer {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  color: #b54708;
  background: #fffaeb;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.sales-reservation-timer.urgent { color: #b42318; background: #fef3f2; }

.sales-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.sales-empty > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #067647;
  background: #ecfdf3;
  font-size: 20px;
  font-weight: 900;
}

.sales-empty strong { color: #344054; }
.sales-empty p { margin: 0; font-size: 11px; }
.sales-mobile-list { display: none; }

.sales-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.sales-pagination > div { display: flex; gap: 8px; }
.sales-pagination .button { padding: 7px 10px; border-radius: 8px; font-size: 10px; }

.sales-mobile-card {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}

.sales-mobile-card.review { border-left-color: #7f56d9; }
.sales-mobile-card.tickets { border-left-color: #17b26a; }
.sales-mobile-card:last-child { border-bottom: 0; }
.sales-mobile-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sales-mobile-card h3 { margin: 0; font-size: 13px; }
.sales-mobile-card header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.sales-mobile-card .mobile-purchase {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 9px;
  padding: 10px;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 11px;
}

.sales-mobile-card .mobile-purchase span {
  max-width: 50%;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mobile-summary strong { font-size: 15px; }
.mobile-summary span { color: var(--muted); font-size: 10px; }

.sales-receipt-modal {
  width: min(1080px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 100px rgba(16, 24, 40, .38);
}

.sales-receipt-modal::backdrop {
  background: rgba(16, 24, 40, .68);
  backdrop-filter: blur(4px);
}

.sales-receipt-viewer {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.sales-receipt-viewer > header,
.sales-receipt-viewer > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  background: white;
}

.sales-receipt-viewer > header { border-bottom: 1px solid var(--line); }
.sales-receipt-viewer > footer { border-top: 1px solid var(--line); }
.sales-receipt-viewer h2 { margin: 4px 0 0; font-size: 18px; }
.sales-receipt-viewer header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.sales-receipt-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #475467;
  background: white;
  font-size: 23px;
  line-height: 1;
}

.sales-receipt-close:hover { color: var(--ink); background: #f9fafb; }

.sales-receipt-stage {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .09), transparent 30rem),
    #1f2937;
}

.sales-receipt-stage.pdf {
  padding: 0;
  background: #525659;
}

.sales-receipt-stage img {
  display: block;
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  cursor: zoom-in;
}

.sales-receipt-stage img.zoomed {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.sales-receipt-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.sales-receipt-loading,
.sales-receipt-error {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: #e4e7ec;
  text-align: center;
}

.sales-receipt-loading span {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: white;
  border-radius: 50%;
  animation: receipt-spin .75s linear infinite;
}

.sales-receipt-loading p,
.sales-receipt-error p { margin: 0; font-size: 11px; }
.sales-receipt-error strong { color: white; font-size: 14px; }
.sales-receipt-file-actions,
.sales-receipt-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sales-receipt-file-actions .button {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 10px;
  text-decoration: none;
}
.sales-receipt-review-actions .sales-action-button { min-height: 34px; }

body.receipt-modal-open { overflow: hidden; }

@keyframes receipt-spin {
  to { transform: rotate(360deg); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-table th:nth-child(6),
  .sales-table td:nth-child(6) { display: none; }
}

@media (max-width: 820px) {
  .sales-page .topbar { flex-wrap: wrap; }
  .sales-workspace { width: min(100% - 28px, 1480px); padding-top: 14px; }
  .sales-heading { align-items: flex-start; flex-direction: column; }
  .sales-updated { width: 100%; text-align: left; }
  .sales-kpis { gap: 9px; }
  .sales-kpis > button { min-height: 70px; padding: 10px; }
  .sales-kpis .kpi-icon { width: 36px; height: 36px; }
  .sales-kpis button > div > strong { font-size: 20px; }
  .sales-board-heading { align-items: stretch; flex-direction: column; padding: 13px 14px 10px; }
  .sales-board-tools { width: 100%; grid-template-columns: 1fr; }
  .sales-search { width: 100%; }
  .sales-filters { padding: 0 14px 9px; }
  .sales-table-wrap { display: none; }
  .sales-mobile-list { display: block; min-height: 220px; }
  .sales-pagination { padding: 13px 16px; }
  .sales-quick-actions { align-items: stretch; }
  .sales-action-button,
  .sales-action-link { flex: 1 1 auto; }
  .sales-receipt-modal {
    width: calc(100vw - 18px);
    height: calc(100vh - 18px);
    border-radius: 17px;
  }
  .sales-receipt-viewer > header,
  .sales-receipt-viewer > footer { padding: 13px; }
  .sales-receipt-viewer > footer { align-items: stretch; flex-direction: column; }
  .sales-receipt-file-actions,
  .sales-receipt-review-actions { width: 100%; }
  .sales-receipt-file-actions > *,
  .sales-receipt-review-actions > * { flex: 1; }
}

@media (max-width: 470px) {
  .sales-page .status-row { max-width: none; }
  .sales-kpis { grid-template-columns: 1fr 1fr; }
  .sales-kpis > button {
    min-height: 68px;
    gap: 9px;
  }
  .sales-kpis button > div > span { font-size: 10px; }
  .sales-mobile-card header { display: grid; }
  .sales-mobile-card .sales-status { width: fit-content; }
}

@media (prefers-reduced-motion: reduce) {
  .sales-kpis > button,
  .sales-table tbody tr { transition: none; }
  .sales-receipt-loading span { animation: none; }
}
