body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 700px;
  margin: auto;
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #6a0dad;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transaction-row {
  display: grid;
  grid-template-columns: 180px 140px 120px 1fr;
  padding: 10px 15px;
  border-radius: 8px;
  background: #f3e8ff;
  align-items: center;
  font-size: 14px;
}

.transaction-row.credit {
  border-left: 4px solid #28a745;
}

.transaction-row.debit {
  border-left: 4px solid #dc3545;
}

.transaction-row span {
  overflow-wrap: anywhere;
}

/* 🔥 Responsive Back Button */
.back-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  background: #6c2bd9;
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  width: auto !important;
  display: inline-block;
}

.back-btn:hover {
  background: #5822b1;
}

/* ------------------------------------------------------- */
/* 🔥 RESPONSIVE MEDIA QUERIES */
/* ------------------------------------------------------- */

/* 📱 Tablets (≤ 768px) */
@media (max-width: 768px) {
  .transaction-row {
    grid-template-columns: 140px 110px 90px 1fr;
    font-size: 13px;
    padding: 10px;
  }
}

/* 📱 Small phones (≤ 550px) */
@media (max-width: 550px) {
  .transaction-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .transaction-row span:nth-child(1) {
    font-weight: bold;
  }
}

/* 📱 Extra small phones (≤ 400px) */
@media (max-width: 400px) {
  .container {
    padding: 15px;
  }

  .transaction-row {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* 🌀 If the row becomes too wide, allow horizontal scrolling */
.transaction-row {
  overflow-x: auto;
  scrollbar-width: thin;
}
