/* =========================================================
   EXACTSUB — TRANSACTIONS PAGE
   Responsive transaction history
   Brand: #022A7B / #29BA22
   ========================================================= */

:root {
    --tx-primary: #022A7B;
    --tx-primary-dark: #011E59;
    --tx-primary-soft: #EEF3FF;
    --tx-accent: #29BA22;
    --tx-text: #172033;
    --tx-muted: #667085;
    --tx-subtle: #98A2B3;
    --tx-border: #E6EAF0;
    --tx-surface: #FFFFFF;
    --tx-bg: #F6F8FC;
    --tx-success-bg: #EAF8EE;
    --tx-success: #16803C;
    --tx-pending-bg: #FFF6DF;
    --tx-pending: #9A6700;
    --tx-danger-bg: #FFF0F0;
    --tx-danger: #C92A2A;
    --tx-radius: 18px;
    --tx-shadow: 0 10px 32px rgba(2, 42, 123, .07);
}

.transactions-page,
.transactions-page * {
    box-sizing: border-box;
}

.transactions-page {
    width: 100%;
    max-width: 1400px;
    min-width: 0;
    margin: 0 auto;
    padding: 32px 24px 50px;
    overflow-x: clip;
}

/* Header */
.transactions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    margin-bottom: 26px;
}

.transactions-header > div:first-child {
    min-width: 0;
}

.transactions-eyebrow {
    margin: 0 0 7px;
    color: var(--tx-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.transactions-header h1 {
    margin: 0;
    color: var(--tx-text);
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.025em;
}

.transactions-subtitle {
    margin: 8px 0 0;
    color: var(--tx-muted);
    font-size: 14px;
    line-height: 1.55;
}

.transactions-header-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border: 1px solid #DDE6FA;
    border-radius: 15px;
    background: linear-gradient(145deg, #F4F7FF, #E8EFFF);
    color: var(--tx-primary);
    font-size: 19px;
}

/* Summary */
.transactions-summary {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    margin-bottom: 16px;
    padding: 15px 18px;
    border: 1px solid var(--tx-border);
    border-radius: 15px;
    background: var(--tx-surface);
    box-shadow: 0 4px 16px rgba(17, 32, 58, .04);
}

.summary-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--tx-primary-soft);
    color: var(--tx-primary);
    font-size: 15px;
}

.summary-label {
    display: block;
    margin-bottom: 3px;
    color: var(--tx-subtle);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.transactions-summary strong {
    display: block;
    color: #263043;
    font-size: 13px;
    font-weight: 700;
}

/* Desktop table */
.transactions-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tx-border);
    border-radius: var(--tx-radius);
    background: var(--tx-surface);
    box-shadow: var(--tx-shadow);
}

.transactions-table-wrapper {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.transactions-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}

.transactions-table thead {
    background: #F8FAFD;
}

.transactions-table th {
    padding: 14px 12px;
    border-bottom: 1px solid var(--tx-border);
    color: #697386;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .35px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.transactions-table td {
    min-width: 0;
    padding: 15px 12px;
    border-bottom: 1px solid #EDF0F4;
    color: #344054;
    font-size: 12px;
    vertical-align: middle;
}

.transactions-table tbody tr {
    transition: background-color .18s ease;
}

.transactions-table tbody tr:hover {
    background: #FAFBFE;
}

.transactions-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Controlled desktop column widths */
.transactions-table th:nth-child(1),
.transactions-table td:nth-child(1) { width: 5%; }

.transactions-table th:nth-child(2),
.transactions-table td:nth-child(2) { width: 29%; }

.transactions-table th:nth-child(3),
.transactions-table td:nth-child(3) { width: 15%; }

.transactions-table th:nth-child(4),
.transactions-table td:nth-child(4) { width: 11%; }

.transactions-table th:nth-child(5),
.transactions-table td:nth-child(5) { width: 13%; }

.transactions-table th:nth-child(6),
.transactions-table td:nth-child(6) { width: 17%; }

.transactions-table th:nth-child(7),
.transactions-table td:nth-child(7) { width: 10%; }

/* Transaction identity */
.transaction-number {
    color: #8B95A5 !important;
    font-size: 11px !important;
    font-weight: 700;
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.transaction-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--tx-primary-soft);
    color: var(--tx-primary);
    font-size: 13px;
}

.transaction-details {
    flex: 1 1 auto;
    min-width: 0;
}

.transaction-details strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #1D2939;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-details span {
    display: block;
    max-width: 100%;
    margin-top: 3px;
    overflow: hidden;
    color: #8A93A3;
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-number-text,
.transaction-amount,
.transaction-date strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.transaction-number-text {
    color: #475467;
    font-size: 11px;
    font-weight: 600;
}

.transaction-amount {
    color: var(--tx-text);
    font-size: 12px;
    font-weight: 800;
}

.transaction-date strong {
    color: var(--tx-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

/* Status */
.transaction-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
}

.status-successful { background: var(--tx-success-bg); color: var(--tx-success); }
.status-successful .status-dot { background: var(--tx-accent); }
.status-pending { background: var(--tx-pending-bg); color: var(--tx-pending); }
.status-pending .status-dot { background: #E7A400; }
.status-unsuccessful { background: var(--tx-danger-bg); color: var(--tx-danger); }
.status-unsuccessful .status-dot { background: #E03131; }
.status-unknown { background: #F1F3F5; color: var(--tx-muted); }
.status-unknown .status-dot { background: var(--tx-subtle); }

/* View receipt */
.column-action {
    text-align: right !important;
}

.view-transaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid #D9E1F2;
    border-radius: 9px;
    background: #F7F9FF;
    color: var(--tx-primary);
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease,
                color .18s ease, transform .18s ease;
}

.view-transaction:hover {
    border-color: var(--tx-primary);
    background: var(--tx-primary);
    color: #FFF;
    text-decoration: none;
    transform: translateY(-1px);
}

.view-transaction i {
    font-size: 9px;
}

/* Pagination */
.transactions-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: 100%;
    margin-top: 24px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}

.pagination-button,
.pagination-page {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E0E5ED;
    border-radius: 9px;
    background: #FFF;
    color: #596579;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.pagination-button:hover,
.pagination-page:hover {
    border-color: #C9D4EA;
    background: #F4F7FF;
    color: var(--tx-primary);
    text-decoration: none;
}

.pagination-current,
.pagination-current:hover {
    border-color: var(--tx-primary);
    background: var(--tx-primary);
    color: #FFF;
}

.pagination-disabled,
.pagination-disabled:hover {
    border-color: #E0E5ED;
    background: #F7F8FA;
    color: #C3C9D2;
    cursor: not-allowed;
}

.pagination-dots {
    width: 24px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tx-subtle);
    font-size: 12px;
    font-weight: 700;
}

/* Empty state */
.transactions-empty {
    width: 100%;
    padding: 70px 24px;
    border: 1px solid var(--tx-border);
    border-radius: var(--tx-radius);
    background: #FFF;
    text-align: center;
    box-shadow: var(--tx-shadow);
}

.empty-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--tx-primary-soft);
    color: var(--tx-primary);
    font-size: 23px;
}

.transactions-empty h2 {
    margin: 0;
    color: #263043;
    font-size: 18px;
    font-weight: 800;
}

.transactions-empty p {
    max-width: 420px;
    margin: 8px auto 0;
    color: #7B8494;
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================================
   TABLET + MOBILE
   The table becomes a stacked card list. No horizontal scroll.
   ========================================================= */
@media (max-width: 900px) {
    .transactions-page {
        padding: 26px 18px 40px;
    }

    .transactions-card {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .transactions-table-wrapper {
        overflow: visible;
    }

    .transactions-table,
    .transactions-table tbody,
    .transactions-table tr,
    .transactions-table td {
        display: block;
        width: 100%;
    }

    .transactions-table {
        table-layout: auto;
    }

    .transactions-table thead {
        display: none;
    }

    .transactions-table tbody {
        display: grid;
        gap: 14px;
    }

    .transactions-table tbody tr {
        position: relative;
        overflow: hidden;
        border: 1px solid var(--tx-border);
        border-radius: 16px;
        background: #FFF;
        box-shadow: 0 7px 22px rgba(2, 42, 123, .055);
    }

    .transactions-table tbody tr:hover {
        background: #FFF;
    }

    .transactions-table td,
    .transactions-table td:nth-child(n) {
        width: 100%;
        min-width: 0;
        padding: 11px 15px;
        border-bottom: 1px solid #EEF1F5;
        text-align: right !important;
    }

    .transactions-table td::before {
        content: attr(data-label);
        float: left;
        max-width: 40%;
        margin-right: 16px;
        color: #8A93A3;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .35px;
        text-align: left;
        text-transform: uppercase;
    }

    .transactions-table td:last-child {
        border-bottom: 0;
    }

    /* Hide row number on compact layouts; it adds no useful mobile context. */
    .transactions-table td:first-child {
        display: none;
    }

    /* Make transaction identity the card header. */
    .transactions-table td:nth-child(2) {
        padding: 15px;
        background: linear-gradient(180deg, #FBFCFF, #FFF);
        text-align: left !important;
    }

    .transactions-table td:nth-child(2)::before {
        display: none;
    }

    .transaction-info {
        gap: 11px;
    }

    .transaction-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .transaction-details strong {
        font-size: 13px;
    }

    .transaction-details span {
        font-size: 11px;
    }

    .transaction-number-text,
    .transaction-amount,
    .transaction-date strong {
        display: inline;
        text-align: right;
    }

    .transaction-status {
        vertical-align: middle;
    }

    .view-transaction {
        min-width: 92px;
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .transactions-page {
        padding: 20px 12px 34px;
    }

    .transactions-header {
        gap: 14px;
        margin-bottom: 20px;
    }

    .transactions-eyebrow {
        font-size: 9px;
        letter-spacing: 1.1px;
    }

    .transactions-subtitle {
        max-width: 290px;
        margin-top: 6px;
        font-size: 12px;
    }

    .transactions-header-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
        font-size: 16px;
    }

    .transactions-summary {
        padding: 13px 14px;
    }

    .transactions-table tbody {
        gap: 12px;
    }

    .transactions-table tbody tr {
        border-radius: 14px;
    }

    .transactions-table td,
    .transactions-table td:nth-child(n) {
        padding: 10px 13px;
    }

    .transactions-table td:nth-child(2) {
        padding: 14px 13px;
    }

    .transactions-table td::before {
        max-width: 42%;
        margin-right: 10px;
        font-size: 9px;
    }

    .transactions-pagination {
        gap: 5px;
        margin-top: 20px;
    }

    .pagination-pages {
        gap: 3px;
    }

    .pagination-button,
    .pagination-page {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 8px;
        font-size: 11px;
    }

    .pagination-dots {
        width: 18px;
        height: 32px;
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .transactions-page {
        padding-left: 9px;
        padding-right: 9px;
    }

    .transactions-header-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .transactions-summary {
        padding: 12px;
    }

    .summary-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .transactions-table td,
    .transactions-table td:nth-child(n) {
        padding-left: 11px;
        padding-right: 11px;
    }

    .pagination-button,
    .pagination-page {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .pagination-dots {
        width: 14px;
    }
}
