:root {
  color-scheme: light;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #64717f;
  --border: #dce3ea;
  --header: #eef3f7;
  --green: #0f8f5f;
  --green-bg: #e8f7ef;
  --red: #c83b3b;
  --red-bg: #fdecec;
  --accent: #2563eb;
  --shadow: 0 16px 38px rgba(20, 31, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.7rem;
}

.source-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.filters,
.summary,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

.btn {
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
  border-left: 1px solid var(--border);
}

.metric:last-child {
  border-left: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.metric strong {
  direction: ltr;
  display: block;
  font-size: 1.25rem;
}

.metric.deposit strong {
  color: var(--green);
}

.metric.withdrawal strong {
  color: var(--red);
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--header);
  color: var(--muted);
  font-size: 0.85rem;
  z-index: 1;
}

td.amount,
td.balance,
.tracking {
  direction: ltr;
  text-align: left;
  white-space: nowrap;
}

.type-pill {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 8px;
  padding: 5px 10px;
  font-weight: 800;
}

.type-pill.deposit {
  color: var(--green);
  background: var(--green-bg);
}

.type-pill.withdrawal {
  color: var(--red);
  background: var(--red-bg);
}

tr.deposit-row {
  background: linear-gradient(90deg, transparent, rgba(15, 143, 95, 0.045));
}

tr.withdrawal-row {
  background: linear-gradient(90deg, transparent, rgba(200, 59, 59, 0.045));
}

.description {
  max-width: 520px;
  white-space: pre-line;
  line-height: 1.7;
}

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

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

@media (max-width: 980px) {
  .filters,
  .summary {
    grid-template-columns: 1fr 1fr;
  }

  .header,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1500px);
    padding-top: 16px;
  }

  .filters,
  .summary {
    grid-template-columns: 1fr;
  }

  .metric {
    border-left: 0;
    border-bottom: 1px solid var(--border);
  }
}
