/* =========================================================

   EXACTSUB — QUERY TRANSACTION PAGE

   ========================================================= */



.query-page {

    width: 100%;

    max-width: 1400px;

    margin: 0 auto;

    padding: 32px 24px 50px;

    box-sizing: border-box;

}





/* =========================================================

   PAGE HEADER

   ========================================================= */



.query-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;

}



.query-eyebrow {

    margin: 0 0 7px;

    color: #022A7B;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.4px;

    text-transform: uppercase;

}



.query-header h1 {

    margin: 0;

    color: #172033;

    font-size: 28px;

    line-height: 1.2;

    font-weight: 800;

}



.query-subtitle {

    margin: 8px 0 0;

    color: #70798a;

    font-size: 14px;

    line-height: 1.5;

}



.query-header-icon {

    width: 52px;

    height: 52px;

    flex: 0 0 52px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 14px;

    background: #eef3ff;

    color: #022A7B;

    font-size: 19px;

}





/* =========================================================

   SEARCH CARD

   ========================================================= */



.query-search-card {

    width: 100%;

    margin-bottom: 30px;

    padding: 24px;

    border: 1px solid #e4e8ef;

    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 6px 24px rgba(17, 32, 58, 0.05);

    box-sizing: border-box;

}



.query-search-heading {

    display: flex;

    align-items: flex-start;

    gap: 14px;

    margin-bottom: 24px;

}



.query-search-icon {

    width: 42px;

    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 11px;

    background: #eef3ff;

    color: #022A7B;

    font-size: 15px;

}



.query-section-label {

    display: block;

    margin-bottom: 4px;

    color: #8a93a3;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;

}



.query-search-heading h2 {

    margin: 0;

    color: #263043;

    font-size: 17px;

    font-weight: 800;

}



.query-search-heading p {

    margin: 5px 0 0;

    color: #7b8494;

    font-size: 12px;

    line-height: 1.5;

}





/* =========================================================

   FORM

   ========================================================= */



.query-form {

    width: 100%;

}



.query-form-fields {

    width: 100%;

}





/*

   Crispy Forms / Bootstrap compatibility.

   These rules modernize the existing generated fields

   without changing the Django form itself.

*/



.query-form-fields* *.form-group {

    margin-bottom: 18px;

}



.query-form-fields label {

    display: block;

    margin-bottom: 7px;

    color: #344054;

    font-size: 12px;

    font-weight: 700;

}



.query-form-fields input,

.query-form-fields select,

.query-form-fields textarea {

    width: 100%;

    min-height: 44px;

    padding: 10px 13px;

    border: 1px solid #dfe4ec;

    border-radius: 9px;

    background: #ffffff;

    color: #263043;

    font-size: 13px;

    line-height: 1.4;

    box-sizing: border-box;

    outline: none;

    transition:

        border-color 0.18s ease,

        box-shadow 0.18s ease,

        background-color 0.18s ease;

}



.query-form-fields inpu&#x74;*:focus*,

.query-form-fields selec&#x74;*:focus*,

.query-form-fields* textare&#x61;*:focus {

    border-color: #022A7B;

    background: #ffffff;

    box-shadow: 0 0 0 3px rgba(2, 42, 123, 0.08);

}



.query-form-fields inpu&#x74;*::placeholder*,

.query-form-fields* textare&#x61;*::placeholder {

    color: #a1a9b6;

}



.query-form-fields .help-block,

.query-form-fields .help-text,

.query-form-fields small {

    display: block;

    margin-top: 5px;

    color: #8a93a3;

    font-size: 11px;

    line-height: 1.5;

}





/* =========================================================

   FORM ERRORS

   ========================================================= */



.query-error-box {

    display: flex;

    align-items: flex-start;

    gap: 11px;

    margin-bottom: 20px;

    padding: 13px 15px;

    border: 1px solid #f3caca;

    border-radius: 10px;

    background: #fff5f5;

    color: #b42318;

}



.query-error-icon {

    flex: 0 0 auto;

    margin-top: 1px;

    font-size: 15px;

}



.query-error-box strong {

    display: block;

    margin-bottom: 4px;

    font-size: 12px;

    font-weight: 800;

}



.query-error-box p {

    margin: 2px 0 0;

    font-size: 11px;

    line-height: 1.5;

}





/* =========================================================

   FORM BUTTON

   ========================================================= */



.query-form-actions {

    display: flex;

    justify-content: flex-end;

    margin-top: 8px;

}



.query-search-button {

    min-width: 180px;

    min-height: 44px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 10px 18px;

    border: 1px solid #022A7B;

    border-radius: 9px;

    background: #022A7B;

    color: #ffffff;

    font-size: 12px;

    font-weight: 750;

    cursor: pointer;

    transition:

        background-color 0.18s ease,

        border-color 0.18s ease,

        transform 0.18s ease,

        box-shadow 0.18s ease;

}



.query-search-button:hover {

    border-color: #011f5d;

    background: #011f5d;

    color: #ffffff;

    box-shadow: 0 5px 14px rgba(2, 42, 123, 0.18);

    transform: translateY(-1px);

}



.query-search-button:active {

    transform: translateY(0);

}



.query-search-button i {

    font-size: 11px;

}





/* =========================================================

   RESULTS HEADER

   ========================================================= */



.query-results-section {

    width: 100%;

}



.query-results-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 16px;

}



.query-results-eyebrow {

    margin: 0 0 5px;

    color: #022A7B;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.1px;

    text-transform: uppercase;

}



.query-results-header h2 {

    margin: 0;

    color: #263043;

    font-size: 19px;

    font-weight: 800;

}



.query-results-header p {

    margin: 5px 0 0;

    color: #7b8494;

    font-size: 12px;

}



.query-results-icon {

    width: 44px;

    height: 44px;

    flex: 0 0 44px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background: #f0f4ff;

    color: #022A7B;

    font-size: 16px;

}





/* =========================================================

   RESULTS TABLE

   ========================================================= */



.query-table-card {

    width: 100%;

    overflow: hidden;

    border: 1px solid #e4e8ef;

    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 6px 24px rgba(17, 32, 58, 0.05);

}



.query-table-wrapper {

    width: 100%;

    overflow-x: hidden;

    *-webkit-overflow-scrolling*: touch;

}



.query-table {

    width: 100%;

    min-width: 0;

    border-collapse: collapse;

    border-spacing: 0;

}



.query-table thead {

    background: #f7f9fc;

}



.query-table th {

    padding: 15px 16px;

    border-bottom: 1px solid #e5e9ef;

    color: #697386;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.35px;

    text-align: left;

    text-transform: uppercase;

    white-space: nowrap;

}



.query-table td {

    padding: 15px 16px;

    border-bottom: 1px solid #edf0f4;

    color: #344054;

    font-size: 12px;

    vertical-align: middle;

}



.query-table tbody tr {

    transition: background-color 0.18s ease;

}



.query-table* tbody tr*:hover {

    background: #fafbfe;

}



.query-table tbody tr*:last-child* td {

    border-bottom: none;

}





/* =========================================================

   TABLE CELLS

   ========================================================= */



.query-column-number {

    width: 45px;

}



.query-row-number {

    color: #8b95a5 !important;

    font-size: 11px !important;

    font-weight: 700;

}



.query-network {

    color: #344054;

    font-size: 12px;

    font-weight: 700;

    white-space: nowrap;

}



.query-volume {

    color: #596579;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

}



.query-number {

    color: #475467;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

}



.query-amount {

    color: #172033;

    font-size: 12px;

    font-weight: 800;

    white-space: nowrap;

}



.query-balance {

    color: #596579;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

}



.query-date {

    color: #667085;

    font-size: 11px;

    font-weight: 600;

    white-space: nowrap;

}



.query-description {

    min-width: 180px;

    max-width: 260px;

    color: #475467;

    font-size: 11px;

    line-height: 1.5;

    white-space: normal;

    word-break: break-word;

}



.query-email {

    min-width: 150px;

    max-width: 220px;

    color: #667085;

    font-size: 11px;

    line-height: 1.5;

    white-space: normal;

    word-break: break-word;

}



.query-request-id {

    min-width: 150px;

    max-width: 220px;

    color: #7b8494;

    font-family: monospace;

    font-size: 10px;

    line-height: 1.5;

    white-space: normal;

    word-break: break-all;

}





/* =========================================================

   STATUS

   ========================================================= */



.query-status {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

}



.query-status-dot {

    width: 6px;

    height: 6px;

    flex: 0 0 6px;

    border-radius: 50%;

}



.query-status-successful {

    background: #eaf8ee;

    color: #16803c;

}



.query-status-successful* *.query-status-dot {

    background: #29BA22;

}



.query-status-unsuccessful {

    background: #fff0f0;

    color: #c92a2a;

}



.query-status-unsuccessful* *.query-status-dot {

    background: #e03131;

}



.query-status-pending {

    background: #fff6df;

    color: #9a6700;

}



.query-status-pending* *.query-status-dot {

    background: #e7a400;

}



.query-status-unknown {

    background: #f1f3f5;

    color: #667085;

}



.query-status-unknown* *.query-status-dot {

    background: #98a2b3;

}





/* =========================================================

   PAGINATION

   ========================================================= */



.query-pagination {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    margin-top: 24px;

}



.query-pagination-pages {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 5px;

}



.query-pagination-button,

.query-pagination-page {

    width: 36px;

    height: 36px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #e0e5ed;

    border-radius: 9px;

    background: #ffffff;

    color: #596579;

    font-size: 12px;

    font-weight: 700;

    text-decoration: none;

    box-sizing: border-box;

    transition:

        background-color 0.18s ease,

        border-color 0.18s ease,

        color 0.18s ease;

}



*.query-pagination-button:hover*,

.query-pagination-page:hover {

    border-color: #c9d4ea;

    background: #f4f7ff;

    color: #022A7B;

    text-decoration: none;

}



.query-pagination-current {

    border-color: #022A7B;

    background: #022A7B;

    color: #ffffff;

}



.query-pagination-current:hover {

    border-color: #022A7B;

    background: #022A7B;

    color: #ffffff;

}



.query-pagination-disabled {

    background: #f7f8fa;

    color: #c3c9d2;

    cursor: not-allowed;

}



.query-pagination-disabled:hover {

    border-color: #e0e5ed;

    background: #f7f8fa;

    color: #c3c9d2;

}



.query-pagination-dots {

    width: 28px;

    height: 36px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    color: #98a2b3;

    font-size: 12px;

    font-weight: 700;

}





/* =========================================================

   EMPTY STATE

   ========================================================= */



.query-empty {

    width: 100%;

    padding: 70px 24px;

    border: 1px solid #e4e8ef;

    border-radius: 16px;

    background: #ffffff;

    text-align: center;

    box-shadow: 0 6px 24px rgba(17, 32, 58, 0.04);

    box-sizing: border-box;

}



.query-empty-icon {

    width: 62px;

    height: 62px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: #eef3ff;

    color: #022A7B;

    font-size: 23px;

}



.query-empty h2 {

    margin: 0;

    color: #263043;

    font-size: 18px;

    font-weight: 800;

}



.query-empty p {

    max-width: 440px;

    margin: 8px auto 0;

    color: #7b8494;

    font-size: 13px;

    line-height: 1.6;

}





/* =========================================================

   RESPONSIVE

   ========================================================= */



@media (max-width: 900px) {



    .query-page {

        padding: 26px 18px 40px;

    }



    .query-header h1 {

        font-size: 25px;

    }



    .query-table {

        min-width: 0;

    }



}





@media (max-width: 600px) {



    .query-page {

        padding: 20px 12px 35px;

    }



    .query-header {

        margin-bottom: 20px;

    }



    .query-eyebrow {

        font-size: 10px;

    }



    .query-header h1 {

        font-size: 22px;

    }



    .query-subtitle {

        max-width: 290px;

        font-size: 12px;

    }



    .query-header-icon {

        width: 44px;

        height: 44px;

        flex-basis: 44px;

        border-radius: 12px;

        font-size: 16px;

    }



    .query-search-card {

        padding: 18px;

        border-radius: 13px;

    }



    .query-search-heading {

        gap: 11px;

        margin-bottom: 20px;

    }



    .query-search-icon {

        width: 38px;

        height: 38px;

        flex-basis: 38px;

    }



    .query-search-heading h2 {

        font-size: 15px;

    }



    .query-search-heading p {

        font-size: 11px;

    }



    .query-form-actions {

        justify-content: stretch;

    }



    .query-search-button {

        width: 100%;

    }



    .query-results-header h2 {

        font-size: 17px;

    }



    .query-results-header p {

        font-size: 11px;

    }



    .query-results-icon {

        width: 40px;

        height: 40px;

        flex-basis: 40px;

    }



    .query-table-card {

        border-radius: 13px;

    }



    .query-table {

        min-width: 0;

    }



    .query-table th {

        padding: 13px 14px;

        font-size: 9px;

    }



    .query-table td {

        padding: 14px;

        font-size: 11px;

    }



    .query-pagination {

        gap: 6px;

    }



    .query-pagination-button,

    .query-pagination-page {

        width: 34px;

        height: 34px;

    }



}





@media (max-width: 380px) {



    .query-page {

        padding-left: 9px;

        padding-right: 9px;

    }



    .query-header h1 {

        font-size: 20px;

    }



    .query-header-icon {

        width: 40px;

        height: 40px;

        flex-basis: 40px;

    }



}


/* =========================================================
   EXACTSUB RESPONSIVE OVERRIDE
   No horizontal scrolling on tablet/mobile.
   ========================================================= */

.query-page,
.data-history-page,
.airtime-history-page,
#funding-history-page {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.query-page *,
.data-history-page *,
.airtime-history-page *,
#funding-history-page * {
    min-width: 0;
    max-width: 100%;
}

/* Keep the page itself inside the viewport. */
.query-header,
.data-history-header,
.airtime-history-header,
.funding-page-header {
    min-width: 0;
}

@media (max-width: 900px) {
    .query-table-wrapper,
    .data-history-table-wrapper,
    .airtime-history-table-wrapper {
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .query-table,
    .data-history-table,
    .airtime-history-table {
        width: 100%;
        min-width: 0 !important;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0;
    }

    .query-table thead,
    .data-history-table thead,
    .airtime-history-table thead {
        display: none;
    }

    .query-table tbody,
    .data-history-table tbody,
    .airtime-history-table tbody {
        display: grid;
        gap: 14px;
    }

    .query-table tbody tr,
    .data-history-table tbody tr,
    .airtime-history-table tbody tr {
        display: block;
        width: 100%;
        overflow: hidden;
        border: 1px solid #E4E8EF;
        border-radius: 16px;
        background: #FFFFFF;
        box-shadow: 0 7px 22px rgba(2, 42, 123, .055);
    }

    .query-table tbody tr:hover,
    .data-history-table tbody tr:hover,
    .airtime-history-table tbody tr:hover {
        background: #FFFFFF;
    }

    .query-table td,
    .data-history-table td,
    .airtime-history-table td,
    .query-table td:nth-child(n),
    .data-history-table td:nth-child(n),
    .airtime-history-table td:nth-child(n) {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 10px 14px;
        border-bottom: 1px solid #EEF1F5;
        text-align: right !important;
        overflow-wrap: anywhere;
    }

    .query-table td::before,
    .data-history-table td::before,
    .airtime-history-table td::before {
        content: attr(data-label);
        float: left;
        max-width: 42%;
        margin-right: 12px;
        color: #8A93A3;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .45px;
        line-height: 1.4;
        text-align: left;
        text-transform: uppercase;
    }

    .query-table td:last-child,
    .data-history-table td:last-child,
    .airtime-history-table td:last-child {
        border-bottom: 0;
    }

    /* Serial number is useful on desktop but redundant in mobile cards. */
    .query-table td:first-child,
    .data-history-table td:first-child,
    .airtime-history-table td:first-child {
        display: none;
    }

    /* Receipt/action rows should read as action rows, not raw text. */
    .query-table td[data-label="Action"],
    .data-history-table td[data-label="Receipt"],
    .airtime-history-table td[data-label="Receipt"] {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .query-table td[data-label="Action"]::before,
    .data-history-table td[data-label="Receipt"]::before,
    .airtime-history-table td[data-label="Receipt"]::before {
        line-height: 34px;
    }

    .query-table td a,
    .data-history-table td a,
    .airtime-history-table td a {
        max-width: 100%;
    }

    /* Long values must never enlarge the viewport. */
    .query-table td *,
    .data-history-table td *,
    .airtime-history-table td * {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /* Keep statuses/buttons visually compact. */
    .query-table .query-status,
    .data-history-table .data-status,
    .airtime-history-table .airtime-status {
        display: inline-flex;
        vertical-align: middle;
    }

    /* Query search form: one clean column at tablet width. */
    .query-search-card,
    .query-results-section,
    .query-table-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .query-form-fields {
        width: 100%;
        min-width: 0;
    }

    .query-form-fields input,
    .query-form-fields select,
    .query-form-fields textarea {
        max-width: 100%;
    }

    #funding-history-page .funding-page-header,
    #funding-history-page .funding-summary-card,
    #funding-history-page .funding-transaction-card {
        min-width: 0;
        max-width: 100%;
    }

    #funding-history-page .funding-card-top,
    #funding-history-page .funding-amount-section,
    #funding-history-page .funding-balance-grid,
    #funding-history-page .funding-details-grid {
        min-width: 0;
        max-width: 100%;
    }

    #funding-history-page .funding-method-details,
    #funding-history-page .funding-detail > div:last-child,
    #funding-history-page .funding-summary-left > div:last-child {
        min-width: 0;
        max-width: 100%;
    }

    #funding-history-page .funding-method-details h2,
    #funding-history-page .funding-detail strong {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 600px) {
    .query-page,
    .data-history-page,
    .airtime-history-page,
    #funding-history-page {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .query-header,
    .data-history-header,
    .airtime-history-header,
    .funding-page-header {
        gap: 12px;
        margin-bottom: 20px;
    }

    .query-header > div:first-child,
    .data-history-header > div:first-child,
    .airtime-history-header > div:first-child,
    #funding-history-page .funding-header-content {
        min-width: 0;
    }

    .query-subtitle,
    .data-history-subtitle,
    .airtime-history-subtitle,
    #funding-history-page .funding-header-content p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .query-search-card {
        padding: 16px !important;
        border-radius: 14px;
    }

    .query-search-heading {
        gap: 10px;
        margin-bottom: 18px;
    }

    .query-form-actions {
        width: 100%;
    }

    .query-search-button {
        width: 100%;
        min-width: 0;
    }

    .query-table tbody,
    .data-history-table tbody,
    .airtime-history-table tbody {
        gap: 12px;
    }

    .query-table tbody tr,
    .data-history-table tbody tr,
    .airtime-history-table tbody tr {
        border-radius: 14px;
    }

    .query-table td,
    .data-history-table td,
    .airtime-history-table td,
    .query-table td:nth-child(n),
    .data-history-table td:nth-child(n),
    .airtime-history-table td:nth-child(n) {
        padding: 9px 12px;
    }

    .query-table td::before,
    .data-history-table td::before,
    .airtime-history-table td::before {
        max-width: 40%;
        margin-right: 8px;
        font-size: 8.5px;
    }

    #funding-history-page .funding-summary-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    #funding-history-page .funding-summary-count {
        width: 100%;
        padding: 10px 0 0;
        border-top: 1px solid var(--es-border-light);
        border-left: 0;
    }

    #funding-history-page .funding-card-top {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    #funding-history-page .funding-card-status {
        max-width: 100%;
    }

    #funding-history-page .funding-amount-section {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

    #funding-history-page .funding-receipt-button {
        max-width: 100%;
    }

    #funding-history-page .funding-balance-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #funding-history-page .funding-balance-arrow {
        display: none;
    }

    #funding-history-page .funding-details-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #funding-history-page .funding-detail,
    #funding-history-page .funding-detail:nth-child(n) {
        padding: 12px 0;
        border: 0;
        border-top: 1px solid var(--es-border-light);
    }

    #funding-history-page .funding-detail:first-child {
        border-top: 0;
    }

    #funding-history-page .funding-detail > div:last-child {
        min-width: 0;
    }
}

@media (max-width: 380px) {
    .query-page,
    .data-history-page,
    .airtime-history-page,
    #funding-history-page {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    .query-table td,
    .data-history-table td,
    .airtime-history-table td {
        padding-left: 10px;
        padding-right: 10px;
    }

    #funding-history-page .funding-header-content h1 {
        font-size: 23px;
    }
}


/* Final viewport safety: never allow page descendants to create horizontal scroll. */
.query-page,
.data-history-page,
.airtime-history-page,
#funding-history-page {
    overflow-x: clip;
}

.query-page img,
.data-history-page img,
.airtime-history-page img,
#funding-history-page img,
.query-page svg,
.data-history-page svg,
.airtime-history-page svg,
#funding-history-page svg,
.query-page iframe,
.data-history-page iframe,
.airtime-history-page iframe,
#funding-history-page iframe {
    max-width: 100%;
}
