/* =========================
   CloudDock Transaction History
   Clean Rewrite
   ========================= */


:root {
  --bg-page: #f6f7f9;
  --bg-card: #ffffff;
  --bg-soft: #fafafa;
  --bg-soft-2: #f3f4f6;


  --text-main: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;


  --line: #e5e7eb;
  --line-soft: #f0f1f3;


  --shadow-sm: 0 8px 24px rgba(17, 24, 39, 0.05);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;


  --green: #0a7a3d;
  --red: #c62828;
  --black: #111111;
}


* {
  box-sizing: border-box;
}


html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}


body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
}


/* ---------- Page Layout ---------- */
.container {
  flex: 1 0 auto;
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 72px;
}


h1 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-main);
}


/* ---------- Table ---------- */
.tx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}


.tx-table thead th {
  background: var(--bg-soft);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}


.tx-table tbody td {
  padding: 15px 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-body);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}


.tx-table tbody tr:last-child td {
  border-bottom: none;
}


.tx-table tbody tr:hover td {
  background: #fcfcfd;
}


/* ---------- Detail Cell ---------- */
.tx-main {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}


.tx-sub {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  word-break: break-word;
}


/* ---------- Money ---------- */
.tx-money {
  font-weight: 700;
  white-space: nowrap;
}


.tx-money.pos {
  color: var(--green);
}


.tx-money.neg {
  color: var(--red);
}


/* ---------- Action ---------- */
.receipt-btn {
  appearance: none;
  border: 1px solid #d8dbe1;
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}


.receipt-btn:hover {
  background: var(--bg-soft);
  border-color: #cfd4dc;
}


.receipt-btn:active {
  transform: translateY(1px);
}


.receipt-btn:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}


.muted {
  color: var(--text-faint);
}


/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}


.pagination button {
  appearance: none;
  border: none;
  background: var(--black);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}


.pagination button:hover:not(:disabled) {
  opacity: 0.92;
}


.pagination button:active:not(:disabled) {
  transform: translateY(1px);
}


.pagination button:disabled {
  background: #cfd4dc;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
}


#pageNumber {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  min-width: 72px;
  text-align: center;
}


/* ---------- Empty / Error Row ---------- */
.tx-table tbody td[colspan] {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px;
}


/* ---------- Desktop Column Behavior ---------- */
.tx-table th:nth-child(1),
.tx-table td:nth-child(1) {
  white-space: nowrap;
}


.tx-table th:nth-child(4),
.tx-table td:nth-child(4),
.tx-table th:nth-child(5),
.tx-table td:nth-child(5),
.tx-table th:nth-child(6),
.tx-table td:nth-child(6) {
  white-space: nowrap;
}


/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .container {
    margin-top: 28px;
  }


  h1 {
    font-size: 26px;
    margin-bottom: 18px;
  }


  .tx-table thead th,
  .tx-table tbody td {
    padding: 13px 12px;
  }
}


/* ---------- Mobile Card Mode ---------- */
@media (max-width: 700px) {
  .container {
    padding: 0 12px;
    margin: 22px auto 56px;
  }


  h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }


  .tx-table,
  .tx-table thead,
  .tx-table tbody,
  .tx-table tr,
  .tx-table th,
  .tx-table td {
    display: block;
    width: 100%;
  }


  .tx-table {
    border: none;
    background: transparent;
    box-shadow: none;
  }


  .tx-table thead {
    display: none;
  }


  .tx-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    overflow: hidden;
  }


  .tx-table tbody tr:last-child {
    margin-bottom: 0;
  }


  .tx-table tbody td {
    position: relative;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 14px 12px 112px;
    min-height: 44px;
    white-space: normal !important;
  }


  .tx-table tbody td:last-child {
    border-bottom: none;
  }


  .tx-table tbody td::before {
    position: absolute;
    left: 14px;
    top: 12px;
    width: 84px;
    content: "";
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: none;
  }


  .tx-table tbody td:nth-child(1)::before { content: "Date"; }
  .tx-table tbody td:nth-child(2)::before { content: "Type"; }
  .tx-table tbody td:nth-child(3)::before { content: "Details"; }
  .tx-table tbody td:nth-child(4)::before { content: "Amount"; }
  .tx-table tbody td:nth-child(5)::before { content: "Balance"; }
  .tx-table tbody td:nth-child(6)::before { content: "Action"; }


  .tx-main {
    margin-bottom: 3px;
  }


  .tx-sub {
    font-size: 12px;
  }


  .receipt-btn {
    width: 100%;
    justify-content: center;
  }


  .pagination {
    gap: 10px;
    margin-top: 16px;
  }


  .pagination button {
    min-width: 92px;
  }
}


/* ---------- Small Phones ---------- */
@media (max-width: 420px) {
  .tx-table tbody td {
    padding-left: 102px;
  }


  .tx-table tbody td::before {
    width: 74px;
  }


  h1 {
    font-size: 22px;
  }
}

