.edit-button {
  margin-right: 6px;
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: #d6e8ff;
  color: #2563eb;
  font: 600 11px "DM Sans";
  cursor: pointer;
  white-space: nowrap;
}

.desktop-participant-content { display: block; }
.mobile-card-overview { display: none; }

@media (max-width: 700px) {
  .sales-panel .table-wrap,
  .all-sales-modal .table-wrap {
    overflow: visible;
    border-top: 1px solid #e7eaf0;
  }

  .sales-panel table,
  .all-sales-modal table,
  .sales-panel tbody,
  .all-sales-modal tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .sales-panel thead,
  .all-sales-modal thead { display: none; }

  .sales-panel tbody,
  .all-sales-modal tbody { padding: 7px; }

  .sales-panel tr.sales-row,
  .all-sales-modal tr.sales-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px 10px;
    margin-bottom: 7px;
    padding: 12px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 10px #14213d08;
  }

  .sales-panel tr.sales-row { grid-template-columns: minmax(0, 1fr); }

  .sales-panel tr.sales-row:nth-child(even),
  .all-sales-modal tr.sales-row:nth-child(even) {
    border-color: #dbeafe;
    background: #eff6ff;
  }

  .sales-panel tr.sales-row:last-child,
  .all-sales-modal tr.sales-row:last-child { margin-bottom: 0; }

  .sales-panel tr.sales-row:hover td,
  .all-sales-modal tr.sales-row:hover td { background: transparent; }

  .sales-panel tr.sales-row td,
  .all-sales-modal tr.sales-row td {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 3px;
    padding: 0;
    border: 0;
    font-size: 12px;
    line-height: 1.25;
  }

  .sales-panel tr.sales-row td::before,
  .all-sales-modal tr.sales-row td::before,
  .mobile-field-label {
    color: #8490a5;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .65px;
    text-transform: uppercase;
  }

  .sales-panel tr.sales-row td:first-child,
  .all-sales-modal tr.sales-row td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 9px;
    border-bottom: 1px solid #edf0f5;
  }

  .sales-panel tr.sales-row td:first-child { border-bottom-color: #cbd5e1; }

  .sales-panel tr.sales-row td:first-child strong,
  .all-sales-modal tr.sales-row td:first-child strong {
    color: #14213d;
    font-size: 15px;
    line-height: 1.2;
  }

  .sales-panel tr.sales-row td:nth-child(1)::before { display: none; }
  .all-sales-modal tr.sales-row td:nth-child(1)::before { content: "Participante"; }
  .sales-panel tr.sales-row td:nth-child(2)::before,
  .all-sales-modal tr.sales-row td:nth-child(2)::before { content: "Tipo de ingresso"; }
  .sales-panel tr.sales-row td:nth-child(3)::before { content: "Observação"; }
  .all-sales-modal tr.sales-row td:nth-child(3)::before { content: "Contato / observação"; }
  .all-sales-modal tr.sales-row td:nth-child(4)::before { content: "Evento"; }
  .all-sales-modal tr.sales-row td:nth-child(5)::before { content: "Valor"; }
  .all-sales-modal tr.sales-row td:nth-child(6)::before { content: "Pagamento"; }
  .all-sales-modal tr.sales-row td:nth-child(7)::before { content: "Entrada"; }
  .sales-panel tr.sales-row td:nth-child(7)::before,
  .all-sales-modal tr.sales-row td:nth-child(8)::before { content: "Ações"; }

  .sales-panel .desktop-participant-content { display: none; }

  .sales-panel .mobile-card-overview {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "participant participant value"
      "contact payment entry";
    align-items: end;
    gap: 8px 7px;
  }

  .mobile-overview-participant { grid-area: participant; min-width: 0; }
  .mobile-overview-value { grid-area: value; }
  .mobile-overview-contact { grid-area: contact; }
  .mobile-overview-payment { grid-area: payment; }
  .mobile-overview-entry { grid-area: entry; }

  .mobile-overview-participant,
  .mobile-overview-value,
  .mobile-overview-payment,
  .mobile-overview-entry {
    display: grid;
    gap: 3px;
    align-content: end;
  }

  .mobile-overview-participant strong,
  .mobile-overview-participant small,
  .mobile-overview-value strong { display: block; }

  .mobile-overview-participant > small:last-child {
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
  }

  .mobile-overview-value strong {
    font-size: 14px !important;
    white-space: nowrap;
  }

  .mobile-overview-contact {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
  }

  .mobile-overview-contact > span:first-child {
    overflow: hidden;
    padding: 3px 4px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #ffffffb8;
    color: #14213d;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 3px #14213d0a;
  }

  .sales-panel .mobile-overview-contact .whatsapp-button {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 0;
    overflow: hidden;
  }

  .sales-panel .mobile-overview-contact .whatsapp-icon-asset {
    width: 52px;
    max-width: none;
    height: 52px;
    flex: 0 0 52px;
  }

  .sales-panel .mobile-overview-contact .whatsapp-button-label { display: none; }

  .mobile-overview-payment .payment,
  .mobile-overview-entry .status {
    width: fit-content;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .role-door .mobile-financial { display: none !important; }

  .sales-panel tr.sales-row td.mobile-detail-original { display: none; }

  .sales-panel tr.sales-row td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 8px 0 10px;
    border-bottom: 1px solid #cbd5e1;
  }

  .sales-panel tr.sales-row td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 8px 0 9px;
  }

  .all-sales-modal tr.sales-row td:nth-child(3),
  .all-sales-modal tr.sales-row td:nth-child(4) { grid-column: 1 / -1; }

  .sales-panel tr.sales-row td:last-child,
  .all-sales-modal tr.sales-row td:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px solid #edf0f5;
  }

  .sales-panel tr.sales-row td:last-child { grid-row: 4; }
  .sales-panel tr.sales-row td:last-child { border-top-color: #cbd5e1; }

  .sales-panel tr.sales-row td:last-child::before,
  .all-sales-modal tr.sales-row td:last-child::before { grid-column: 1 / -1; }

  .sales-panel .payment,
  .sales-panel .status,
  .all-sales-modal .payment,
  .all-sales-modal .status {
    min-height: 30px;
    padding: 6px 9px;
  }

  .sales-panel .delete-button,
  .all-sales-modal .delete-button,
  .sales-panel .edit-button,
  .all-sales-modal .edit-button {
    width: 100%;
    min-height: 36px;
  }

  .sales-panel .edit-button,
  .all-sales-modal .edit-button {
    margin-right: 0;
    border: 0;
    border-radius: 7px;
    background: #d6e8ff;
    color: #2563eb;
    font: 600 11px "DM Sans";
    cursor: pointer;
  }

  .all-sales-modal {
    width: calc(100% - 18px);
    max-height: 92vh;
    overflow-y: auto;
  }

  .all-sales-modal tbody .empty,
  .sales-panel tbody .empty {
    display: block;
    padding: 28px 14px;
  }

  .all-sales-modal .phone-line { margin-top: 2px; gap: 7px; }

  .sales-panel tr.sales-row td > small,
  .all-sales-modal tr.sales-row td > small { margin-top: 1px; }
}

@media (max-width: 360px) {
  .sales-panel tr.sales-row { padding: 11px 10px; }
  .sales-panel .mobile-card-overview { column-gap: 3px; }
  .mobile-overview-contact { gap: 4px; }

  .mobile-overview-contact > span:first-child {
    padding: 2px 3px;
    font-size: 8px;
  }

  .sales-panel .mobile-overview-contact .whatsapp-button {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .sales-panel .mobile-overview-contact .whatsapp-icon-asset {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .mobile-overview-payment .payment,
  .mobile-overview-entry .status {
    padding: 4px 5px;
    font-size: 8px;
  }
}

@media (max-width: 700px) {
  .sales-panel tr.sales-row { cursor: pointer; }

  .participant-detail-toggle {
    grid-area: toggle;
    justify-self: end;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    font: 700 9px "DM Sans";
    cursor: pointer;
  }

  .participant-detail-toggle::after { content: " ↓"; }
  .sales-panel tr.sales-row.is-expanded .participant-detail-toggle::after { content: " ↑"; }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-card-overview {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "participant participant value"
      "contact payment toggle";
    align-items: center;
    gap: 5px 7px;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-participant > small:last-child,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-entry,
  .sales-panel tr.sales-row:not(.is-expanded) td:nth-child(2),
  .sales-panel tr.sales-row:not(.is-expanded) td:nth-child(3),
  .sales-panel tr.sales-row:not(.is-expanded) td:last-child {
    display: none;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-participant,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-value,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-payment,
  .sales-panel tr.sales-row:not(.is-expanded) .payment-display {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: row;
    gap: 4px;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-participant strong,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-value strong,
  .sales-panel tr.sales-row:not(.is-expanded) .payment-details {
    overflow: hidden;
    max-width: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-value {
    justify-self: end;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-contact {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-contact > span:first-child {
    display: none;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-participant > .mobile-field-label,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-value > .mobile-field-label,
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-payment > .mobile-field-label {
    display: none;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-contact .whatsapp-button {
    width: 26px;
    min-width: 26px;
    min-height: 26px;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-contact .whatsapp-icon-asset {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-payment .payment {
    min-height: 24px;
    padding: 4px 6px;
  }

  .sales-panel tr.sales-row:not(.is-expanded) .participant-detail-toggle {
    align-self: center;
    white-space: nowrap;
  }

  .sales-panel tr.sales-row:not(.is-expanded) td:first-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .sales-panel tr.sales-row.is-expanded .mobile-card-overview {
    grid-template-areas:
      "participant participant value"
      "contact payment entry"
      "toggle toggle toggle";
  }
}

@media (max-width: 390px) {
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-card-overview { gap: 4px; }
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-field-label { font-size: 7px; letter-spacing: .35px; }
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-participant strong { font-size: 13px; }
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-value strong { font-size: 12px !important; }
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-contact .whatsapp-button { width: 26px; min-width: 26px; min-height: 26px; }
  .sales-panel tr.sales-row:not(.is-expanded) .mobile-overview-payment .payment,
  .sales-panel tr.sales-row:not(.is-expanded) .participant-detail-toggle { font-size: 8px; }
  .sales-panel tr.sales-row:not(.is-expanded) .payment-details { font-size: 7px !important; }
}
