/* AlNahal: Phase 2 navigation, bottom bar, and mobile responsive layout */

:root {
    --bottom-nav-h: 64px;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 312px;
    z-index: 90;
    background: hsl(var(--card-bg));
    border-top: 1px solid hsl(var(--border-color));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 0.2s ease-in-out;
}

@media screen and (max-width: 1399px) {
    .bottom-nav {
        left: 260px;
    }
}

@media screen and (max-width: 1199px) {
    .bottom-nav {
        left: 0;
    }
}

.bottom-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--bottom-nav-h);
    max-width: 640px;
    margin: 0 auto;
    padding: 0 8px;
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 44px;
    color: hsl(var(--body-color));
    text-decoration: none;
    transition: color 0.2s ease-in-out;
    gap: 4px;
    padding: 4px 2px;
}

.bottom-nav__item i {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav__item .text {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 500;
}

.bottom-nav__item:hover,
.bottom-nav__item.active {
    color: hsl(var(--base));
}

.bottom-nav__item.active .text {
    font-weight: 600;
}

/* Hide on mobile when keyboard is focused */
.bottom-nav.bottom-nav--hidden {
    transform: translateY(100%);
    pointer-events: none;
}

/* Ensure page content does not hide behind fixed bottom bar */
.dashboard__right {
    padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Adjust fixed elements above bottom bar */
body:has(.bottom-nav) .scroll-top {
    bottom: calc(30px + var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

body:has(.bottom-nav) .cookies-card {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

/* ------------------------------------------------------------------
   AlNahal: Transfer redesign (2026-10-11): form, confirm, receipt, history
   ------------------------------------------------------------------ */
.tx-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.tx-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 16px;
    padding: 20px;
}

@media (max-width: 575px) {
    .tx-card {
        padding: 16px;
        border-radius: 12px;
    }
}

.tx-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: hsl(var(--base) / 0.08);
}

.tx-balance__label {
    font-size: 14px;
    color: hsl(var(--body-color));
}

.tx-balance__value {
    font-size: 18px;
    font-weight: 700;
    color: hsl(var(--heading-color));
}

.tx-field {
    margin-bottom: 18px;
}

.tx-field__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: hsl(var(--heading-color));
}

.tx-input {
    position: relative;
}

.tx-input .form--control {
    font-size: 16px; /* 16px stops iOS zooming into the field */
    min-height: 48px;
    padding-right: 52px;
}

.tx-input--amount .form--control {
    font-size: 22px;
    font-weight: 700;
    min-height: 56px;
}

.tx-input--amount .form--control::placeholder {
    font-size: 22px;
    font-weight: 700;
}

.tx-input__suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: hsl(var(--body-color));
    pointer-events: none;
}

.tx-input__spinner {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid hsl(var(--border-color));
    border-top-color: hsl(var(--base));
    border-radius: 50%;
    animation: tx-spin 0.7s linear infinite;
}

@keyframes tx-spin {
    to {
        transform: rotate(360deg);
    }
}

.tx-hint {
    display: block;
    font-size: 13px;
    margin-top: 6px;
    color: hsl(var(--body-color));
}

.tx-error {
    display: block;
    font-size: 13px;
    margin-top: 6px;
    color: hsl(var(--danger));
}

.tx-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tx-person--card {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid hsl(var(--success) / 0.4);
    background: hsl(var(--success) / 0.08);
}

.tx-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    color: hsl(var(--base));
    background: hsl(var(--base) / 0.15);
}

.tx-person__text {
    min-width: 0;
    flex: 1 1 auto;
}

.tx-person__name {
    display: block;
    font-weight: 600;
    color: hsl(var(--heading-color));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-person__username {
    display: block;
    font-size: 13px;
    color: hsl(var(--body-color));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-person__tick {
    flex: 0 0 auto;
    font-size: 22px;
    color: hsl(var(--success));
}

.tx-summary {
    list-style: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid hsl(var(--border-color));
}

.tx-summary li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-size: 15px;
}

.tx-summary li > span:last-child {
    text-align: right;
    font-weight: 600;
    color: hsl(var(--heading-color));
    word-break: break-all;
}

.tx-summary .tx-summary__total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed hsl(var(--border-color));
    font-weight: 700;
}

.tx-summary .tx-summary__total > span:last-child {
    color: hsl(var(--base));
    font-size: 17px;
}

.tx-btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
}

.tx-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    margin-top: 12px;
    color: hsl(var(--body-color));
}

/* Confirm / details modal: theme colours (Bootstrap's default is a white panel) */
.tx-sheet .modal-content {
    background: hsl(var(--card-bg));
    color: hsl(var(--body-color));
    border: 1px solid hsl(var(--border-color));
    border-radius: 16px;
}

.tx-sheet .modal-header {
    border-bottom: 1px solid hsl(var(--border-color));
}

.tx-sheet .modal-title {
    color: hsl(var(--heading-color));
}

.tx-sheet .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

[data-theme=light] .tx-sheet .btn-close {
    filter: none;
}

/* Confirm modal: bottom sheet on phones */
@media (max-width: 575px) {
    .tx-sheet .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: none;
        width: 100%;
        transform: translateY(100%);
        transition: transform 0.25s ease-out;
    }

    .tx-sheet.show .modal-dialog {
        transform: none;
    }

    .tx-sheet .modal-content {
        border-radius: 16px 16px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        max-height: 90vh;
        overflow-y: auto;
    }

    .tx-sheet .tx-sheet__actions {
        flex-direction: column-reverse;
    }

    .tx-sheet .tx-sheet__actions .btn {
        width: 100%;
        margin: 0;
    }
}

.tx-sheet__actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
}

.tx-sheet__actions .btn {
    flex: 1 1 0;
    min-height: 48px;
    font-weight: 600;
}

/* Receipt */
.tx-receipt {
    text-align: center;
}

.tx-receipt__icon {
    width: 72px;
    height: 72px;
    margin: 4px auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: hsl(var(--success));
    background: hsl(var(--success) / 0.12);
}

.tx-receipt__amount {
    font-size: 30px;
    font-weight: 700;
    color: hsl(var(--heading-color));
    margin: 4px 0 16px;
    word-break: break-word;
}

.tx-receipt .tx-person--card {
    text-align: left;
    margin: 0 0 16px;
}

.tx-receipt .tx-summary {
    text-align: left;
}

.tx-trx {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    word-break: break-all;
}

.tx-copy {
    border: 0;
    background: transparent;
    color: hsl(var(--base));
    padding: 4px;
    min-width: 32px;
    min-height: 32px;
}

.tx-actions {
    display: flex;
    gap: 10px;
}

.tx-actions .btn {
    flex: 1 1 0;
    min-height: 48px;
    font-weight: 600;
}

@media (max-width: 380px) {
    .tx-actions {
        flex-direction: column;
    }
}

/* History */
.tx-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-bottom: 12px;
}

.tx-tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid hsl(var(--border-color));
    color: hsl(var(--body-color));
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tx-tabs a.active {
    background: hsl(var(--base));
    border-color: hsl(var(--base));
    color: hsl(var(--white));
}

.tx-search {
    position: relative;
    margin-bottom: 16px;
}

.tx-search .form--control {
    font-size: 16px;
    min-height: 44px;
    padding-right: 48px;
}

.tx-search button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 48px;
    border: 0;
    background: transparent;
    color: hsl(var(--base));
}

.tx-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 10px 4px;
    border: 0;
    border-bottom: 1px solid hsl(var(--border-color));
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.tx-list li:last-child .tx-row {
    border-bottom: 0;
}

.tx-row:hover,
.tx-row:focus-visible {
    background: hsl(var(--base) / 0.05);
}

.tx-row__icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tx-row__icon--sent {
    color: hsl(var(--danger));
    background: hsl(var(--danger) / 0.12);
}

.tx-row__icon--received {
    color: hsl(var(--success));
    background: hsl(var(--success) / 0.12);
}

.tx-row__main {
    flex: 1 1 auto;
    min-width: 0;
}

.tx-row__title {
    display: block;
    font-weight: 600;
    color: hsl(var(--heading-color));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-row__sub {
    display: block;
    font-size: 13px;
    color: hsl(var(--body-color));
}

.tx-row__amount {
    flex: 0 0 auto;
    font-weight: 700;
    white-space: nowrap;
}

/* Phase 4: referrals */
.ref-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.ref-stat-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 14px 16px;
}

.ref-stat-card__label {
    font-size: 13px;
    color: hsl(var(--body-color));
    margin-bottom: 4px;
}

.ref-stat-card__value {
    font-size: 20px;
    font-weight: 700;
    color: hsl(var(--heading-color));
    margin-bottom: 0;
    line-height: 1.2;
}

@media (max-width: 480px) {
    .ref-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ref-stat-card--full {
        grid-column: span 2;
    }
}

.ref-levels {
    margin-bottom: 16px;
}

.ref-level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid hsl(var(--border-color));
    background: hsl(var(--card-bg));
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
    transition: background 0.15s ease;
}

.ref-level-row:last-child {
    margin-bottom: 0;
}

.ref-level-row:hover,
.ref-level-row:focus-visible {
    background: hsl(var(--base) / 0.05);
    color: inherit;
}

.ref-level-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: hsl(var(--base) / 0.15);
    color: hsl(var(--base));
    flex: 0 0 auto;
}

.ref-level-pill__short {
    display: none;
}

/* Phones: "L2" pill (same as the chips) leaves room for "15 members" */
@media (max-width: 420px) {
    .ref-level-pill__long {
        display: none;
    }

    .ref-level-pill__short {
        display: inline;
    }
}

.ref-level-members {
    font-size: 14px;
    color: hsl(var(--body-color));
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ref-level-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ref-level-earned {
    font-weight: 600;
    color: hsl(var(--heading-color));
}

.ref-level-arrow {
    color: hsl(var(--body-color));
    font-size: 14px;
}

.ref-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ref-chips::-webkit-scrollbar {
    display: none;
}

/* Fade the right edge so a chip cut off at the screen edge reads as "scroll for more" */
@media (max-width: 767px) {
    .ref-chips {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        padding-right: 28px;
    }
}

.ref-comm-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.ref-comm-date {
    font-size: 12px;
    color: hsl(var(--body-color));
    white-space: nowrap;
}

.ref-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid hsl(var(--border-color));
    background: hsl(var(--card-bg));
    color: hsl(var(--body-color));
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.ref-chip:hover {
    color: hsl(var(--base));
    border-color: hsl(var(--base));
}

.ref-chip.active {
    background: hsl(var(--base));
    border-color: hsl(var(--base));
    color: hsl(var(--white));
}

.ref-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ref-filter-bar .tx-search {
    flex: 1 1 240px;
    margin-bottom: 0;
}

.ref-segment {
    display: inline-flex;
    border: 1px solid hsl(var(--border-color));
    border-radius: 8px;
    overflow: hidden;
    background: hsl(var(--card-bg));
    flex: 0 0 auto;
}

.ref-segment a {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--body-color));
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid hsl(var(--border-color));
    transition: background 0.15s ease;
}

.ref-segment a:last-child {
    border-right: 0;
}

.ref-segment a.active {
    background: hsl(var(--base));
    color: hsl(var(--white));
}

@media (max-width: 576px) {
    .ref-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ref-filter-bar .tx-search {
        flex: 1 1 auto;
        width: 100%;
    }

    .ref-segment {
        width: 100%;
    }
}

.ref-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 10px 4px;
    border-bottom: 1px solid hsl(var(--border-color));
    background: transparent;
}

.tx-list li:last-child .ref-member-row {
    border-bottom: 0;
}

.ref-member-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
}

/* ==================================================================
   My Assets (2026-10-14)
   ================================================================== */
.ma-note {
    color: hsl(var(--body-color) / 0.7);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.ma-chart {
    min-height: 250px;
}

/* ==================================================================
   Agents (2026-10-26)
   ================================================================== */
.ag-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .ag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .ag-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ag-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.ag-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ag-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid hsl(var(--base) / 0.2);
    flex-shrink: 0;
}

.ag-shop-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: hsl(var(--heading-color));
    word-break: break-word;
}

.ag-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
}

.ag-buttons .btn {
    flex: 1 1 50%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.875rem;
    padding: 8px 12px;
}

.ag-notice {
    background: hsl(var(--card-bg));
    border-left: 4px solid hsl(var(--info, 199 89% 48%));
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: hsl(var(--body-color));
    line-height: 1.5;
}

.ag-benefits {
    background: hsl(var(--base) / 0.05);
    border: 1px solid hsl(var(--base) / 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ag-benefits__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--heading-color));
    margin-bottom: 8px;
}

.ag-benefits ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: hsl(var(--body-color));
}

.ag-benefits li {
    margin-bottom: 4px;
}

.ag-benefits li:last-child {
    margin-bottom: 0;
}


/* ==================================================================
   Agents v2 (2026-10-26): agent panel, Payment, deposit bonus
   ================================================================== */
.tx-wrap.ag-wrap {
    max-width: 960px;
}

.ag-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.ag-section-title h6 {
    margin: 0;
    font-size: 16px;
    color: hsl(var(--heading-color));
}

.ag-section-title a {
    font-size: 14px;
    color: hsl(var(--base));
    white-space: nowrap;
}

.ag-card--alert {
    border-color: hsl(var(--warning) / 0.6);
}

/* Requests inbox on agent Home */
.ag-request {
    padding: 12px 0;
    border-bottom: 1px solid hsl(var(--border-color));
}

.ag-request:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ag-request__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.ag-request__who {
    font-weight: 600;
    color: hsl(var(--heading-color));
    word-break: break-word;
}

.ag-request__amount {
    font-weight: 700;
    color: hsl(var(--base));
    white-space: nowrap;
}

.ag-request__age {
    font-size: 13px;
    color: hsl(var(--body-color));
}

.ag-request__note {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-style: italic;
    background: hsl(var(--base) / 0.06);
    word-break: break-word;
}

.ag-request__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* The stock main.css sets .btn { display: inline-block !important }, so a flex button needs !important too */
.ag-request__actions .btn,
.ag-quick-actions .btn,
.ag-shop .btn,
.ag-buttons .btn,
.ag-id-card__actions .btn,
.ag-section-title .btn {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ag-request__actions .btn {
    min-width: 104px;
}

/* Balance card quick actions */
.ag-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ag-quick-actions .btn {
    padding: 8px 6px;
    font-size: 14px;
    font-weight: 600;
}

/* Phones: icon over label, like app tiles, so "Withdraw" doesn't wrap */
@media (max-width: 575px) {
    .ag-quick-actions .btn {
        flex-direction: column;
        gap: 2px;
        font-size: 13px;
        line-height: 1.2;
        padding: 8px 4px;
    }

    .ag-quick-actions .btn i {
        font-size: 20px;
    }
}

/* Today | This month switch */
.ag-segment {
    display: inline-flex;
    border: 1px solid hsl(var(--border-color));
    border-radius: 999px;
    padding: 2px;
}

.ag-segment button {
    border: 0;
    background: transparent;
    color: hsl(var(--body-color));
    font-size: 13px;
    font-weight: 600;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
}

.ag-segment button.active {
    background: hsl(var(--base));
    color: hsl(var(--white));
}

/* Shop card */
.ag-shop {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ag-shop__top {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ag-shop__name {
    margin: 0;
    font-size: 16px;
    color: hsl(var(--heading-color));
    word-break: break-word;
}

.ag-shop__sub {
    font-size: 13px;
    color: hsl(var(--body-color));
}

.ag-avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: hsl(var(--base));
    background: hsl(var(--base) / 0.15);
}

/* History filter row: search, from, to, buttons; stacks on phones. minmax(0, …) lets the tracks shrink below
   the inputs' intrinsic width (a native date input is ~150px), which would otherwise push the row out of the card. */
.ag-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ag-filter .form--control {
    width: 100%;
    min-width: 0;
    font-size: 16px;
    min-height: 44px;
}

.ag-filter__dates {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.ag-filter__dates label {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
    color: hsl(var(--body-color));
}

.ag-filter__buttons {
    display: flex;
    gap: 8px;
}

.ag-filter__buttons .btn {
    min-height: 44px;
    flex: 1 1 auto;
}

@media (min-width: 768px) {
    .ag-filter {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
        align-items: end;
    }
}

/* Extra row icons and the right column of activity rows */
.tx-row__icon--bonus {
    color: hsl(var(--base));
    background: hsl(var(--base) / 0.12);
}

.tx-row__icon--request {
    color: hsl(var(--warning));
    background: hsl(var(--warning) / 0.12);
}

.ag-row-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: 50%;
}

.ag-row-right small {
    font-size: 12px;
    color: hsl(var(--body-color));
    text-align: right;
}

.ag-row-reason {
    display: block;
    font-size: 13px;
    color: hsl(var(--danger));
    white-space: normal;
    word-break: break-word;
}

/* A pending request's Cancel sits under its row, so the row keeps its full width on phones */
.ag-activity-item {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid hsl(var(--border-color));
}

.tx-list li:last-child.ag-activity-item {
    border-bottom: 0;
}

.ag-activity-item .tx-row {
    border-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.ag-activity-item form {
    flex: 1 0 100%;
    display: flex;
    justify-content: flex-end;
    padding: 0 4px 10px;
}

.ag-cancel-btn {
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
}

/* Payment page */
.ag-id-card__value {
    font-size: 26px;
    font-weight: 700;
    color: hsl(var(--base));
    word-break: break-all;
    margin: 6px 0 12px;
}

.ag-id-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-id-card__actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ag-wa-btn {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.ag-buttons .btn.ag-wa-btn {
    flex: 0 0 44px;
}

/* Deposit bonus banner on the Deposit page */
.ag-bonus-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid hsl(var(--base) / 0.35);
    background: hsl(var(--base) / 0.1);
}

.ag-bonus-banner__icon {
    font-size: 24px;
    color: hsl(var(--base));
}

.ag-bonus-banner__title {
    display: block;
    font-weight: 700;
    color: hsl(var(--base));
}

.ag-bonus-banner__sub {
    font-size: 13px;
    color: hsl(var(--body-color));
}

.ag-bonus-live {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--base));
}

/* Pending-requests count on the agent bottom bar */
.ag-nav-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: hsl(var(--white));
    background: hsl(var(--danger));
}

.ag-shop__info {
    min-width: 0;
}

/* Agent Home (V32): one column on phones in the plan's order; from 1200px two columns. The column wrappers use
   display: contents on phones so their cards join the parent flex and can be reordered across columns. */
.ag-home {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ag-home__col {
    display: contents;
}

.ag-home__requests { order: 1; }
.ag-home__balance { order: 2; }
.ag-home__earnings { order: 3; }
.ag-home__recent { order: 4; }
.ag-home__shop { order: 5; }

@media (min-width: 1200px) {
    .ag-home {
        flex-direction: row;
        align-items: flex-start;
    }

    .ag-home__col {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-width: 0;
    }

    .ag-home__col--main {
        flex: 7 1 0;
    }

    .ag-home__col--side {
        flex: 5 1 0;
    }
}

.tx-row.ag-row-static {
    cursor: default;
}

.tx-row.ag-row-static:hover {
    background: transparent;
}

/* Payment: the ID card and the safety notice sit side by side on wide screens */
.ag-payment-top {
    display: grid;
    gap: 12px;
}

@media (min-width: 992px) {
    .ag-payment-top {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

/* Agents: keep a money value ("2.00 USD") on one line next to a long label. The shared
   .tx-summary value rule uses break-all for long trx codes, which split "USD" on phones. */
.tx-summary li > span.ag-amount {
    flex-shrink: 0;
    white-space: nowrap;
    word-break: normal;
}

/* Gold Mining (2026-11-01) */
@media screen and (max-width: 400px) {
    .bottom-nav__item .text {
        font-size: 11px;
    }
}

.gm-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding-bottom: 24px;
}

.gm-top-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 992px) {
    .gm-top-cards--dual {
        grid-template-columns: 1fr 1fr;
    }
}

.gm-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.gm-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gm-card__title {
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--body-color));
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gm-balance-val {
    font-size: 28px;
    font-weight: 700;
    color: hsl(var(--heading-color));
    line-height: 1.2;
    margin-bottom: 4px;
    word-break: break-all;
}

.gm-counter {
    font-size: 32px;
    font-weight: 800;
    color: hsl(var(--base));
    line-height: 1.2;
    margin-bottom: 8px;
    word-break: break-all;
    display: inline-block;
}

/* AlNahal: GM6f spinning gem on an active package (2026-11-02) */
.gm-spin {
    display: inline-block;
    color: hsl(var(--base));
    margin-left: 6px;
    animation: gm-spin 2.5s linear infinite;
}

@keyframes gm-spin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .gm-spin {
        animation: none;
    }
}

.gm-pkg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .gm-pkg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .gm-pkg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gm-pkg-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gm-pkg-card:hover {
    border-color: hsl(var(--base));
}

.gm-pkg-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

/* The name column takes the space left by the price, so long names wrap instead of pushing it */
.gm-pkg-card__head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.gm-pkg-card__name {
    font-size: 18px;
    font-weight: 700;
    color: hsl(var(--heading-color));
    margin: 0;
    overflow-wrap: anywhere;
}

.gm-pkg-card__price {
    font-size: 18px;
    font-weight: 800;
    color: hsl(var(--base));
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.gm-estimates {
    background: hsl(var(--body-bg) / 0.5);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
}

.gm-estimates__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: hsl(var(--body-color));
    margin-bottom: 4px;
}

.gm-estimates__row:last-child {
    margin-bottom: 0;
}

.gm-bonus {
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--success));
    margin-top: 4px;
}

/* Ranks */
.rk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, hsl(var(--base)), hsl(var(--base-d-100)));
    color: #fff;
    vertical-align: middle;
    margin-left: 6px;
    line-height: 1.4;
}

/* RK6b F5: rank medal on the topbar avatar (phones, where the name is hidden) */
.rk-avatar-medal {
    position: absolute;
    left: 22px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    background: linear-gradient(135deg, hsl(var(--base)), hsl(var(--base-d-100)));
    border: 2px solid hsl(var(--card-bg));
    pointer-events: none;
}

@media (max-width: 400px) {
    .rk-badge {
        padding: 2px 6px;
    }
    .rk-badge__text {
        display: none;
    }
}

.rk-card {
    background: hsl(var(--card-bg));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

.rk-rank-title {
    font-size: 26px;
    font-weight: 800;
    color: hsl(var(--heading-color));
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.rk-rank-since {
    font-size: 13px;
    font-weight: 500;
    color: hsl(var(--body-color));
}

.rk-salary-line {
    font-size: 16px;
    font-weight: 700;
    color: hsl(var(--base));
    margin-bottom: 8px;
}

.rk-review-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: hsl(var(--warning) / 0.15);
    color: hsl(var(--warning));
    margin-top: 4px;
}

.rk-pinned-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: hsl(var(--info) / 0.15);
    color: hsl(var(--info));
    margin-top: 4px;
}

.rk-stat-label {
    font-size: 13px;
    color: hsl(var(--body-color));
    margin-bottom: 2px;
}

.rk-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: hsl(var(--heading-color));
    line-height: 1.2;
}

.rk-stat-sub {
    font-size: 13px;
    color: hsl(var(--body-color));
    margin-top: 2px;
}

.rk-progress-bar {
    background: hsl(var(--body-bg));
    border-radius: 9999px;
    height: 12px;
    overflow: hidden;
    margin: 14px 0 8px;
    position: relative;
    border: 1px solid hsl(var(--border-color));
}

.rk-progress-bar__fill {
    background: linear-gradient(90deg, hsl(var(--base)), hsl(var(--base-two)));
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.rk-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: hsl(var(--body-color));
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 4px;
}

.rk-recalc-line {
    font-size: 12px;
    color: hsl(var(--body-color));
    margin-top: 8px;
}

.rk-ladder-cards {
    display: none;
}

@media (max-width: 767px) {
    .rk-ladder-table {
        display: none;
    }
    .rk-ladder-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

.rk-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.rk-chip--reached {
    background: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
}

.rk-chip--review {
    background: hsl(var(--warning) / 0.15);
    color: hsl(var(--warning));
}

.rk-chip--next {
    background: hsl(var(--base) / 0.15);
    color: hsl(var(--base));
}

.rk-chip--locked {
    background: hsl(var(--dark) / 0.12);
    color: hsl(var(--body-color));
}

.rk-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid hsl(var(--border-color));
    flex-wrap: wrap;
    gap: 8px;
}

.rk-item-row:last-child {
    border-bottom: none;
}


/* RL4b F3: per-rank leg rule under the target on the ladder */
.rk-rule-text {
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* RL4b F4: the "gold buys don't count" note under the progress text */
.rk-progress-note {
    font-size: 11px;
    line-height: 1.4;
    color: hsl(var(--body-color) / 0.75);
    margin: -8px 0 14px;
}

/* Signup bonus and Marketing Plan */
.sb-register-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid hsl(var(--base) / 0.3);
    background: hsl(var(--base) / 0.08);
    color: hsl(var(--body-color));
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.sb-register-note i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: hsl(var(--base));
}

.mp-wrap {
    max-width: 960px;
    margin: 0 auto;
}

.mp-download-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 767px) {
    .dashboard-body__top:has(.mp-download-btn) .dashboard-buttons {
        width: 100%;
    }
    .mp-download-btn {
        width: 100%;
    }
}

.mp-title-card {
    text-align: center;
}

.mp-title-card__name {
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: hsl(var(--heading-color));
    overflow-wrap: anywhere;
}

.mp-title-card__sub {
    font-size: 13px;
    color: hsl(var(--body-color));
}

.mp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.mp-card {
    min-width: 0;
}

.mp-card__title {
    font-size: 16px;
    font-weight: 700;
    color: hsl(var(--base));
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.mp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mp-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid hsl(var(--border-color));
}

.mp-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.mp-row__label {
    flex: 1 1 auto;
    min-width: 0;
    color: hsl(var(--body-color));
    overflow-wrap: anywhere;
}

.mp-row__value {
    flex: 0 0 auto;
    font-weight: 700;
    color: hsl(var(--heading-color));
    text-align: right;
    white-space: nowrap;
}

.mp-ref-tables {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.mp-ref-box {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid hsl(var(--border-color));
    background: hsl(var(--body-bg) / 0.35);
}

.mp-ref-box__title {
    font-size: 14px;
    font-weight: 700;
    color: hsl(var(--heading-color));
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .mp-ref-tables--dual {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .mp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mp-card {
        grid-column: 1 / -1;
    }
    .mp-grid--pair .mp-card--copy_trade {
        grid-column: span 1;
        order: 1;
    }
    .mp-grid--pair .mp-card--signup_bonus {
        grid-column: span 1;
        order: 2;
    }
    .mp-grid--pair .mp-card--mining {
        order: 3;
    }
    .mp-grid--pair .mp-card--referral {
        order: 4;
    }
}

/* Home user count */
/* AlNahal: Home user count (2026-11-14). The Home page heading: a users icon, "Total Users" and the padded count. */
.hu-count {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
    max-width: 100%;
}
.hu-count__icon {
    color: hsl(var(--base));
    align-self: center;
}
.hu-count__label {
    font-size: 0.7em;
    font-weight: 500;
    opacity: 0.75;
    color: hsl(var(--heading-color));
}
.hu-count__number {
    font-weight: 700;
    color: hsl(var(--base));
    font-variant-numeric: tabular-nums;
}
@media (max-width: 399.98px) {
    .hu-count__label {
        font-size: 0.6em;
    }
}

/* Profit Balance */
/* AlNahal: Profit Balance (2026-11-15, PB3, §5) */
.pb-balance-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pb-balance-amount {
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
/* AlNahal: wallet UI polish (2026-11-16, WP1) - wallet buttons: Convert = btn--base, Transfer = btn--orange (2026-11-16b); subtitles removed, so no .pb-balance-subtitle rule */
.pb-wallet-btn {
    min-height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
/* AlNahal: wallet UI polish (2026-11-16b, muted 2026-11-16c) - muted deep gold balance cards, white text */
.pb-balance-card--gold {
    background: linear-gradient(135deg, #7a5a1c 0%, #946d22 50%, #b5872a 100%) !important;
    border: 1px solid rgba(248, 190, 59, 0.35) !important;
    box-shadow: none;
}
.pb-balance-card--gold::before,
.pb-balance-card--gold::after {
    content: none !important;
}
.pb-balance-card--gold .pb-balance-label {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 600;
}
.pb-balance-card--gold .pb-balance-amount {
    color: #ffffff !important;
}
.pb-all-chip {
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
}
.pb-convert-note {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid hsl(var(--base));
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.875rem;
}
