/* ==========================================================================
   ISLAMI COMICS - TRANSACTIONS ROOM STYLESHEET
   Matching Mockup Image 5 Pixel-Perfect Design
   ========================================================================== */

.transactions-page-body {
  background-color: #f5f8f6;
}

.transactions-main-stage {
  padding-bottom: 40px;
}

/* Header Right Action Buttons */
.transactions-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-txn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.btn-txn-action:hover {
  border-color: var(--emerald);
  color: var(--emerald-dark);
  background: #f8faf9;
}

/* ==========================================================================
   1. TOP 5 METRIC SUMMARY CARDS (5-GRID)
   ========================================================================== */
.txn-metrics-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.val-negative {
  color: #dc2626 !important;
}

.val-net-green {
  color: var(--emerald-dark) !important;
}

/* ==========================================================================
   2. 2-COLUMN LAYOUT: TRANSACTIONS TABLE & DETAIL CARD
   ========================================================================== */
.txn-layout-2col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.txn-table-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  min-width: 0;
}

/* Toolbar Right: Date Range & Search */
.txn-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-date-range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-date-range-picker:hover {
  border-color: var(--emerald);
}

.caret-mini {
  font-size: 9px;
  color: var(--text-muted);
}

/* ==========================================================================
   3. TRANSACTIONS DATA TABLE
   ========================================================================== */
.txn-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 1080px;
}

.txn-data-table thead tr {
  background: #fbfdfc;
  border-bottom: 1px solid var(--card-border);
}

.txn-data-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
}

.txn-data-table th.th-comic {
  min-width: 230px;
}

.txn-data-table tbody tr.txn-row {
  border-bottom: 1px solid #f1f5f3;
  cursor: pointer;
  transition: background 0.15s ease;
}

.txn-data-table tbody tr.txn-row:hover {
  background: #f9fbf9;
}

.txn-data-table tbody tr.txn-row.active-selected-row {
  background: #f0fdf4;
  border-left: 3px solid var(--emerald);
}

.txn-data-table td {
  padding: 12px 14px;
  vertical-align: middle;
  font-size: 12px;
}

/* Transaction ID Column */
.td-txn-id {
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
}

/* Date & Time Column */
.td-datetime {
  white-space: nowrap;
}

/* Type Badges */
.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-type-sale {
  background: #f0fdf4;
  color: #059669;
}

.badge-type-refund {
  background: #fef2f2;
  color: #dc2626;
}

.badge-type-fee {
  background: #faf5ff;
  color: #7c3aed;
}

.badge-type-payout {
  background: #eff6ff;
  color: #2563eb;
}

/* Order ID Link */
.link-order-id {
  font-weight: 800;
  color: var(--emerald-dark);
  text-decoration: underline;
  white-space: nowrap;
}

.link-order-id:hover {
  color: var(--emerald);
}

/* Comic Cell */
.comic-cell-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.txn-comic-thumb {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.service-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.txn-comic-text {
  min-width: 0;
}

.txn-comic-title {
  font-weight: 800;
  color: var(--text-main);
  font-size: 12px;
  white-space: nowrap;
}

.txn-comic-author {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Financial Amounts */
.td-gross,
.td-fee,
.td-net {
  white-space: nowrap;
  font-weight: 800;
  color: var(--text-main);
}

.fee-negative {
  color: #ef4444;
}

.net-positive {
  color: var(--emerald-dark);
}

/* Status Badges */
.badge-txn-status {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-txn-status.status-completed {
  background: #f0fdf4;
  color: #10b981;
}

.badge-txn-status.status-refunded {
  background: #fef2f2;
  color: #dc2626;
}

.badge-txn-status.status-paidout {
  background: #eff6ff;
  color: #2563eb;
}

.btn-txn-dots {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  font-weight: 800;
}

/* ==========================================================================
   4. RIGHT COLUMN: TRANSACTION DETAIL CARD
   ========================================================================== */
.txn-detail-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.txn-detail-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.detail-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.detail-title-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #64748b;
  text-transform: uppercase;
}

.detail-order-id-row {
  margin-bottom: 14px;
}

.detail-order-code {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 2px;
}

.detail-type-badge-row {
  margin: 6px 0;
}

.detail-timestamp {
  font-size: 11px;
  color: var(--text-sub);
}

.detail-section-block {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f3;
}

.detail-sub-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.link-order-id-large {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--emerald-dark);
  text-decoration: underline;
}

.detail-buyer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-buyer-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.detail-buyer-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
}

.detail-buyer-email {
  font-size: 11px;
  color: var(--text-sub);
}

.detail-comic-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-comic-thumb {
  width: 36px !important;
  height: 48px !important;
  max-width: 36px !important;
  max-height: 48px !important;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.detail-comic-meta {
  min-width: 0;
}

.detail-comic-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.detail-comic-author {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Financial Breakdown */
.detail-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f3;
  margin-bottom: 14px;
  font-size: 12px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-sub);
}

.breakdown-row strong {
  color: var(--text-main);
  font-weight: 800;
}

.breakdown-row.fee-text strong {
  color: #ef4444;
}

.breakdown-row.net-row {
  font-size: 12.5px;
  padding-top: 4px;
}

.breakdown-row.net-row .net-text {
  color: var(--emerald-dark);
  font-size: 13px;
}

/* Payment Meta */
.detail-payment-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 11.5px;
}

.payment-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-sub);
}

.payment-meta-row strong {
  color: var(--text-main);
  font-weight: 700;
}

.status-indicator-green {
  color: var(--emerald-dark) !important;
}

/* Detail Actions */
.detail-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-detail-view-order {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-detail-view-order:hover {
  background: #f8faf9;
  border-color: #cbd5e1;
}

.btn-detail-refund {
  width: 100%;
  background: #ffffff;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-detail-refund:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* Need Help Card with Mosque Silhouette */
.order-help-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.help-card-content {
  position: relative;
  z-index: 2;
}

.help-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #047857;
  margin-bottom: 4px;
}

.help-card-desc {
  font-size: 11px;
  color: #065f46;
  margin-bottom: 10px;
}

.help-card-link {
  font-size: 11.5px;
  font-weight: 800;
  color: #047857;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.help-card-link:hover {
  text-decoration: underline;
}

.mosque-silhouette-overlay {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 90px;
  height: 60px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60' fill='%2310b981' opacity='0.18'%3e%3cpath d='M50 5 C45 15 42 20 42 30 L58 30 C58 20 55 15 50 5 Z M20 20 C17 25 15 30 15 40 L25 40 C25 30 23 25 20 20 Z M80 20 C77 25 75 30 75 40 L85 40 C85 30 83 25 80 20 Z M5 40 L95 40 L95 60 L5 60 Z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

/* ==========================================================================
   5. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .txn-layout-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  .txn-metrics-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .txn-metrics-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .txn-toolbar-right {
    justify-content: space-between;
  }
}

@media (max-width: 540px) {
  .txn-metrics-grid-5 {
    grid-template-columns: 1fr;
  }
}
