/* Agent portal mobile overrides — UI only */

/* Bill cards — shared (dashboard all sizes; bill history on mobile) */
.mobile-bill-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 48, 63, 0.1);
    border: 1px solid #e8ecef;
    border-left-width: 4px;
    overflow: hidden;
    margin-bottom: 0;
}

.mobile-bill-card--unpaid {
    border-left-color: #f39c12;
}

.mobile-bill-card--paid {
    border-left-color: #00a65a;
}

.mobile-bill-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid #f0f2f4;
    background: #fafbfc;
}

.mobile-bill-card__status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.mobile-bill-card__status-row .fa.paid-bill,
.mobile-bill-card__status-row .fa.unpaid-bill {
    flex-shrink: 0;
}

.mobile-bill-card__status-row .status-label {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.mobile-bill-card__amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F303F;
}

.mobile-bill-card__amount small {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.75rem;
    margin-right: 0.15rem;
}

.mobile-bill-card__details {
    margin: 0;
    padding: 0.65rem 1rem;
}

.mobile-bill-card__row {
    display: grid;
    grid-template-columns: minmax(90px, 38%) 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: start;
}

.mobile-bill-card__row:last-child {
    border-bottom: none;
}

.mobile-bill-card__row dt {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    line-height: 1.35;
}

.mobile-bill-card__row dd {
    margin: 0;
    font-size: 0.875rem;
    color: #212529;
    word-break: break-word;
    line-height: 1.35;
}

.mobile-bill-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 1rem 1rem;
    border-top: 1px solid #f0f2f4;
    background: #fafbfc;
}

.mobile-bill-card__actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mobile-bill-card__empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 10px;
    border: 1px dashed #dee2e6;
}

.mobile-bill-card__empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

/* Challan print — grid inline action */
a.inline-actions.agent-bill-inline-challan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 6px;
    border-radius: 8px;
    background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
    opacity: 1;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.inline-actions.agent-bill-inline-challan i {
    color: #fff !important;
    font-size: 13px;
}

a.inline-actions.agent-bill-inline-challan:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.45);
    text-shadow: none;
    opacity: 1;
}

/* Challan print — card / mobile */
.agent-bill-challan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%) !important;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.agent-bill-challan-btn:hover,
.agent-bill-challan-btn:focus {
    color: #fff !important;
    background: linear-gradient(145deg, #0f766e 0%, #115e59 100%) !important;
    box-shadow: 0 5px 14px rgba(13, 148, 136, 0.4);
    transform: translateY(-1px);
}

.agent-bill-challan-btn i {
    font-size: 0.95em;
}

/* Dashboard statistics cards — shared */
.dashboard-stats-row {
    margin-bottom: 10px;
    align-items: stretch;
}

.dashboard-stat-wrap {
    display: flex;
    flex-direction: column;
}

.dashboard-stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.dashboard-stat-link:focus-visible {
    outline: 2px solid #0F303F;
    outline-offset: 2px;
    border-radius: 10px;
}

.dashboard-stat-card {
    height: 100%;
    margin-bottom: 0;
    border: none;
    overflow: hidden;
}

.dashboard-stat-card .card-body {
    position: relative;
    height: 100%;
}

.dashboard-stat-card__label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    opacity: 0.95;
}

.dashboard-stat-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.dashboard-stat-card__count {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.dashboard-stat-card__info-label {
    opacity: 0.85;
    font-weight: 500;
    margin-right: 0.25rem;
}

.dashboard-stat-card__icon img {
    width: 56px;
    height: auto;
    max-height: 56px;
    object-fit: contain;
}

.dashboard-stat-card--last-payment .card-body,
.dashboard-stat-card--unpaid .card-body,
.dashboard-stat-card--paid .card-body {
    min-height: 150px;
}

.dashboard-stat-card__inner {
    position: relative;
    z-index: 1;
    padding-right: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-stat-card--paid .card-body,
.dashboard-stat-card--unpaid .card-body.dashboard-stat-card__body--actions {
    display: flex;
    flex-direction: column;
}

.dashboard-stat-card--paid .dashboard-stat-link--main,
.dashboard-stat-card--unpaid .dashboard-stat-link--main {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    min-height: 5.5rem;
}

.dashboard-stat-card--paid .dashboard-stat-card__top,
.dashboard-stat-card--unpaid .dashboard-stat-card__top {
    flex: 1 1 auto;
    align-items: center;
}

.dashboard-stat-card--paid .dashboard-stat-card__icon,
.dashboard-stat-card--unpaid .dashboard-stat-card__icon {
    position: static !important;
    top: auto !important;
    right: auto !important;
    flex-shrink: 0;
}

.dashboard-stat-card__body--actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
}

.dashboard-stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.dashboard-stat-card__footer {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    width: 100%;
}

.dashboard-stat-link--main {
    display: block;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
    min-height: 0;
    min-width: 0;
}

.dashboard-stat-link--main:hover,
.dashboard-stat-link--main:focus {
    color: inherit;
    text-decoration: none;
}

.dashboard-stat-manual-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.16);
    color: #fff !important;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.dashboard-stat-manual-btn__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-stat-manual-btn:hover,
.dashboard-stat-manual-btn:focus {
    color: #fff !important;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.85);
}

.dashboard-stat-manual-btn:active {
    transform: scale(0.98);
}

/* Dashboard bill list — always card view */
.s-ePaymentMPA-PMS-AgentBillDashboardGrid .grid-container {
    display: none;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid .card-container {
    width: 100% !important;
    height: auto !important;
    min-height: 120px;
    max-height: none !important;
    overflow: visible !important;
    background: #f4f4f4;
    padding: 0.75rem 0 1rem;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid .card-container > .row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid .dashboard-bill-card-wrap {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 0;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid .grid-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-bottom: 0.35rem;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid .grid-title .title-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0F303F;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid #qSearch {
    flex: 1 1 220px;
    max-width: 320px;
    float: none !important;
    margin: 0;
}

.s-ePaymentMPA-PMS-AgentBillDashboardGrid #qSearch .s-QuickSearchInput {
    width: 100% !important;
}

.dashboard-bill-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-bill-card:hover {
    box-shadow: 0 6px 16px rgba(15, 48, 63, 0.12);
    transform: translateY(-1px);
}

.dashboard-bill-card__hero {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #f0f2f4;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.dashboard-bill-card__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e8ecef;
    box-shadow: 0 2px 6px rgba(15, 48, 63, 0.06);
}

.dashboard-bill-card__icon--unpaid {
    background: rgba(243, 156, 18, 0.08);
    border-color: rgba(243, 156, 18, 0.25);
}

.dashboard-bill-card__icon--paid {
    background: rgba(0, 166, 90, 0.08);
    border-color: rgba(0, 166, 90, 0.25);
}

.dashboard-bill-card__icon .fa.paid-bill,
.dashboard-bill-card__icon .fa.unpaid-bill {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.dashboard-bill-card__hero-text {
    flex: 1;
    min-width: 0;
}

.dashboard-bill-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.dashboard-bill-card__badges .status-label {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dashboard-bill-card__amount {
    font-size: 1.25rem;
    line-height: 1.2;
}

.dashboard-bill-card__details {
    flex: 1;
}

.dashboard-bill-card__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-bill-card__actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dashboard-bill-card__actions-row .btn {
    flex: 1 1 auto;
    min-height: 40px;
}

.dashboard-bill-card__pay-btn {
    width: 100%;
    min-height: 44px;
    font-weight: 600;
    border: none;
    border-radius: 8px !important;
    background: linear-gradient(91deg, #e67e22 0%, #f39c12 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.28);
}

@media (min-width: 769px) {
    .dashboard-bill-card__actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .dashboard-bill-card__actions-row {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .dashboard-bill-card__actions-row .btn {
        flex: 0 1 auto;
        white-space: nowrap;
    }

    .dashboard-bill-card__pay-btn {
        width: auto;
        flex: 0 0 auto;
        min-width: 7.5rem;
        margin-left: auto;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

.dashboard-bill-card__pay-btn:hover,
.dashboard-bill-card__pay-btn:focus {
    color: #fff !important;
    background: linear-gradient(91deg, #d35400 0%, #e67e22 100%) !important;
    box-shadow: 0 6px 14px rgba(243, 156, 18, 0.35);
}

.dashboard-bill-card__empty {
    margin-top: 0.5rem;
}

/* Horizontal unpaid bill cards — dashboard list */
.dashboard-bill-card--horizontal {
    border-left-width: 4px;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(15, 48, 63, 0.08);
}

.dashboard-bill-card--horizontal .dashboard-bill-card__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 0.75rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__lead {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 1 auto;
    min-width: min(100%, 220px);
}

.dashboard-bill-card--horizontal .dashboard-bill-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: none;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__icon .fa.paid-bill,
.dashboard-bill-card--horizontal .dashboard-bill-card__icon .fa.unpaid-bill {
    width: 24px;
    height: 24px;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__summary {
    min-width: 0;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__badges {
    margin-bottom: 0.15rem;
    gap: 0.3rem;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__badges .status-label {
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__amount {
    font-size: 1.05rem;
    line-height: 1.2;
    white-space: nowrap;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__meta {
    display: flex;
    flex: 1 1 320px;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem 1.5rem;
    min-width: 0;
    padding: 0 0.25rem;
    border-left: 1px solid #eef1f4;
    border-right: 1px solid #eef1f4;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__meta-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 120px;
    max-width: 220px;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__meta-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6c757d;
    line-height: 1.2;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__meta-value {
    font-size: 0.8125rem;
    color: #212529;
    line-height: 1.3;
    word-break: break-word;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__action-btn,
.dashboard-bill-card--horizontal .dashboard-bill-card__pay-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__action-btn i,
.dashboard-bill-card--horizontal .dashboard-bill-card__pay-btn i {
    margin-right: 0.25rem;
}

.dashboard-bill-card--horizontal .dashboard-bill-card__pay-btn {
    width: auto;
    min-width: 5.5rem;
    margin-left: 0;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.24);
    font-weight: 600;
}

@media (max-width: 992px) {
    .dashboard-bill-card--horizontal .dashboard-bill-card__meta {
        flex-basis: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px solid #eef1f4;
        border-bottom: 1px solid #eef1f4;
        padding: 0.55rem 0;
    }

    .dashboard-bill-card--horizontal .dashboard-bill-card__meta-item {
        flex: 1 1 calc(50% - 0.75rem);
        max-width: none;
    }
}

@media (max-width: 576px) {
    .dashboard-bill-card--horizontal .dashboard-bill-card__main {
        padding: 0.65rem 0.75rem;
        gap: 0.65rem;
    }

    .dashboard-bill-card--horizontal .dashboard-bill-card__lead {
        flex: 1 1 100%;
        min-width: 0;
    }

    .dashboard-bill-card--horizontal .dashboard-bill-card__actions {
        flex: 1 1 100%;
        justify-content: stretch;
    }

    .dashboard-bill-card--horizontal .dashboard-bill-card__action-btn,
    .dashboard-bill-card--horizontal .dashboard-bill-card__pay-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dashboard-bill-card--horizontal .dashboard-bill-card__pay-btn {
        flex: 1 1 100%;
    }
}

/* Legacy compact class — keep for paid cards if needed */
.dashboard-bill-card--compact {
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 48, 63, 0.08);
}

.dashboard-bill-card--compact .dashboard-bill-card__hero {
    padding: 0.5rem 0.65rem;
    gap: 0.5rem;
    background: #fafbfc;
}

.dashboard-bill-card--compact .dashboard-bill-card__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: none;
}

.dashboard-bill-card--compact .dashboard-bill-card__icon .fa.paid-bill,
.dashboard-bill-card--compact .dashboard-bill-card__icon .fa.unpaid-bill {
    width: 22px;
    height: 22px;
}

.dashboard-bill-card--compact .dashboard-bill-card__badges {
    margin-bottom: 0.1rem;
    gap: 0.25rem;
}

.dashboard-bill-card--compact .dashboard-bill-card__badges .status-label {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}

.dashboard-bill-card--compact .dashboard-bill-card__amount {
    font-size: 0.95rem;
    line-height: 1.15;
}

.dashboard-bill-card--compact .dashboard-bill-card__details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.5rem;
    row-gap: 0;
    padding: 0.35rem 0.65rem;
}

.dashboard-bill-card--compact .mobile-bill-card__row {
    display: block;
    padding: 0.2rem 0;
    border-bottom: none;
}

.dashboard-bill-card--compact .mobile-bill-card__row dt {
    font-size: 0.65rem;
    line-height: 1.2;
    margin-bottom: 0.05rem;
}

.dashboard-bill-card--compact .mobile-bill-card__row dd {
    font-size: 0.75rem;
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-bill-card--compact .mobile-bill-card__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem 0.5rem;
}

.dashboard-bill-card--compact .dashboard-bill-card__action-btn,
.dashboard-bill-card--compact .dashboard-bill-card__pay-btn {
    flex: 1 1 auto;
    min-height: 32px;
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.dashboard-bill-card--compact .dashboard-bill-card__action-btn i,
.dashboard-bill-card--compact .dashboard-bill-card__pay-btn i {
    margin-right: 0.2rem;
}

.dashboard-bill-card--compact .dashboard-bill-card__pay-btn {
    width: auto;
    min-width: 0;
    margin-left: 0;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.22);
    font-weight: 600;
}

@media (min-width: 992px) {
    .s-ePaymentMPA-PMS-AgentBillDashboardGrid .dashboard-bill-card-wrap {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Bill History — desktop grid fills width after mobile card view */
.s-PMS-AgentBillGrid:not(.agent-bill-mobile-cards) .grid-container,
.s-ePaymentMPA-PMS-AgentBillGrid:not(.agent-bill-mobile-cards) .grid-container {
    width: 100% !important;
    max-width: 100%;
}

.s-PMS-AgentBillGrid:not(.agent-bill-mobile-cards) .slick-viewport,
.s-ePaymentMPA-PMS-AgentBillGrid:not(.agent-bill-mobile-cards) .slick-viewport {
    width: 100% !important;
}

@media (max-width: 768px) {
    /* Dashboard statistics cards */
    .dashboard-stats-row {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0.75rem;
        --bs-gutter-x: 0.65rem;
    }

    .dashboard-stat-wrap {
        margin-bottom: 0.65rem;
    }

    .dashboard-stat-wrap:last-child {
        margin-bottom: 0;
    }

    .dashboard-stat-card--last-payment .card-body,
    .dashboard-stat-card--unpaid .card-body,
    .dashboard-stat-card--paid .card-body {
        min-height: 0;
        height: auto;
        padding: 0.85rem 0.9rem;
    }

    .dashboard-stat-card--last-payment .card-body {
        padding-bottom: 0.9rem;
    }

    .card-last-transaction,
    .card-paid-bill,
    .card-unpaid-bill {
        height: auto !important;
        min-height: 0;
    }

    .dashboard-stat-card--last-payment {
        min-height: 0;
    }

    .dashboard-stat-card--paid .card-body,
    .dashboard-stat-card--unpaid .card-body {
        min-height: 0;
        height: auto;
        padding: 0.85rem 0.9rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .dashboard-stat-card--paid .dashboard-stat-link--main,
    .dashboard-stat-card--unpaid .dashboard-stat-link--main {
        min-height: 4.75rem;
    }

    .dashboard-stat-card--paid .dashboard-stat-card__top,
    .dashboard-stat-card--unpaid .dashboard-stat-card__top {
        align-items: center;
    }

    .dashboard-stat-card--paid .dashboard-stat-card__icon,
    .dashboard-stat-card--unpaid .dashboard-stat-card__icon {
        position: static !important;
        top: auto !important;
        right: auto !important;
        flex-shrink: 0;
    }

    .dashboard-stat-card--paid .dashboard-stat-card__inner,
    .dashboard-stat-card--unpaid .dashboard-stat-card__inner {
        padding-right: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

    .dashboard-stat-card__label {
        font-size: 0.85rem;
    }

    .dashboard-stat-card__value {
        font-size: 1.15rem;
        margin-bottom: 0.65rem;
    }

    .dashboard-stat-card__count {
        font-size: 1.75rem;
    }

    .dashboard-stat-card__info {
        padding: 0.65rem 0.7rem !important;
        margin-top: 0.15rem;
    }

    .dashboard-stat-card__info p {
        font-size: 0.8rem;
        line-height: 1.45;
        margin-bottom: 0.2rem !important;
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }

    .dashboard-stat-card__info p:last-child {
        margin-bottom: 0 !important;
    }

    .dashboard-stat-wrap .textO {
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .dashboard-stat-card__icon {
        position: static !important;
        top: auto !important;
        right: auto !important;
    }

    .dashboard-stat-card__icon img {
        width: 42px;
        max-height: 42px;
        opacity: 0.9;
    }

    .dashboard-stat-card__inner {
        padding-right: 0;
    }

    .dashboard-stat-card__footer {
        margin-top: 0.15rem;
        flex-shrink: 0;
    }

    .dashboard-stat-manual-btn {
        min-height: 40px;
        font-size: 0.75rem;
        padding: 0.45rem 0.55rem;
    }

    .dashboard-stat-manual-btn i {
        flex-shrink: 0;
    }

    .dashboard-stat-link--main:active {
        opacity: 0.92;
    }

    .dashboard-stat-link--main:active .dashboard-stat-card__top {
        transform: scale(0.98);
        transition: transform 0.12s ease;
    }

    /* Bill History — force card shell on mobile even before JS toggles visibility */
    .s-PMS-AgentBillGrid.agent-bill-mobile-cards .grid-container,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-cards .grid-container {
        display: none !important;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-cards .card-container,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-cards .card-container {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: transparent;
        padding: 0.25rem 0 1rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-cards .mobile-bill-card,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-cards .mobile-bill-card {
        box-shadow: 0 3px 12px rgba(15, 48, 63, 0.1);
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-cards .grid-title .title-text,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-cards .grid-title .title-text {
        font-size: 1.15rem;
        font-weight: 700;
        color: #0F303F;
        line-height: 1.3;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .grid-toolbar,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .grid-toolbar {
        position: sticky;
        top: 0;
        z-index: 6;
        background: #f4f4f4;
        padding-top: 0.15rem;
        padding-bottom: 0.35rem;
    }

    .s-main,
    section.content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: env(safe-area-inset-bottom, 0.75rem);
    }

    .s-QuickSearchInput {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    #qSearch {
        float: none !important;
        width: 100%;
        margin-top: 0.5rem;
        display: block;
    }

    .s-ePaymentMPA-PMS-AgentBillDashboardGrid .grid-title {
        flex-direction: column;
        align-items: stretch;
    }

    .s-ePaymentMPA-PMS-AgentBillDashboardGrid #qSearch {
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 0.35rem;
    }

    .dashboard-bill-card__hero {
        padding: 0.85rem 0.9rem 0.75rem;
        gap: 0.75rem;
    }

    .dashboard-bill-card__icon {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .dashboard-bill-card__amount {
        font-size: 1.1rem;
    }

    .dashboard-bill-card__actions-row {
        flex-direction: column;
    }

    .dashboard-bill-card__actions-row .btn {
        width: 100%;
        min-height: 44px;
    }

    .dashboard-bill-card__pay-btn {
        width: 100%;
        margin-left: 0;
    }

    .s-DataGrid .grid-title {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .s-DataGrid .grid-title .title-text {
        width: 100%;
    }

    .s-DataGrid .s-QuickSearchBar {
        width: 100%;
        margin: 0;
    }

    .s-DataGrid .quick-filters-bar {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .s-DataGrid .quick-filter-item {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 0.35rem;
    }

    .s-DataGrid .quick-filter-item input,
    .s-DataGrid .quick-filter-item select,
    .s-DataGrid .quick-filter-item .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    .s-DataGrid .grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .s-DataGrid .slick-viewport {
        min-height: 200px;
    }

    .s-DataGrid .s-Toolbar .tool-buttons {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .s-DataGrid .s-Toolbar .tool-button {
        margin-bottom: 0.25rem;
    }

    /* Bill History — filters + search on mobile */
    .s-PMS-AgentBillGrid .agent-bill-filters-toggle,
    .s-ePaymentMPA-PMS-AgentBillGrid .agent-bill-filters-toggle {
        display: none;
    }

    .s-PMS-AgentBillGrid .grid-title,
    .s-ePaymentMPA-PMS-AgentBillGrid .grid-title {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .s-PMS-AgentBillGrid .grid-toolbar,
    .s-ePaymentMPA-PMS-AgentBillGrid .grid-toolbar {
        margin-bottom: 0.5rem;
    }

    .s-PMS-AgentBillGrid .s-Toolbar,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar {
        display: grid;
        grid-template-columns: 1fr 44px;
        grid-template-areas:
            "filters filters"
            "search refresh";
        align-items: stretch;
        gap: 0.65rem;
        padding: 0;
        background: transparent;
        border: none;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar {
        grid-area: filters;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        float: none;
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 12px;
        border: 1px solid #d5dde5;
        background: linear-gradient(160deg, #f8fafb 0%, #eef2f6 100%);
        box-sizing: border-box;
        box-shadow: 0 4px 14px rgba(15, 48, 63, 0.08);
        overflow: hidden;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        width: 100%;
        margin: 0;
        padding: 0.8rem 0.9rem;
        border: none;
        border-bottom: 1px solid rgba(15, 48, 63, 0.08);
        background: linear-gradient(135deg, #0F303F 0%, #1a4a5e 100%);
        color: #fff;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle:active,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle:active {
        opacity: 0.94;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__leading,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__leading {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.14);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__body,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__body {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__title,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__title {
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__hint,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__hint {
        font-size: 0.72rem;
        font-weight: 500;
        opacity: 0.82;
        line-height: 1.25;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__badge,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__badge {
        flex: 0 0 auto;
        min-width: 24px;
        height: 24px;
        padding: 0 0.45rem;
        border-radius: 999px;
        background: #f39c12;
        color: #fff;
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 24px;
        text-align: center;
        box-shadow: 0 2px 6px rgba(243, 156, 18, 0.35);
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__chevron,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-toggle__chevron {
        flex: 0 0 auto;
        font-size: 0.85rem;
        opacity: 0.9;
        transition: transform 0.2s ease;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout.agent-bill-filters-collapsed .agent-bill-filters-toggle__chevron,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout.agent-bill-filters-collapsed .agent-bill-filters-toggle__chevron {
        transform: rotate(-90deg);
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout.agent-bill-filters-collapsed .agent-bill-filters-panel > .quick-filter-item,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout.agent-bill-filters-collapsed .agent-bill-filters-panel > .quick-filter-item {
        display: none !important;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-panel > .quick-filter-item,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-panel > .quick-filter-item {
        margin: 0 0.75rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-panel > .quick-filter-item:last-child,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filters-panel > .quick-filter-item:last-child {
        margin-bottom: 0.75rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field {
        display: block;
        width: 100%;
        margin: 0 0 0.65rem;
        padding: 0.7rem 0.75rem;
        border-radius: 10px;
        border: 1px solid #e3e8ed;
        background: #fff;
        box-shadow: 0 1px 4px rgba(15, 48, 63, 0.05);
        box-sizing: border-box;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field.quick-filter-active,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field.quick-filter-active {
        border-color: #0F303F;
        background: #f3f8fa;
        box-shadow: 0 2px 10px rgba(15, 48, 63, 0.12);
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--reftype,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--reftype {
        border-left: 3px solid #c0392b;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--txnrefno,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--txnrefno {
        border-left: 3px solid #2980b9;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--assessmentno,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--assessmentno {
        border-left: 3px solid #8e44ad;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--collectionstatus,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--collectionstatus {
        border-left: 3px solid #f39c12;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--collectiondate,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-field--collectiondate {
        border-left: 3px solid #16a085;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item {
        display: block;
        width: 100%;
        margin: 0;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-label,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-label {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.78rem;
        font-weight: 700;
        color: #495057;
        margin-bottom: 0.45rem;
        letter-spacing: 0.01em;
        text-transform: uppercase;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-icon,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .agent-bill-filter-icon {
        width: 1.1rem;
        text-align: center;
        color: #0F303F;
        opacity: 0.85;
        font-size: 0.85rem;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-active .quick-filter-label,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-active .quick-filter-label {
        color: #0F303F;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.editor,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.editor,
    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.s-StringEditor,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.s-StringEditor {
        width: 100% !important;
        min-height: 44px;
        margin: 0;
        padding: 0.55rem 0.75rem;
        border-radius: 8px;
        border: 1px solid #ced4da;
        background: #fff;
        font-size: 1rem;
        box-sizing: border-box;
    }

    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.editor:focus,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.editor:focus,
    .s-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.s-StringEditor:focus,
    .s-ePaymentMPA-PMS-AgentBillGrid.agent-bill-mobile-layout .quick-filter-item input.s-StringEditor:focus {
        outline: none;
        border-color: #0F303F;
        box-shadow: 0 0 0 3px rgba(15, 48, 63, 0.12);
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item .select2-container,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item .select2-choice,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item .select2-choice {
        min-height: 44px;
        line-height: 42px;
        border-radius: 8px;
        border-color: #ced4da;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"],
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .quick-filter-label,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .quick-filter-label {
        flex: 0 0 100%;
        margin-bottom: 0;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .s-DateEditor,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .s-DateEditor,
    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] input.hasDatepicker,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] input.hasDatepicker {
        flex: 1 1 calc(50% - 1rem);
        min-width: 0;
        width: auto !important;
        max-width: none;
        min-height: 44px;
        margin: 0;
        top: 0;
        padding: 0.5rem 0.65rem;
        border-radius: 8px;
        border: 1px solid #ced4da;
        box-sizing: border-box;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .range-separator,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .range-separator {
        flex: 0 0 auto;
        margin: 0;
        top: 0;
        font-weight: 600;
        color: #6c757d;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .ui-datepicker-trigger,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .quick-filters-bar .quick-filter-item[data-qffield="CollectionDate"] .ui-datepicker-trigger {
        flex: 0 0 auto;
        margin: 0;
        top: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        box-sizing: border-box;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar {
        grid-area: search;
        float: none;
        display: flex;
        align-items: stretch;
        width: 100%;
        min-width: 0;
        margin: 0;
        border: 1px solid #ced4da;
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
        box-sizing: border-box;
        box-shadow: 0 1px 3px rgba(15, 48, 63, 0.06);
    }

    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .quick-search-icon,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .quick-search-icon {
        float: none;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 0;
        background: #0F303F;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .quick-search-icon i,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .quick-search-icon i {
        width: 18px;
        height: 18px;
        background-size: contain;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .s-QuickSearchInput,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .s-QuickSearchInput,
    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar input.s-QuickSearchInput,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar input.s-QuickSearchInput {
        float: none;
        flex: 1 1 auto;
        width: 100% !important;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        line-height: 1.25;
        margin: 0;
        padding: 0 0.75rem;
        border: none !important;
        border-radius: 0;
        font-size: 1rem;
        box-shadow: none;
        box-sizing: border-box;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .s-QuickSearchInput:focus,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .s-QuickSearchBar .s-QuickSearchInput:focus {
        outline: none;
        box-shadow: inset 0 0 0 2px rgba(15, 48, 63, 0.15);
    }

    /* Hide Serenity clearfix only — quick-filters-bar also has class "clear" */
    .s-PMS-AgentBillGrid .s-Toolbar > .clear:empty,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar > .clear:empty {
        display: none;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .tool-buttons,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .tool-buttons {
        grid-area: refresh;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        width: auto;
        margin: 0;
        padding: 0;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .tool-buttons .tool-button,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .tool-buttons .tool-button {
        float: none;
        width: 44px;
        height: 44px;
        min-width: 44px;
        margin: 0;
        padding: 0;
        border-radius: 10px;
        border: 1px solid #ced4da;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 48, 63, 0.06);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .tool-buttons .tool-button .button-outer,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .tool-buttons .tool-button .button-outer {
        float: none;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 10px;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .tool-buttons .refresh-button span.button-inner,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .tool-buttons .refresh-button span.button-inner {
        width: 18px;
        height: 18px;
        background-size: contain;
        background-position: center;
    }

    .s-PMS-AgentBillGrid .s-Toolbar .column-picker-button,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .column-picker-button,
    .s-PMS-AgentBillGrid .s-Toolbar .export-xlsx-button,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .export-xlsx-button,
    .s-PMS-AgentBillGrid .s-Toolbar .export-pdf-button,
    .s-ePaymentMPA-PMS-AgentBillGrid .s-Toolbar .export-pdf-button {
        display: none !important;
    }

    .s-DataGrid .card-container {
        width: 100% !important;
        height: auto !important;
        min-height: 120px;
        max-height: none !important;
        overflow: visible !important;
        background: #f4f4f4;
        padding: 0.5rem 0 1rem;
    }

    .s-DataGrid .card-container .card-items,
    .s-DataGrid .card-container > .row {
        margin-left: 0;
        margin-right: 0;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .s-DataGrid .card-container .col-12,
    .s-DataGrid .card-container .col-md-6,
    .s-DataGrid .card-container .mobile-bill-card-wrap,
    .s-DataGrid .card-container .dashboard-bill-card-wrap {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .mobile-bill-card__actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        min-height: 44px;
        font-size: 0.875rem;
        padding: 0.5rem 0.65rem;
    }

    .mobile-bill-card__actions .btn.btn-warning,
    .mobile-bill-card__actions .btn.btn-pay-primary {
        flex: 1 1 100%;
        font-weight: 600;
    }

    .s-PMS-AgentBillDialog > .size,
    .s-ePaymentMPA-PMS-AgentBillDialog > .size {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
    }

    .ui-dialog:has(.s-PMS-CybsPaymentDialog),
    .ui-dialog:has(.s-ePaymentMPA-PMS-CybsPaymentDialog),
    .ui-dialog:has(.s-PMS-BracBankPaymentDialog),
    .ui-dialog:has(.s-ePaymentMPA-PMS-BracBankPaymentDialog),
    .ui-dialog:has(.s-PMS-SSLCommerzPaymentDialog),
    .ui-dialog:has(.s-ePaymentMPA-PMS-SSLCommerzPaymentDialog) {
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        width: min(92vw, 420px) !important;
        height: auto !important;
        max-height: calc(100vh - 2rem) !important;
        transform: translate(-50%, -50%) !important;
        position: fixed !important;
        margin: 0 !important;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 16px 48px rgba(15, 48, 63, 0.28);
    }

    .s-PMS-CybsPaymentDialog > .size,
    .s-PMS-BracBankPaymentDialog > .size,
    .s-PMS-SSLCommerzPaymentDialog > .size,
    .s-ePaymentMPA-PMS-CybsPaymentDialog > .size,
    .s-ePaymentMPA-PMS-BracBankPaymentDialog > .size,
    .s-ePaymentMPA-PMS-SSLCommerzPaymentDialog > .size {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .ui-dialog.mobile-layout:has(.s-PMS-CybsPaymentDialog),
    .ui-dialog.mobile-layout:has(.s-ePaymentMPA-PMS-CybsPaymentDialog),
    .ui-dialog.mobile-layout:has(.s-PMS-BracBankPaymentDialog),
    .ui-dialog.mobile-layout:has(.s-ePaymentMPA-PMS-BracBankPaymentDialog),
    .ui-dialog.mobile-layout:has(.s-PMS-SSLCommerzPaymentDialog),
    .ui-dialog.mobile-layout:has(.s-ePaymentMPA-PMS-SSLCommerzPaymentDialog) {
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        width: min(92vw, 420px) !important;
        height: auto !important;
        max-height: calc(100vh - 2rem) !important;
        transform: translate(-50%, -50%) !important;
    }

    .ui-dialog.mobile-layout:not(:has(.s-PMS-CybsPaymentDialog)):not(:has(.s-ePaymentMPA-PMS-CybsPaymentDialog)):not(:has(.s-PMS-BracBankPaymentDialog)):not(:has(.s-ePaymentMPA-PMS-BracBankPaymentDialog)):not(:has(.s-PMS-SSLCommerzPaymentDialog)):not(:has(.s-ePaymentMPA-PMS-SSLCommerzPaymentDialog)) {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
    }

    /* Grid pager — Serenity uses .s-SlickPager (not .s-Pager) */
    .s-DataGrid .s-SlickPager {
        height: auto;
        min-height: 48px;
        white-space: normal;
        overflow: visible;
        padding: 0.65rem 0.5rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #dee2e6;
        background: #fafbfc;
        position: sticky;
        bottom: 0;
        z-index: 5;
        box-shadow: 0 -2px 8px rgba(15, 48, 63, 0.06);
    }

    .s-DataGrid .s-SlickPager .slick-pg-in {
        float: none;
        width: 100% !important;
        max-width: 100%;
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.4rem 0.5rem;
    }

    .s-DataGrid .s-SlickPager .slick-pg-grp {
        float: none;
        height: auto;
        margin: 0;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .s-DataGrid .s-SlickPager .slick-pg-sep {
        display: none;
    }

    /* Prev / page / next / reload on one row */
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-prev),
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-control),
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-next),
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-reload) {
        order: 1;
    }

    /* Hide first/last — too cramped on narrow screens */
    .s-DataGrid .s-SlickPager .slick-pg-first,
    .s-DataGrid .s-SlickPager .slick-pg-last {
        display: none;
    }

    .s-DataGrid .s-SlickPager .slick-pg-btn {
        float: none;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #ced4da;
        background-color: #fff;
        background-size: 10px auto;
    }

    .s-DataGrid .s-SlickPager .slick-pg-btn:hover,
    .s-DataGrid .s-SlickPager .slick-pg-btn:active {
        border-color: #0F303F;
        background-color: #f0f4f6;
    }

    .s-DataGrid .s-SlickPager .slick-pg-btn-span {
        width: 100%;
        height: 100%;
        float: none;
        border: none;
    }

    .s-DataGrid .s-SlickPager .slick-pg-control {
        position: static;
        top: auto;
        font-size: 0.875rem;
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        white-space: nowrap;
        padding: 0 0.15rem;
    }

    .s-DataGrid .s-SlickPager .slick-pg-control input.slick-pg-current {
        width: 2.75rem;
        height: 40px;
        text-align: center;
        font-size: 0.95rem;
        font-weight: 600;
        border: 1px solid #ced4da;
        border-radius: 8px;
        box-sizing: border-box;
        padding: 0 0.25rem;
        line-height: 1.2;
    }

    .s-DataGrid .s-SlickPager .slick-pg-total {
        font-weight: 600;
        color: #0F303F;
    }

    /* Record count — full width below nav */
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-stat) {
        flex: 1 1 100%;
        justify-content: center;
        order: 2;
        padding-top: 0.15rem;
    }

    .s-DataGrid .s-SlickPager .slick-pg-stat {
        position: static;
        top: auto;
        font-size: 0.8rem;
        color: #6c757d;
        text-align: center;
        line-height: 1.4;
        white-space: normal;
        word-break: break-word;
    }

    /* Rows per page — bottom row */
    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-size) {
        flex: 1 1 100%;
        justify-content: center;
        order: 3;
        gap: 0.5rem;
        padding-top: 0.25rem;
        border-top: 1px solid #eef0f2;
        margin-top: 0.15rem;
        padding-bottom: 0.1rem;
    }

    .s-DataGrid .s-SlickPager .slick-pg-grp:has(.slick-pg-size)::before {
        content: "Show";
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 500;
    }

    .s-DataGrid .s-SlickPager .slick-pg-size {
        float: none;
        height: 40px;
        min-width: 4.75rem;
        margin-top: 0;
        padding: 0 0.5rem;
        border: 1px solid #ced4da;
        border-radius: 8px;
        font-size: 0.875rem;
        background: #fff;
        box-sizing: border-box;
    }
}

@media (min-width: 769px) {
    .s-DataGrid .card-container .mobile-bill-card-wrap {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .mobile-bill-card__actions-row .btn {
        flex: 0 1 auto;
        min-height: 38px;
    }

    .mobile-bill-card__actions .btn.btn-pay-primary {
        flex: 0 1 auto;
        align-self: flex-start;
        min-width: 140px;
    }
}

/* Sidebar backdrop when open on mobile/tablet */
@media (max-width: 1199.98px) {
    body.s-sidebar-expanded {
        overflow: hidden;
    }

    body.s-sidebar-expanded::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 10;
    }

    .s-sidebar {
        width: min(300px, 85vw);
    }

    .s-sidebar-pane {
        width: min(300px, 85vw);
    }

    .s-sidebar-link {
        min-height: 44px;
    }

    .s-sidebar-header-title {
        font-size: 1.1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: calc(100vw - 120px);
    }
}
