/* ============================================
   TRANSACTIONS PAGE STYLES
   ============================================ */

/* ---- Toolbar ---- */
.tx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tx-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.tx-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #6b7280);
    font-size: 0.85rem;
    pointer-events: none;
}

.tx-search {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.tx-search:focus {
    border-color: var(--accent-primary, #2563eb);
    background: var(--bg-primary, #fff);
}

.tx-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tx-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.tx-filter-select:focus {
    border-color: var(--accent-primary, #2563eb);
}

/* ---- Summary strip ---- */
.tx-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.tx-summary-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 14px 16px;
}

.tx-summary-card .label {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.tx-summary-card .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.tx-summary-card .value.sent   { color: var(--error,   #dc2626); }
.tx-summary-card .value.received { color: var(--success, #16a34a); }

/* ---- Table ---- */
.tx-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tx-table thead th {
    background: var(--bg-secondary, #f9fafb);
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #6b7280);
    border-bottom: 1px solid var(--border, #e5e7eb);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.tx-table thead th:hover { color: var(--text-primary, #111827); }

.tx-table thead th .sort-icon {
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.tx-table thead th.sorted .sort-icon { opacity: 1; color: var(--accent-primary, #2563eb); }

.tx-table tbody tr {
    border-bottom: 1px solid var(--border, #e5e7eb);
    transition: background 0.1s;
}

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

.tx-table tbody tr:hover { background: var(--bg-secondary, #f9fafb); }

.tx-table td {
    padding: 13px 16px;
    vertical-align: middle;
    color: var(--text-primary, #111827);
}

/* icon + label cell */
.tx-type-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tx-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.tx-type-icon.send     { background: #fee2e2; color: #dc2626; }
.tx-type-icon.receive  { background: #dcfce7; color: #16a34a; }
.tx-type-icon.transfer { background: #dbeafe; color: #2563eb; }
.tx-type-icon.other    { background: #f3f4f6; color: #6b7280; }

.tx-desc { font-weight: 500; }
.tx-ref  { font-size: 0.75rem; color: var(--text-secondary, #6b7280); margin-top: 2px; font-family: monospace; }

/* amount */
.tx-amount { font-weight: 700; white-space: nowrap; }
.tx-amount.debit  { color: var(--error,   #dc2626); }
.tx-amount.credit { color: var(--success, #16a34a); }

/* status badges */
.tx-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.tx-status.completed  { background: #dcfce7; color: #15803d; }
.tx-status.pending    { background: #fef9c3; color: #a16207; }
.tx-status.processing { background: #dbeafe; color: #1d4ed8; }
.tx-status.failed     { background: #fee2e2; color: #b91c1c; }
.tx-status.rejected   { background: #fce7f3; color: #9d174d; }
.tx-status.cancelled  { background: #f3f4f6; color: #6b7280; }

/* ---- Empty / Loading states ---- */
.tx-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #6b7280);
}

.tx-empty i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; display: block; }
.tx-empty p { margin: 0; font-size: 0.95rem; }

.tx-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary, #6b7280);
}

/* ---- Pagination ---- */
.tx-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    flex-wrap: wrap;
    gap: 10px;
}

.tx-page-btns {
    display: flex;
    gap: 6px;
}

.tx-page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 7px;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tx-page-btn:hover:not(:disabled) {
    background: var(--accent-primary, #2563eb);
    border-color: var(--accent-primary, #2563eb);
    color: #fff;
}

.tx-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.tx-page-btn.active {
    background: var(--accent-primary, #2563eb);
    border-color: var(--accent-primary, #2563eb);
    color: #fff;
}

/* ---- Detail drawer ---- */
.tx-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.tx-drawer-overlay.active {
    display: flex;
}

.tx-drawer {
    background: var(--bg-primary, #fff);
    border-radius: 16px 16px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    animation: drawerUp 0.25s ease;
}

@keyframes drawerUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.tx-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tx-drawer-header h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.tx-drawer-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary, #6b7280);
    padding: 4px;
}

.tx-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 0.875rem;
    gap: 16px;
}

.tx-detail-row:last-child { border-bottom: none; }

.tx-detail-row .dl { color: var(--text-secondary, #6b7280); flex-shrink: 0; }
.tx-detail-row .dv { font-weight: 500; text-align: right; word-break: break-all; }
.tx-detail-row .dv.mono { font-family: monospace; font-size: 0.8rem; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .tx-table thead th:nth-child(4),
    .tx-table tbody td:nth-child(4) { display: none; } /* hide counterparty on small screens */

    .tx-toolbar { flex-direction: column; align-items: stretch; }
    .tx-filters  { flex-wrap: wrap; }

    .tx-drawer { border-radius: 16px 16px 0 0; }
}