/* ==========================================================================
   Techomes Resident — UI layer
   Loaded after style.css. Purely presentational: every class/id that the
   JavaScript (app.js, metisMenu, Bootstrap, DataTables, Select2) relies on
   is left intact and only restyled here.

   1. Tokens
   2. Base
   3. Shell — topbar, sidebar, page, footer   (all pages using .mine-sidenav)
   4. Components — buttons, cards, pills       (.rx-*)
   5. Dashboard page                          (.rx-page)
   6. Modals & forms                          (.rx-page)
   7. Tables                                  (.rx-page)
   8. Responsive & motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --rx-brand: #00923F;
    --rx-brand-600: #007F37;
    --rx-brand-700: #006B2E;
    --rx-brand-900: #07331C;
    --rx-brand-50: #EFF7F2;
    --rx-brand-100: #DCEFE3;
    --rx-accent: #40D27F;

    --rx-bg: #F6F7F4;
    --rx-surface: #FFFFFF;
    --rx-surface-2: #FAFBF9;
    --rx-ink: #101A14;
    --rx-ink-2: #3A4540;
    --rx-muted: #78827C;
    --rx-line: #E6E9E5;
    --rx-line-2: #F1F3F0;

    --rx-danger: #B8412C;
    --rx-danger-50: #FBEFEC;
    --rx-warn: #8A5A12;
    --rx-warn-50: #FBF4E4;

    --rx-radius-sm: 10px;
    --rx-radius: 14px;
    --rx-radius-lg: 20px;

    --rx-shadow-sm: 0 1px 2px rgba(16, 26, 20, .04);
    --rx-shadow: 0 1px 2px rgba(16, 26, 20, .04), 0 12px 32px -16px rgba(16, 26, 20, .12);
    --rx-shadow-lg: 0 2px 6px rgba(16, 26, 20, .04), 0 32px 64px -24px rgba(16, 26, 20, .28);
    --rx-ring: 0 0 0 4px rgba(0, 146, 63, .14);

    --rx-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rx-ease: cubic-bezier(.2, .8, .2, 1);

    --rx-topbar-h: 72px;
    --rx-sidenav-w: 256px;
}

/* 2. Base ------------------------------------------------------------------ */
body.mine-sidenav {
    font-family: var(--rx-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--rx-ink-2);
    background: var(--rx-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.mine-sidenav h1, body.mine-sidenav h2, body.mine-sidenav h3,
body.mine-sidenav h4, body.mine-sidenav h5, body.mine-sidenav h6,
body.mine-sidenav .btn, body.mine-sidenav .form-control,
body.mine-sidenav .dropdown-menu, body.mine-sidenav .table,
body.mine-sidenav .modal, body.mine-sidenav .select2-container {
    font-family: var(--rx-font);
}

.rx-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* 3. Shell ----------------------------------------------------------------- */

/* Topbar */
body.mine-sidenav .topbar {
    height: var(--rx-topbar-h);
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--rx-line);
}

body.mine-sidenav .topbar .topbar-left {
    display: flex;
    align-items: center;
    width: var(--rx-sidenav-w);
    height: var(--rx-topbar-h);
    padding: 0 24px;
    text-align: left;
    background: transparent;
    border-right: 1px solid var(--rx-line);
    box-shadow: none;
}

body.mine-sidenav .topbar .topbar-left .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
    text-decoration: none;
}

.rx-logo-mark {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.rx-logo-word {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .18em;
    color: var(--rx-ink);
}

.rx-logo-word b {
    font-weight: 700;
    color: var(--rx-brand);
}

body.mine-sidenav .navbar-custom {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    height: var(--rx-topbar-h);
    min-height: var(--rx-topbar-h);
    margin-left: var(--rx-sidenav-w);
    padding: 0 24px 0 16px;
    background: transparent;
    box-shadow: none;
}

body.mine-sidenav .navbar-custom .topbar-nav {
    display: flex;
    align-items: center;
    float: none !important;
}

body.mine-sidenav .navbar-custom .topbar-nav > li {
    display: flex;
    align-items: center;
    float: none;
}

body.mine-sidenav .navbar-custom .nav-link {
    display: flex;
    align-items: center;
    max-height: none;
    line-height: 1;
    color: var(--rx-ink-2);
}

body.mine-sidenav .navbar-custom .button-menu-mobile {
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--rx-radius-sm);
    color: var(--rx-ink-2);
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

body.mine-sidenav .navbar-custom .button-menu-mobile:hover,
body.mine-sidenav .navbar-custom .button-menu-mobile:focus-visible {
    background: var(--rx-line-2);
    color: var(--rx-ink);
    outline: none;
}

body.mine-sidenav .navbar-custom .nav-user {
    gap: 10px;
    height: 48px;
    padding: 0 12px 0 6px;
    border-radius: 999px;
    transition: background-color .2s var(--rx-ease);
}

body.mine-sidenav .navbar-custom .nav-user:hover,
body.mine-sidenav .navbar-custom .topbar-nav li.show .nav-link {
    background: var(--rx-line-2);
    color: var(--rx-ink);
}

body.mine-sidenav .nav-user img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--rx-line);
}

body.mine-sidenav .nav-user .nav-user-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-ink);
}

body.mine-sidenav .nav-user .nav-user-name .rx-icon {
    width: 16px;
    height: 16px;
    color: var(--rx-muted);
    transition: transform .2s var(--rx-ease);
}

body.mine-sidenav .show > .nav-user .nav-user-name .rx-icon {
    transform: rotate(180deg);
}

body.mine-sidenav .topbar .dropdown-menu {
    min-width: 240px;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius);
    box-shadow: var(--rx-shadow-lg);
}

.rx-menu-head {
    display: flex;
    flex-direction: column;
    padding: 10px 12px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--rx-line-2);
}

.rx-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-menu-email {
    font-size: 12.5px;
    color: var(--rx-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mine-sidenav .topbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--rx-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-ink-2);
    transition: background-color .15s var(--rx-ease), color .15s var(--rx-ease);
}

body.mine-sidenav .topbar .dropdown-item .rx-icon {
    width: 18px;
    height: 18px;
    color: var(--rx-muted);
}

body.mine-sidenav .topbar .dropdown-item:hover,
body.mine-sidenav .topbar .dropdown-item:focus {
    background: var(--rx-brand-50);
    color: var(--rx-ink);
}

body.mine-sidenav .topbar .dropdown-item:hover .rx-icon {
    color: var(--rx-brand);
}

body.mine-sidenav .topbar .dropdown-divider {
    margin: 6px 4px;
    border-top-color: var(--rx-line-2);
}

/* Page wrapper */
body.mine-sidenav .page-wrapper {
    padding-top: var(--rx-topbar-h);
    background: var(--rx-bg) !important;
}

body.mine-sidenav .page-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100vh - var(--rx-topbar-h));
    padding: 32px 32px 0;
}

/* Sidebar */
body.mine-sidenav .left-sidenav {
    min-width: var(--rx-sidenav-w);
    max-width: var(--rx-sidenav-w);
    min-height: calc(100vh - var(--rx-topbar-h));
    padding: 20px 16px;
    background: var(--rx-surface);
    border-right: 1px solid var(--rx-line);
    box-shadow: none;
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li {
    margin-top: 2px;
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li.rx-nav-label {
    margin: 4px 0 8px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--rx-muted);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: auto;
    padding: 10px 12px;
    border-radius: var(--rx-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-ink-2);
    background: transparent;
    box-shadow: none;
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a .rx-icon,
body.mine-sidenav .left-sidenav .left-sidenav-menu li > a i {
    width: 20px;
    height: 20px;
    font-size: 18px;
    opacity: 1;
    color: var(--rx-muted);
    transition: color .2s var(--rx-ease);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a:hover {
    width: auto;
    font-weight: 500;
    color: var(--rx-ink);
    background: var(--rx-line-2);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a:hover .rx-icon,
body.mine-sidenav .left-sidenav .left-sidenav-menu li > a:hover i {
    color: var(--rx-ink);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a.active,
body.mine-sidenav .left-sidenav .left-sidenav-menu li.mm-active > a {
    width: auto;
    font-weight: 600;
    color: var(--rx-brand-700);
    background: var(--rx-brand-50);
    box-shadow: none;
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a.active::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -16px;
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--rx-brand);
    transform: translateY(-50%);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a.active .rx-icon,
body.mine-sidenav .left-sidenav .left-sidenav-menu li > a.active i,
body.mine-sidenav .left-sidenav .left-sidenav-menu li > a.active:hover .rx-icon,
body.mine-sidenav .left-sidenav .left-sidenav-menu li.mm-active > a i {
    color: var(--rx-brand);
}

body.mine-sidenav .left-sidenav .left-sidenav-menu li > a:focus-visible {
    outline: none;
    box-shadow: var(--rx-ring);
}

/* Footer */
body.mine-sidenav .footer.rx-footer,
body.mine-sidenav .footer {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding: 24px 0;
    border-top: 1px solid var(--rx-line);
    font-size: 13px;
    color: var(--rx-muted);
    background: transparent;
}

body.mine-sidenav .page-content > .container-fluid {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 48px;
}

/* 4. Components ------------------------------------------------------------ */

/* Buttons */
.rx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color .2s var(--rx-ease), border-color .2s var(--rx-ease),
                color .2s var(--rx-ease), box-shadow .2s var(--rx-ease), transform .2s var(--rx-ease);
}

.rx-btn .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-btn:hover,
.rx-btn:focus {
    text-decoration: none;
}

.rx-btn:focus-visible {
    outline: none;
    box-shadow: var(--rx-ring);
}

.rx-btn:active {
    transform: translateY(1px);
}

.rx-btn[disabled],
.rx-btn.disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.rx-btn-lg {
    height: 48px;
    padding: 0 22px;
    font-size: 15px;
}

.rx-btn-block {
    width: 100%;
}

.rx-btn-primary {
    color: #fff;
    background: var(--rx-brand);
}

.rx-btn-primary:hover,
.rx-btn-primary:focus {
    color: #fff;
    background: var(--rx-brand-600);
}

.rx-btn-ghost {
    color: var(--rx-ink);
    background: var(--rx-surface);
    border-color: var(--rx-line);
}

.rx-btn-ghost:hover,
.rx-btn-ghost:focus {
    color: var(--rx-ink);
    background: var(--rx-line-2);
    border-color: var(--rx-line);
}

.rx-btn-light {
    color: var(--rx-brand-900);
    background: #fff;
}

.rx-btn-light:hover,
.rx-btn-light:focus {
    color: var(--rx-brand-900);
    background: rgba(255, 255, 255, .9);
}

.rx-btn-light .rx-icon {
    transition: transform .2s var(--rx-ease);
}

.rx-btn-light:hover .rx-icon {
    transform: translateX(3px);
}

.rx-btn-glass {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
}

.rx-btn-glass:hover,
.rx-btn-glass:focus {
    color: #fff;
    background: rgba(255, 255, 255, .2);
}

/* Pills */
.rx-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.rx-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.rx-pill-success {
    color: var(--rx-brand-700);
    background: var(--rx-brand-50);
}

.rx-pill-danger {
    color: var(--rx-danger);
    background: var(--rx-danger-50);
}

.rx-pill-warning {
    color: var(--rx-warn);
    background: var(--rx-warn-50);
}

/* Compact stat card (no action row) */
.rx-card.rx-card--compact {
    min-height: 0;
}

/* Table cell helpers */
.rx-cell-id {
    font-weight: 600;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    white-space: nowrap;
}

.rx-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rx-cell-primary {
    font-weight: 500;
    color: var(--rx-ink);
    white-space: nowrap;
}

.rx-cell-sub {
    font-size: 12.5px;
    color: var(--rx-muted);
    white-space: nowrap;
}

.rx-cell-wrap {
    display: inline-block;
    max-width: 220px;
    line-height: 1.45;
}

.rx-cell-strong {
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rx-page .rx-table-alert .alert {
    margin: 16px 24px 0;
    padding: 12px 44px 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500 !important;
    text-align: left !important;
}

.rx-empty-action {
    margin-top: 20px;
}

/* Dense tables (many columns) — tablet & desktop only; phones use the stacked layout.
   `.rx-table.rx-table--dense` outranks both the base table rules (section 7) and
   DataTables' `table.dataTable thead > tr > th.sorting` padding. */
@media (min-width: 768px) {
    .rx-page .rx-table.rx-table--dense thead th,
    .rx-page .rx-table.rx-table--dense tbody td {
        padding-left: 12px;
        padding-right: 12px;
    }

    .rx-page .rx-table.rx-table--dense thead th {
        width: auto !important; /* release DataTables' fixed column widths */
        padding-right: 22px;
        font-size: 11.5px;
        letter-spacing: .04em;
    }

    .rx-page .rx-table.rx-table--dense thead th:first-child,
    .rx-page .rx-table.rx-table--dense tbody td:first-child {
        padding-left: 24px;
    }

    .rx-page .rx-table.rx-table--dense thead th:last-child,
    .rx-page .rx-table.rx-table--dense tbody td:last-child {
        padding-right: 24px;
    }

    /* Long hash IDs stay on one line when there's room and wrap only when the table would overflow */
    .rx-page .rx-table.rx-table--dense .rx-cell-id {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 767px) {
    /* Figure-only cards: icon beside the number */
    .rx-card.rx-card--stat {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        column-gap: 16px;
    }

    .rx-card--stat .rx-card-top {
        grid-row: 1 / span 2;
        margin: 0;
    }

    .rx-card--stat .rx-card-label,
    .rx-card--stat .rx-card-value {
        grid-column: 2;
    }

    .rx-card--stat .rx-card-value {
        margin: 0;
        font-size: 24px;
    }

    .rx-page .rx-table .rx-cell-stack {
        align-items: flex-end;
        text-align: right;
    }

    .rx-page .rx-table .rx-cell-wrap {
        max-width: 60%;
        text-align: right;
    }

    .rx-page .rx-table-alert .alert {
        margin: 14px 20px 0;
    }
}

/* 5. Dashboard page -------------------------------------------------------- */
.rx-page .rx-container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

/* Page head */
.rx-page-head {
    margin-bottom: 32px;
}

.rx-eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--rx-muted);
}

.rx-page .rx-title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.022em;
    color: var(--rx-ink);
}

.rx-subtitle {
    margin: 8px 0 0;
    font-size: 15px;
    color: var(--rx-muted);
}

/* Sections */
.rx-section {
    margin-bottom: 40px;
}

.rx-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.rx-page .rx-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--rx-ink);
}

.rx-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
}

/* Stat cards */
.rx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 216px;
    padding: 24px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
    transition: box-shadow .3s var(--rx-ease), transform .3s var(--rx-ease), border-color .3s var(--rx-ease);
}

.rx-card:hover {
    border-color: transparent;
    box-shadow: var(--rx-shadow);
}

.rx-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.rx-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-card-icon .rx-icon {
    width: 22px;
    height: 22px;
}

.rx-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--rx-muted);
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

.rx-card-link .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-card-link:hover,
.rx-card-link:focus-visible {
    color: var(--rx-ink);
    background: var(--rx-line-2);
    outline: none;
}

.rx-card-label {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--rx-muted);
}

.rx-card-value {
    margin: 4px 0 0;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.025em;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-card-value small {
    font-size: .56em;
    font-weight: 500;
    letter-spacing: 0;
    color: inherit;
    opacity: .6;
}

.rx-card-hint {
    margin: 6px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--rx-muted);
}

.rx-card-title {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--rx-ink);
}

.rx-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
}

.rx-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rx-inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--rx-warn);
    background: var(--rx-warn-50);
}

.rx-inline-alert .rx-icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* Feature (wallet) card */
.rx-card--feature {
    overflow: hidden;
    color: #fff;
    border-color: transparent;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(64, 210, 127, .28) 0%, rgba(64, 210, 127, 0) 60%),
        linear-gradient(150deg, var(--rx-brand-700) 0%, var(--rx-brand-900) 100%);
    box-shadow: 0 16px 40px -20px rgba(7, 51, 28, .55);
}

.rx-card--feature:hover {
    box-shadow: 0 20px 48px -20px rgba(7, 51, 28, .65);
}

.rx-card--feature::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 36px rgba(255, 255, 255, .025);
    pointer-events: none;
}

.rx-card--feature .rx-card-icon {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.rx-card--feature .rx-card-label {
    color: rgba(255, 255, 255, .7);
}

.rx-card--feature .rx-card-value {
    color: #fff;
}

.rx-card--feature .rx-card-link {
    color: rgba(255, 255, 255, .7);
}

.rx-card--feature .rx-card-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.rx-card--feature > * {
    position: relative;
    z-index: 1;
}

/* Promo banner */
.rx-promo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 40px;
    padding: 32px 36px;
    overflow: hidden;
    border-radius: var(--rx-radius-lg);
    color: #fff;
    background:
        radial-gradient(80% 140% at 100% 0%, rgba(64, 210, 127, .35) 0%, rgba(64, 210, 127, 0) 55%),
        linear-gradient(120deg, var(--rx-brand) 0%, var(--rx-brand-700) 55%, var(--rx-brand-900) 100%);
}

.rx-promo::before {
    content: "";
    position: absolute;
    top: -120px;
    right: 18%;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    pointer-events: none;
}

.rx-promo > * {
    position: relative;
}

.rx-promo-body {
    max-width: 620px;
}

.rx-promo-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .1);
}

.rx-promo-kicker .rx-icon {
    width: 14px;
    height: 14px;
}

.rx-page .rx-promo-title {
    margin: 16px 0 8px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: #fff;
}

.rx-promo-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .78);
}

.rx-promo-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.rx-promo-services li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .88);
}

.rx-promo-services .rx-icon {
    width: 16px;
    height: 16px;
    color: var(--rx-accent);
}

.rx-promo .rx-btn {
    flex-shrink: 0;
}

/* Adverts (keeps the original carousel hooks; item width + gap stay in
   step with the auto-scroll script's 615px pause interval) */
.rx-page .advert-carousel {
    gap: 15px;
    padding: 0 0 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--rx-brand) var(--rx-brand-100);
}

/* Slim brand scrollbar — the visible way to scroll the adverts sideways */
.rx-page .advert-carousel::-webkit-scrollbar {
    height: 6px;
}

.rx-page .advert-carousel::-webkit-scrollbar-track {
    background: var(--rx-brand-100);
    border-radius: 999px;
}

.rx-page .advert-carousel::-webkit-scrollbar-thumb {
    background: var(--rx-brand);
    border-radius: 999px;
}

.rx-page .advert-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--rx-brand-700);
}

.rx-page .advert-item {
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    box-shadow: none;
    background: var(--rx-surface);
}

.rx-page .advert-item:hover {
    transform: none;
}

.rx-page .advert-item img {
    transition: transform .6s var(--rx-ease);
}

.rx-page .advert-item:hover img {
    transform: scale(1.02);
}

/* 6. Modals & forms -------------------------------------------------------- */
.rx-page .modal-backdrop.show {
    opacity: 1;
    background: rgba(16, 26, 20, .38);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.rx-page .modal-backdrop {
    background: rgba(16, 26, 20, .38);
}

.rx-page .modal .modal-dialog {
    max-width: 620px;
}

.rx-page .modal.fade .modal-dialog {
    transform: translateY(16px) scale(.985);
    transition: transform .32s var(--rx-ease);
}

.rx-page .modal.show .modal-dialog {
    transform: none;
}

.rx-page .modal-content {
    border: 0;
    border-radius: 22px;
    background-color: var(--rx-surface);
    box-shadow: var(--rx-shadow-lg);
}

.rx-page .modal-content .modal-header {
    align-items: flex-start;
    gap: 14px;
    padding: 28px 28px 8px;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background-color: transparent;
}

.rx-page .modal-content .modal-header .modal-title {
    color: var(--rx-ink);
}

.rx-page .modal-content .modal-header .rx-modal-subtitle {
    color: var(--rx-muted);
}

.rx-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-modal-icon .rx-icon {
    width: 22px;
    height: 22px;
}

.rx-modal-heading {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.rx-page .modal-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.015em;
    color: var(--rx-ink);
}

.rx-modal-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--rx-muted);
}

.rx-page .modal-header .close.rx-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: -2px -4px 0 0;
    padding: 0;
    border-radius: 50%;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
    opacity: 1;
    text-shadow: none;
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

.rx-page .modal-header .close.rx-modal-close:hover {
    color: var(--rx-ink);
    background: var(--rx-line);
    opacity: 1;
}

.rx-page .modal-header .close.rx-modal-close:focus-visible {
    outline: none;
    box-shadow: var(--rx-ring);
}

.rx-page .modal-header .close.rx-modal-close .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-page .modal-body {
    padding: 20px 28px 28px;
}

.rx-page .modal-body .row {
    margin-left: -8px;
    margin-right: -8px;
}

.rx-page .modal-body .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

.rx-page .modal-body .form-group {
    margin-bottom: 18px;
}

.rx-page .modal-body label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rx-ink-2);
}

.rx-hint-icon {
    display: inline-flex;
    color: var(--rx-muted);
    cursor: help;
}

.rx-hint-icon .rx-icon {
    width: 15px;
    height: 15px;
}

.rx-page .modal-body .form-control {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #DDE1DC;
    border-radius: 12px;
    font-size: 14.5px;
    color: var(--rx-ink);
    background-color: #fff;
    box-shadow: none;
    transition: border-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease);
}

.rx-page .modal-body .form-control::placeholder {
    color: #A3ABA6;
}

.rx-page .modal-body .form-control:hover {
    border-color: #C9CFC9;
}

.rx-page .modal-body .form-control:focus {
    border-color: var(--rx-brand);
    box-shadow: var(--rx-ring);
}

.rx-page .modal-body select.form-control {
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378827C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Select2 */
.rx-page .select2-container--default .select2-selection--single {
    height: 46px;
    border: 1px solid #DDE1DC;
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease);
}

.rx-page .select2-container--default .select2-selection--single:hover {
    border-color: #C9CFC9;
}

.rx-page .select2-container--default.select2-container--open .select2-selection--single,
.rx-page .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--rx-brand);
    box-shadow: var(--rx-ring);
    outline: none;
}

.rx-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 14px;
    padding-right: 40px;
    line-height: 44px;
    font-size: 14.5px;
    color: var(--rx-ink);
}

.rx-page .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #A3ABA6;
}

.rx-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 1px;
    right: 4px;
    width: 36px;
    height: 44px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378827C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 16px;
    transition: transform .2s var(--rx-ease);
}

.rx-page .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow {
    transform: rotate(180deg);
}

.rx-page .select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none;
}

.rx-page .select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--rx-line);
    border-radius: 12px;
    box-shadow: var(--rx-shadow-lg);
}

.rx-page .select2-container--open .select2-dropdown--below {
    margin-top: 6px;
}

.rx-page .select2-container--open .select2-dropdown--above {
    margin-top: -6px;
}

.rx-page .select2-search--dropdown {
    padding: 8px;
}

.rx-page .select2-container--default .select2-search--dropdown .select2-search__field {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--rx-line);
    border-radius: 10px;
    outline: none;
}

.rx-page .select2-results__options {
    padding: 0 6px 6px;
}

.rx-page .select2-results__option {
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--rx-ink-2);
}

.rx-page .select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: var(--rx-ink);
    background: var(--rx-brand-50);
}

.rx-page .select2-container--default .select2-results__option[aria-selected=true] {
    color: var(--rx-brand-700);
    background: transparent;
    font-weight: 500;
}

/* Submit row — also styles buttons injected by the AJAX handlers */
.rx-modal-actions,
.rx-page .modal-body #result_user_b,
.rx-page .modal-body #result_user_emer_b {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--rx-line-2);
}

.rx-page #result_user_b:empty,
.rx-page #result_user_emer_b:empty {
    display: none;
}

.rx-page .modal-body .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    background: var(--rx-brand);
    box-shadow: none;
    transition: background-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease);
}

.rx-page .modal-body .btn-primary:hover,
.rx-page .modal-body .btn-primary:focus {
    background: var(--rx-brand-600);
}

.rx-page .modal-body .btn-primary:focus-visible {
    box-shadow: var(--rx-ring);
}

.rx-page .modal-body .alert {
    margin-bottom: 20px;
    padding: 12px 44px 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500 !important;
    text-align: left !important;
}

/* 7. Tables ---------------------------------------------------------------- */
.rx-table-card {
    overflow: hidden;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-table-card .table-responsive {
    margin: 0;
}

.rx-page .rx-table {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    color: var(--rx-ink-2);
}

.rx-page .rx-table thead th {
    padding: 14px 24px;
    border-top: 0;
    border-bottom: 1px solid var(--rx-line) !important;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--rx-muted);
    background: var(--rx-surface-2);
}

.rx-page .rx-table tbody td {
    padding: 16px 24px;
    border-top: 1px solid var(--rx-line-2);
    font-size: 14px;
    vertical-align: middle;
}

.rx-page .rx-table tbody tr:first-child td {
    border-top: 0;
}

.rx-page .rx-table tbody tr {
    transition: background-color .15s var(--rx-ease);
}

.rx-page .rx-table tbody tr:hover {
    background: var(--rx-surface-2);
}

.rx-page .rx-table tbody td:first-child {
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-page table.dataTable thead .sorting::before,
.rx-page table.dataTable thead .sorting::after,
.rx-page table.dataTable thead .sorting_asc::before,
.rx-page table.dataTable thead .sorting_asc::after,
.rx-page table.dataTable thead .sorting_desc::before,
.rx-page table.dataTable thead .sorting_desc::after {
    bottom: 1.05em;
    font-size: 11px;
}

/* DataTables chrome */
.rx-page .rx-table-card .dataTables_wrapper > .row {
    margin: 0;
}

.rx-page .rx-table-card .dataTables_wrapper > .row > [class*="col-"] {
    padding: 0;
}

.rx-page .rx-table-card .dataTables_wrapper > .row:first-child {
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--rx-line);
}

.rx-page .rx-table-card .dataTables_wrapper > .row:last-child {
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid var(--rx-line);
}

.rx-page .dataTables_wrapper .dataTables_length label,
.rx-page .dataTables_wrapper .dataTables_filter label,
.rx-page .dataTables_wrapper .dataTables_info {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: var(--rx-muted);
    white-space: nowrap;
}

.rx-page .dataTables_wrapper .dataTables_length select {
    height: 34px;
    margin: 0 6px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--rx-line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--rx-ink);
}

.rx-page .dataTables_wrapper .dataTables_filter input {
    width: 220px;
    height: 36px;
    margin-left: 8px;
    padding: 0 14px;
    border: 1px solid var(--rx-line);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--rx-ink);
    background: var(--rx-surface-2);
    box-shadow: none;
    transition: border-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease), background-color .2s;
}

.rx-page .dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--rx-brand);
    background: #fff;
    box-shadow: var(--rx-ring);
    outline: none;
}

.rx-page .dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    gap: 4px;
}

.rx-page .dataTables_wrapper .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--rx-ink-2);
    background: transparent;
    box-shadow: none;
}

.rx-page .dataTables_wrapper .page-link:hover {
    color: var(--rx-ink);
    background: var(--rx-line-2);
}

.rx-page .dataTables_wrapper .page-item.active .page-link {
    color: #fff;
    background: var(--rx-brand);
}

.rx-page .dataTables_wrapper .page-item.disabled .page-link {
    color: #B8BFBA;
    background: transparent;
}

/* Empty state */
.rx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 24px;
    text-align: center;
}

.rx-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 16px;
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-empty-icon .rx-icon {
    width: 26px;
    height: 26px;
}

.rx-page .rx-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-empty-text {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--rx-muted);
}

/* 7b. Settings page -------------------------------------------------------- */
.rx-page .rx-container--narrow {
    max-width: 960px;
}

/* Profile header */
.rx-profile {
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-profile-cover {
    height: 112px;
    background:
        radial-gradient(70% 160% at 100% 0%, rgba(64, 210, 127, .35) 0%, rgba(64, 210, 127, 0) 60%),
        linear-gradient(120deg, var(--rx-brand) 0%, var(--rx-brand-700) 55%, var(--rx-brand-900) 100%);
}

.rx-profile-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    padding: 0 28px 24px;
}

.rx-profile-identity {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    min-width: 0;
}

.rx-avatar-xl {
    display: block;
    flex-shrink: 0;
    width: 104px;
    height: 104px;
    margin-top: -44px;
    border: 4px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: var(--rx-shadow);
}

.rx-profile-text {
    min-width: 0;
    padding-bottom: 4px;
}

.rx-page .rx-profile-name {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: var(--rx-ink);
}

.rx-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin: 0;
    padding: 0 0 4px;
    list-style: none;
}

.rx-profile-meta li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rx-meta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
}

.rx-meta-icon .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-meta-label {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: var(--rx-muted);
}

.rx-meta-value {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-ink);
    overflow-wrap: anywhere;
}

/* Tabs */
.rx-profile-tabs {
    padding: 0 28px;
    border-top: 1px solid var(--rx-line-2);
}

.rx-page .rx-tabs {
    display: flex;
    gap: 28px;
    margin: 0;
}

.rx-page .rx-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    padding: 16px 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-muted);
    background: transparent !important;
    box-shadow: none !important;
    transition: color .2s var(--rx-ease), border-color .2s var(--rx-ease);
}

.rx-page .rx-tabs .nav-link .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-page .rx-tabs .nav-link:hover {
    color: var(--rx-ink);
}

.rx-page .rx-tabs .nav-link.active {
    color: var(--rx-ink);
    border-bottom-color: var(--rx-brand);
}

.rx-page .rx-tabs .nav-link.active .rx-icon {
    color: var(--rx-brand);
}

.rx-page .rx-tabs .nav-link:focus-visible {
    outline: none;
    color: var(--rx-ink);
    border-bottom-color: var(--rx-brand-100);
}

/* Settings card */
.rx-settings-card {
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-settings-head {
    padding: 24px 28px;
    border-bottom: 1px solid var(--rx-line-2);
}

.rx-page .rx-settings-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--rx-ink);
}

.rx-page .rx-settings-head p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--rx-muted);
}

.rx-settings-body {
    padding: 28px;
}

.rx-settings-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px;
    border-top: 1px solid var(--rx-line-2);
    border-radius: 0 0 var(--rx-radius-lg) var(--rx-radius-lg);
    background: var(--rx-surface-2);
}

.rx-page .rx-settings-card .alert {
    margin: 0 0 24px;
    padding: 12px 44px 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500 !important;
    text-align: left !important;
}

/* Page forms */
.rx-page .rx-form .form-group {
    margin-bottom: 20px;
}

.rx-page .rx-form .rx-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rx-ink-2);
}

.rx-page .rx-form .form-control {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #DDE1DC;
    border-radius: 12px;
    font-size: 14.5px;
    color: var(--rx-ink);
    background-color: #fff;
    box-shadow: none;
    transition: border-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease);
}

.rx-page .rx-form .form-control::placeholder {
    color: #A3ABA6;
}

.rx-page .rx-form .form-control:hover {
    border-color: #C9CFC9;
}

.rx-page .rx-form .form-control:focus {
    border-color: var(--rx-brand);
    box-shadow: var(--rx-ring);
}

.rx-page .rx-form .form-control[readonly] {
    color: var(--rx-muted);
    background-color: var(--rx-surface-2);
    border-color: var(--rx-line);
    cursor: default;
}

.rx-page .rx-form .form-control[readonly]:focus {
    box-shadow: none;
}

.rx-help {
    margin: 8px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--rx-muted);
}

.rx-form-narrow {
    max-width: 520px;
}

.rx-input-wrap {
    position: relative;
}

.rx-page .rx-form .rx-input-wrap .form-control {
    padding-right: 46px;
}

.rx-input-addon {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--rx-muted);
    background: transparent;
    transform: translateY(-50%);
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

.rx-input-addon .rx-icon {
    width: 18px;
    height: 18px;
}

span.rx-input-addon {
    pointer-events: none;
}

button.rx-input-addon {
    cursor: pointer;
}

button.rx-input-addon:hover,
button.rx-input-addon:focus-visible {
    color: var(--rx-ink);
    background: var(--rx-line-2);
    outline: none;
}

/* Photo upload (Dropify) */
.rx-photo-field {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rx-line-2);
}

.rx-page .rx-form .row {
    margin-left: -10px;
    margin-right: -10px;
}

.rx-page .rx-form .row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

.rx-dropify {
    min-width: 0;
}

/* #settings_detail id beats the theme's legacy `width: 16%` rule */
#settings_detail .rx-dropify .dropify-wrapper,
.rx-page .rx-dropify .dropify-wrapper {
    width: 100%;
    margin-bottom: 0;
    height: 184px;
    border: 1.5px dashed #D5DAD4;
    border-radius: 16px;
    font-family: var(--rx-font);
    color: var(--rx-muted);
    background: var(--rx-surface-2);
    transition: border-color .2s var(--rx-ease), background-color .2s var(--rx-ease);
}

.rx-page .rx-dropify .dropify-wrapper:hover {
    border-color: var(--rx-brand);
    background: var(--rx-brand-50);
    background-image: none;
    animation: none;
}

.rx-page .rx-dropify .dropify-wrapper .dropify-message span.file-icon {
    font-size: 30px;
    color: var(--rx-brand);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-message p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--rx-ink-2);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-preview {
    padding: 0;
    border-radius: 14px;
    background: var(--rx-surface-2);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-preview .dropify-render img {
    width: 112px;
    height: 112px;
    border: 4px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--rx-shadow);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-preview .dropify-infos {
    border-radius: 14px;
    background: rgba(7, 51, 28, .72);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-preview .dropify-infos .dropify-infos-inner p {
    font-family: var(--rx-font);
}

.rx-page .rx-dropify .dropify-wrapper .dropify-clear {
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
    font-family: var(--rx-font);
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
}

.rx-page .rx-dropify .dropify-wrapper .dropify-errors-container ul li {
    font-size: 13px;
}

/* Touch devices: Dropify adds .touch-fallback and stacks photo, file info and
   Remove button instead of using the hover overlay — lay that out cleanly. */
#settings_detail .rx-dropify .dropify-wrapper.touch-fallback,
.rx-page .rx-dropify .dropify-wrapper.touch-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto !important;
    padding: 20px 16px;
    cursor: default;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview {
    order: 1;
}

/* Dropify inserts Remove before the preview in the DOM; show it underneath */
.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-clear {
    order: 2;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback:hover {
    border-color: #D5DAD4;
    background: var(--rx-surface-2);
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview {
    position: relative;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-render img {
    top: 0;
    width: 96px;
    height: 96px;
    transform: none;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos {
    position: relative;
    margin-top: 12px;
    border-radius: 0;
    background: transparent;
    opacity: 1;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos .dropify-infos-inner {
    position: relative;
    top: 0;
    margin-top: 0;
    padding: 0;
    transform: none;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos .dropify-infos-inner p {
    text-align: center;
    line-height: 1.5;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos .dropify-infos-inner p.dropify-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos .dropify-infos-inner p.dropify-filename span.file-icon {
    display: none;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-preview .dropify-infos .dropify-infos-inner p.dropify-infos-message {
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--rx-muted);
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-clear {
    position: static;
    width: fit-content;
    margin: 14px auto 0;
    padding: 7px 16px;
    border: 1px solid #EBCBC2;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--rx-danger);
    background: #fff;
    opacity: 1;
}

.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-clear:hover,
.rx-page .rx-dropify .dropify-wrapper.touch-fallback .dropify-clear:focus {
    border-color: var(--rx-danger);
    background: var(--rx-danger-50);
}

/* Danger zone */
.rx-danger-zone {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    padding: 24px 28px;
    border: 1px solid #F0DAD4;
    border-radius: var(--rx-radius-lg);
    background: #FFFBFA;
}

.rx-danger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--rx-danger);
    background: var(--rx-danger-50);
}

.rx-danger-icon .rx-icon {
    width: 22px;
    height: 22px;
}

.rx-danger-body {
    flex: 1;
    min-width: 0;
}

.rx-page .rx-danger-body h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-page .rx-danger-body p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--rx-muted);
}

.rx-btn-danger {
    color: var(--rx-danger);
    background: #fff;
    border-color: #EBCBC2;
}

.rx-btn-danger:hover,
.rx-btn-danger:focus {
    color: var(--rx-danger);
    background: var(--rx-danger-50);
    border-color: var(--rx-danger);
}

@media (max-width: 767px) {
    .rx-profile-cover {
        height: 88px;
    }

    .rx-profile-body {
        padding: 0 20px 20px;
    }

    .rx-profile-identity {
        gap: 16px;
    }

    .rx-avatar-xl {
        width: 84px;
        height: 84px;
        margin-top: -36px;
    }

    .rx-page .rx-profile-name {
        font-size: 19px;
    }

    .rx-profile-meta {
        flex-direction: column;
        width: 100%;
    }

    .rx-profile-tabs {
        padding: 0 20px;
    }

    .rx-page .rx-tabs {
        gap: 24px;
    }

    .rx-settings-head,
    .rx-settings-body {
        padding: 20px;
    }

    .rx-settings-foot {
        padding: 16px 20px;
    }

    .rx-settings-foot .rx-btn {
        width: 100%;
    }

    .rx-photo-field {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rx-danger-zone {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .rx-danger-zone .rx-btn {
        width: 100%;
    }
}

/* 7c. Support & Gate Pass -------------------------------------------------- */
.rx-btn-sm {
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.rx-btn-sm .rx-icon {
    width: 16px;
    height: 16px;
}

.rx-page .modal-body textarea.form-control {
    height: auto;
    min-height: 128px;
    padding: 12px 14px;
    line-height: 1.55;
    resize: vertical;
}

.rx-pill-neutral {
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
}

.rx-cell-clamp {
    display: -webkit-box;
    max-width: 320px;
    overflow: hidden;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rx-card--feature .rx-card-title {
    color: #fff;
}

.rx-cell-sub.rx-cell-break {
    white-space: normal;
    overflow-wrap: anywhere;
}

.rx-inline-form {
    display: inline;
    margin: 0;
}

/* Pass code chip with copy button */
.rx-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 3px 0 10px;
    border: 1px solid var(--rx-line);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    white-space: nowrap;
    color: var(--rx-ink);
    background: var(--rx-surface-2);
}

.rx-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--rx-muted);
    background: transparent;
    cursor: pointer;
    transition: background-color .15s var(--rx-ease), color .15s var(--rx-ease);
}

.rx-copy .rx-icon {
    width: 14px;
    height: 14px;
}

/* Long codes (e.g. electricity tokens): truncate inside the chip, full value on hover/copy */
.rx-code-text {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.rx-copy:hover,
.rx-copy:focus-visible {
    color: var(--rx-ink);
    background: var(--rx-line);
    outline: none;
}

.rx-copy.is-copied {
    color: var(--rx-brand);
}

/* Copy buttons carry both states; resident-ui.js toggles .is-copied */
.rx-copy-idle,
.rx-copy-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

[data-rx-copy] .rx-copy-done,
[data-rx-copy].is-copied .rx-copy-idle {
    display: none;
}

[data-rx-copy].is-copied .rx-copy-done {
    display: inline-flex;
}

.rx-btn[data-rx-copy].is-copied {
    color: var(--rx-brand-700);
    border-color: var(--rx-brand-100);
    background: var(--rx-brand-50);
}

@media (max-width: 767px) {
    .rx-page .rx-table .rx-cell-clamp {
        max-width: 62%;
        text-align: right;
    }

    .rx-page .rx-table .rx-cell-sub.rx-cell-break {
        text-align: right;
    }
}

/* 7d. View ticket ---------------------------------------------------------- */
.rx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--rx-muted);
    text-decoration: none;
    transition: color .2s var(--rx-ease);
}

.rx-back .rx-icon {
    width: 16px;
    height: 16px;
    transition: transform .2s var(--rx-ease);
}

.rx-back:hover,
.rx-back:focus-visible {
    color: var(--rx-ink);
    text-decoration: none;
    outline: none;
}

.rx-back:hover .rx-icon {
    transform: translateX(-3px);
}

.rx-page-head--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
}

.rx-page-head--split > :first-child {
    min-width: 0;
}

.rx-title-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 12px;
}

.rx-ticket-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--rx-muted);
}

.rx-page .rx-page-alert .alert {
    margin: 0 0 24px;
    padding: 12px 44px 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500 !important;
    text-align: left !important;
}

.rx-reply {
    margin-bottom: 40px;
}

.rx-reply .rx-inline-alert {
    margin: 0;
}

/* TinyMCE (modern skin) inside the reply card */
.rx-page .rx-reply .mce-tinymce {
    overflow: hidden;
    border: 1px solid #DDE1DC !important;
    border-radius: 12px;
    box-shadow: none !important;
}

.rx-page .rx-reply .mce-panel {
    border-color: var(--rx-line) !important;
    background: #fff !important;
}

.rx-page .rx-reply .mce-top-part::before {
    box-shadow: none !important;
}

/* Keep the reply box calm: the toolbar already carries every formatting action */
.rx-page .rx-reply .mce-menubar {
    display: none !important;
}

.rx-page .rx-reply .mce-toolbar-grp,
.rx-page .rx-reply .mce-menubar {
    padding: 4px !important;
    border-bottom: 1px solid var(--rx-line) !important;
    background: var(--rx-surface-2) !important;
}

.rx-page .rx-reply .mce-btn {
    border-color: transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
}

.rx-page .rx-reply .mce-btn:hover,
.rx-page .rx-reply .mce-btn.mce-active {
    background: var(--rx-line-2) !important;
}

.rx-page .rx-reply .mce-statusbar {
    border-top: 1px solid var(--rx-line) !important;
    background: var(--rx-surface-2) !important;
}

/* Conversation thread */
.rx-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rx-message {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
}

.rx-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
}

.rx-message-avatar .rx-icon {
    width: 20px;
    height: 20px;
}

.rx-message--staff .rx-message-avatar {
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-message-card {
    min-width: 0;
    padding: 16px 20px;
    border: 1px solid var(--rx-line);
    border-radius: 4px 16px 16px 16px;
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-message--resident .rx-message-card {
    background: var(--rx-surface-2);
}

.rx-message-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 10px;
}

.rx-message-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-message-time {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--rx-muted);
    white-space: nowrap;
}

.rx-message-body {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--rx-ink-2);
    overflow-wrap: anywhere;
}

.rx-message-body p {
    margin: 0 0 8px;
}

.rx-message-body > :last-child {
    margin-bottom: 0;
}

.rx-message-body img {
    max-width: 100%;
    height: auto;
}

.rx-thread-empty {
    padding: 32px 24px;
    border: 1px dashed var(--rx-line);
    border-radius: var(--rx-radius-lg);
    text-align: center;
    font-size: 14px;
    color: var(--rx-muted);
}

@media (max-width: 767px) {
    .rx-page-head--split .rx-btn {
        width: 100%;
    }

    .rx-page-head--split form {
        width: 100%;
    }

    .rx-message {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 10px;
    }

    .rx-message-avatar {
        width: 32px;
        height: 32px;
    }

    .rx-message-avatar .rx-icon {
        width: 16px;
        height: 16px;
    }

    .rx-message-card {
        padding: 14px 16px;
    }

    .rx-message-time {
        width: 100%;
        margin-left: 0;
    }
}

/* 7e. Invoices, receipt & payment hand-off --------------------------------- */
.rx-card--feature .rx-card-hint {
    color: rgba(255, 255, 255, .7);
}

/* Tabs on top of a table card */
.rx-card-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--rx-line);
}

.rx-page .rx-card-tabs .rx-tabs .nav-link {
    padding: 18px 0 16px;
}

.rx-page .rx-tabs .nav-link .rx-count {
    margin-left: 2px;
}

.rx-page .rx-tabs .nav-link.active .rx-count {
    color: var(--rx-brand-700);
    background: var(--rx-brand-50);
}

.rx-table-card .tab-content > .tab-pane {
    padding: 0;
}

/* DataTables export buttons (Past Payments) */
.rx-page .dt-buttons.btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rx-page .dt-buttons .btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--rx-line) !important;
    border-radius: 999px !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--rx-ink-2);
    background: #fff;
    box-shadow: none;
}

.rx-page .dt-buttons .btn:hover,
.rx-page .dt-buttons .btn:focus {
    color: var(--rx-ink);
    background: var(--rx-line-2);
    box-shadow: none;
}

.rx-page .dt-button-collection {
    padding: 6px;
    border: 1px solid var(--rx-line);
    border-radius: 12px;
    box-shadow: var(--rx-shadow-lg);
}

.rx-page .dt-button-collection .dt-button {
    border-radius: 8px;
    font-size: 13.5px;
}

.rx-page .dt-button-collection .dt-button.active {
    color: var(--rx-brand-700);
    background: var(--rx-brand-50);
}

/* Payment modal */
.rx-amount-box {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--rx-line);
    border-radius: 16px;
    text-align: center;
    background: var(--rx-surface-2);
}

/* .modal-body prefix out-ranks the theme's `.modal-content .modal-body p { color: #8997bd }` */
.rx-page .modal-body .rx-amount-label {
    margin: 0;
    font-size: 13px;
    color: var(--rx-muted);
}

.rx-page .modal-body .rx-amount-value {
    margin: 4px 0 0;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -.025em;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-detail-list {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.rx-detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--rx-line-2);
    font-size: 14px;
}

.rx-detail-list li:first-child {
    border-top: 0;
}

.rx-detail-list li > span:first-child {
    color: var(--rx-muted);
}

.rx-detail-list li > span:last-child {
    font-weight: 500;
    text-align: right;
    color: var(--rx-ink);
}

.rx-pay-options {
    display: grid;
    gap: 10px;
}

.rx-pay-options .rx-btn {
    width: 100%;
}

.rx-cell-truncate {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.rx-page .rx-table--dense .rx-cell-truncate {
    max-width: 120px;
}

/* Let long text (e.g. bill names) wrap instead of widening the column */
.rx-cell-primary.rx-cell-normal {
    display: inline-block;
    min-width: 110px;
    white-space: normal;
    line-height: 1.45;
}

.rx-page .rx-secure-note,
.rx-page .modal-body .rx-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--rx-muted);
}

.rx-secure-note .rx-icon {
    width: 14px;
    height: 14px;
    color: var(--rx-brand);
}

/* Receipt */
.rx-page .rx-container--receipt {
    max-width: 760px;
}

.rx-receipt {
    overflow: hidden;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-receipt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px 32px;
    padding: 28px 32px;
    border-bottom: 1px solid var(--rx-line-2);
}

.rx-receipt-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.rx-receipt-contact {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rx-muted);
}

.rx-receipt-contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.rx-receipt-contact .rx-icon {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--rx-ink-2);
}

.rx-receipt-contact a {
    color: inherit;
}

.rx-receipt-hero {
    padding: 32px;
    border-bottom: 1px solid var(--rx-line-2);
    text-align: center;
    background: radial-gradient(60% 120% at 50% 0%, var(--rx-brand-50) 0%, rgba(239, 247, 242, 0) 70%);
}

.rx-receipt-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-receipt-check .rx-icon {
    width: 28px;
    height: 28px;
}

.rx-page .rx-receipt-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--rx-muted);
}

.rx-page .rx-receipt-amount {
    margin: 6px 0 12px;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.03em;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-receipt-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding: 24px 32px;
    border-bottom: 1px solid var(--rx-line-2);
}

.rx-receipt-meta dt {
    margin-bottom: 4px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rx-muted);
}

.rx-receipt-meta dd {
    margin: 0;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--rx-ink);
    overflow-wrap: anywhere;
}

.rx-receipt-lines {
    padding: 8px 32px 24px;
}

.rx-receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.rx-receipt-table th {
    padding: 14px 0;
    border-bottom: 1px solid var(--rx-line);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--rx-muted);
}

.rx-receipt-table td {
    padding: 16px 0;
    border-bottom: 1px solid var(--rx-line-2);
    font-size: 14.5px;
    color: var(--rx-ink-2);
}

.rx-receipt-table .rx-right {
    text-align: right;
}

.rx-receipt-table tbody td:first-child {
    font-weight: 500;
    color: var(--rx-ink);
}

.rx-receipt-table tfoot td {
    padding: 12px 0;
    border-bottom: 0;
}

.rx-receipt-table tfoot td:first-child {
    text-align: right;
    color: var(--rx-muted);
}

.rx-receipt-table tfoot .rx-receipt-grand td {
    padding-top: 14px;
    border-top: 1px solid var(--rx-line);
    font-size: 16px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-receipt-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
    border-top: 1px solid var(--rx-line-2);
    background: var(--rx-surface-2);
}

.rx-page .rx-receipt-foot p {
    margin: 0;
    font-size: 13px;
    color: var(--rx-muted);
}

.rx-receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media print {
    body.rx-print-page .topbar,
    body.rx-print-page .left-sidenav,
    body.rx-print-page .footer,
    body.rx-print-page .rx-back,
    body.rx-print-page .rx-page-head,
    body.rx-print-page .rx-receipt-actions {
        display: none !important;
    }

    body.rx-print-page,
    body.rx-print-page .page-wrapper {
        padding-top: 0 !important;
        background: #fff !important;
    }

    body.rx-print-page .page-content {
        padding: 0 !important;
    }

    body.rx-print-page .rx-receipt {
        border: 0;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Payment hand-off (ALATPay) */
body.rx-handoff-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.rx-handoff {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.rx-handoff .rx-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.rx-spinner {
    width: 44px;
    height: 44px;
    margin: 32px auto 24px;
    border: 3px solid var(--rx-brand-100);
    border-top-color: var(--rx-brand);
    border-radius: 50%;
    animation: rx-spin .9s linear infinite;
}

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

.rx-page .rx-handoff h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--rx-ink);
}

.rx-page .rx-handoff p {
    margin: 8px 0 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--rx-muted);
}

.rx-page .rx-handoff .rx-secure-note {
    margin-top: 20px;
}

.rx-handoff .rx-btn {
    margin-top: 28px;
}

/* "Confirming your payment" overlay — #loader, shown by saveForm() while the payment is recorded */
.rx-handoff-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #fff;
}

.rx-handoff-loader .rx-spinner {
    margin-top: 0;
}

@media (max-width: 767px) {
    .rx-card--stat .rx-card-hint {
        grid-column: 2;
        margin-top: 2px;
    }

    .rx-card-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }

    .rx-page .rx-card-tabs .rx-tabs {
        flex-wrap: nowrap;
        gap: 20px;
    }

    .rx-page .rx-card-tabs .rx-tabs .nav-link {
        font-size: 13.5px;
        white-space: nowrap;
    }

    .rx-page .rx-card-tabs .rx-tabs .nav-link > .rx-icon {
        display: none;
    }

    .rx-page .rx-table .rx-cell-truncate {
        max-width: 60%;
    }

    /* Receipt & hand-off keep the full wordmark (the header hides it on phones) */
    .rx-receipt-brand .rx-logo-word,
    .rx-handoff .rx-logo-word {
        display: inline;
    }

    .rx-receipt-head {
        flex-direction: column;
    }

    .rx-receipt-head,
    .rx-receipt-hero,
    .rx-receipt-meta,
    .rx-receipt-lines,
    .rx-receipt-foot {
        padding-left: 20px;
        padding-right: 20px;
    }

    .rx-receipt-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rx-page .rx-receipt-amount {
        font-size: 30px;
    }

    .rx-receipt-actions,
    .rx-receipt-actions .rx-btn {
        width: 100%;
    }
}

/* 7f. Wallet ---------------------------------------------------------------- */
.rx-account {
    padding: 20px;
    border: 1px solid var(--rx-line);
    border-radius: 16px;
    background: var(--rx-surface-2);
}

.rx-page .rx-account-bank,
.rx-page .modal-body .rx-account-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--rx-muted);
}

.rx-account-bank .rx-icon {
    width: 16px;
    height: 16px;
    color: var(--rx-brand);
}

.rx-account-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 8px;
}

.rx-account-number {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-card .rx-account {
    margin-top: 4px;
    padding: 14px 16px;
}

.rx-card .rx-account-number {
    font-size: 20px;
}

.rx-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
}

.rx-note .rx-icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--rx-muted);
}

.rx-note--warn {
    color: var(--rx-warn);
    background: var(--rx-warn-50);
}

.rx-note--warn .rx-icon {
    color: var(--rx-warn);
}

.rx-loader {
    padding: 28px 8px 32px;
    text-align: center;
}

.rx-loader .rx-spinner {
    margin: 0 auto 18px;
}

.rx-page .modal-body .rx-loader p {
    margin: 0 auto;
    max-width: 360px;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--rx-ink-2);
}

/* Single, full-width primary action (e.g. set up bank transfer) */
.rx-modal-actions.rx-modal-actions--block .rx-btn {
    width: 100%;
}

.rx-page .modal-body .rx-help-center {
    margin: 12px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--rx-muted);
}

@media (max-width: 767px) {
    .rx-account-number {
        font-size: 20px;
    }
}

/* 7g. Marketplace, cart & checkout ----------------------------------------- */

/* Page forms: chevron on plain selects outside modals */
.rx-page .rx-form select.form-control {
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378827C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.rx-btn .rx-count {
    min-width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0 6px;
    font-size: 11.5px;
}

.rx-btn-ghost .rx-count {
    color: var(--rx-ink);
    background: var(--rx-line-2);
}

/* Filter toolbar */
.rx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
    padding: 16px 20px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-toolbar form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0;
}

.rx-page .rx-toolbar .form-group {
    min-width: 260px;
    margin: 0;
}

.rx-toolbar .rx-btn {
    height: 46px;
}

.rx-toolbar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    font-size: 13.5px;
    color: var(--rx-muted);
}

.rx-toolbar-meta a {
    font-weight: 500;
    color: var(--rx-brand-700);
}

/* Product grid */
.rx-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rx-product {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
    transition: box-shadow .3s var(--rx-ease), border-color .3s var(--rx-ease);
}

.rx-product:hover {
    border-color: transparent;
    box-shadow: var(--rx-shadow);
}

.rx-product-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--rx-surface-2);
}

.rx-product-media img {
    width: 100%;
    height: 100%;
    padding: 18px;
    object-fit: contain;
    transition: transform .6s var(--rx-ease);
}

.rx-product:hover .rx-product-media img {
    transform: scale(1.04);
}

.rx-product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--rx-line-2);
}

.rx-page .rx-product-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--rx-ink);
    text-decoration: none;
}

.rx-page .rx-product-title:hover {
    color: var(--rx-brand-700);
}

.rx-product-sub {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--rx-muted);
}

.rx-product form {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.rx-page .rx-product .form-control,
.rx-page .rx-product .rx-btn {
    height: 42px;
    font-size: 14px;
}

.rx-buy-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
}

.rx-page .rx-form .rx-qty {
    padding: 0 8px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Product detail */
.rx-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
}

.rx-detail-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 440px;
    padding: 40px;
    background: var(--rx-surface-2);
}

.rx-detail-media img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.rx-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.rx-page .rx-detail-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.022em;
    color: var(--rx-ink);
}

.rx-detail-info .rx-subtitle {
    margin-bottom: 28px;
}

.rx-detail-info .rx-buy-row {
    grid-template-columns: 96px minmax(0, 1fr);
}

.rx-feature-list {
    display: grid;
    gap: 12px;
    margin: 28px 0 0;
    padding: 24px 0 0;
    border-top: 1px solid var(--rx-line-2);
    list-style: none;
    font-size: 14px;
    color: var(--rx-ink-2);
}

.rx-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rx-feature-list .rx-icon {
    width: 18px;
    height: 18px;
    color: var(--rx-brand);
}

/* Cart & checkout layouts */
.rx-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 24px;
    margin-bottom: 40px;
}

.rx-checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
    gap: 24px;
    margin-bottom: 40px;
}

.rx-checkout-summary {
    order: 2;
}

.rx-checkout-main {
    order: 1;
}

@media (min-width: 1025px) {
    .rx-summary-sticky {
        position: sticky;
        top: calc(var(--rx-topbar-h) + 24px);
    }
}

.rx-line-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rx-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-top: 1px solid var(--rx-line-2);
}

.rx-line:first-child {
    border-top: 0;
}

.rx-line-thumb {
    width: 64px;
    height: 64px;
    padding: 6px;
    border: 1px solid var(--rx-line-2);
    border-radius: 12px;
    object-fit: contain;
    background: var(--rx-surface-2);
}

.rx-page .rx-line-name {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--rx-ink);
    text-decoration: none;
}

.rx-page a.rx-line-name:hover {
    color: var(--rx-brand-700);
}

.rx-line-meta {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    color: var(--rx-muted);
    font-variant-numeric: tabular-nums;
}

.rx-line-total {
    font-weight: 600;
    white-space: nowrap;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-line form {
    margin: 0;
}

.rx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--rx-muted);
    background: transparent;
    cursor: pointer;
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease);
}

.rx-icon-btn .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-icon-btn:hover,
.rx-icon-btn:focus-visible {
    color: var(--rx-danger);
    background: var(--rx-danger-50);
    outline: none;
}

.rx-line--compact {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 0;
}

.rx-line--compact .rx-line-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.rx-summary-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rx-summary-rows li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--rx-ink-2);
    font-variant-numeric: tabular-nums;
}

.rx-summary-rows li > :first-child {
    color: var(--rx-muted);
}

.rx-summary-rows .rx-summary-total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--rx-line);
    font-size: 17px;
    font-weight: 600;
    color: var(--rx-ink);
}

.rx-summary-rows .rx-summary-total > :first-child {
    color: var(--rx-ink);
}

.rx-summary-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.rx-summary-actions .rx-btn {
    width: 100%;
}

.rx-checkout-pay {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 1024px) {
    .rx-cart-layout,
    .rx-checkout-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-checkout-summary,
    .rx-checkout-main {
        order: 0;
    }
}

@media (max-width: 767px) {
    .rx-toolbar {
        padding: 16px;
    }

    .rx-toolbar form,
    .rx-page .rx-toolbar .form-group {
        width: 100%;
        min-width: 0;
    }

    .rx-toolbar .rx-btn {
        width: 100%;
    }

    .rx-toolbar-meta {
        padding-bottom: 0;
    }

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

    .rx-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-detail-media {
        min-height: 260px;
        padding: 24px;
    }

    .rx-detail-info {
        padding: 24px 20px;
    }

    .rx-page .rx-detail-title {
        font-size: 22px;
    }

    .rx-line {
        grid-template-columns: 56px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 16px 20px;
    }

    .rx-line-thumb {
        width: 56px;
        height: 56px;
    }

    .rx-line > .rx-line-total {
        grid-column: 2;
        grid-row: 2;
    }

    .rx-line > form {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .rx-line--compact {
        padding: 12px 0;
    }

    .rx-line--compact > .rx-line-total {
        grid-column: 3;
        grid-row: 1;
    }

    .rx-checkout-pay .rx-btn {
        width: 100%;
    }
}

/* 7h. Bills & utilities ------------------------------------------------------ */

/* Amount panel outside modals (confirm pages) */
.rx-page .rx-amount-label {
    margin: 0;
    font-size: 13px;
    color: var(--rx-muted);
}

.rx-page .rx-amount-value {
    margin: 4px 0 0;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -.025em;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-page .rx-container--confirm {
    max-width: 720px;
}

.rx-page .rx-note--danger {
    color: var(--rx-danger);
    background: var(--rx-danger-50);
}

.rx-page .rx-note--danger .rx-icon {
    color: var(--rx-danger);
}

/* Service hub */
.rx-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rx-page a.rx-service {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius-lg);
    color: inherit;
    text-decoration: none;
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-sm);
    transition: box-shadow .3s var(--rx-ease), border-color .3s var(--rx-ease);
}

.rx-page a.rx-service:hover,
.rx-page a.rx-service:focus-visible {
    border-color: transparent;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--rx-shadow);
    outline: none;
}

.rx-service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--rx-brand);
    background: var(--rx-brand-50);
}

.rx-service-icon .rx-icon {
    width: 24px;
    height: 24px;
}

.rx-service-name {
    margin: 20px 0 4px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--rx-ink);
}

.rx-service-hint {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--rx-muted);
}

.rx-service-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--rx-line-2);
}

.rx-page a.rx-service .rx-service-hint {
    margin-bottom: 24px;
}

.rx-service-foot > span:first-child {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.rx-service-total-label {
    font-size: 12px;
    color: var(--rx-muted);
}

.rx-service-total {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 600;
    color: var(--rx-ink);
    font-variant-numeric: tabular-nums;
}

.rx-service-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--rx-ink-2);
    background: var(--rx-line-2);
    transition: background-color .2s var(--rx-ease), color .2s var(--rx-ease), transform .2s var(--rx-ease);
}

.rx-service-go .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-page a.rx-service:hover .rx-service-go {
    color: #fff;
    background: var(--rx-brand);
    transform: translateX(2px);
}

/* Service forms */
.rx-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
    gap: 0 16px;
}

.rx-page .rx-form .rx-form-grid .form-group {
    margin-bottom: 20px;
}

.rx-inline-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* Hide the footer until the data plan script has injected its Pay button */
.rx-settings-foot:has(#result_user_b:empty) {
    display: none;
}

/* Verification result (TV / electricity) */
.rx-verify-panel {
    padding: 24px 28px 28px;
    border-top: 1px solid var(--rx-line-2);
}

/* Collapse the panel while nothing is loading and there is no result yet */
.rx-verify-panel:not(:has(.rx-verify-result:not(:empty))):has(#loader[style*="none"]) {
    display: none;
}

.rx-page .rx-verify-panel .rx-loader {
    padding: 8px 0 12px;
}

.rx-page .rx-verify-title {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rx-muted);
}

.rx-verify-result .rx-detail-list {
    max-width: 520px;
    margin-bottom: 20px;
}

.rx-verify-result form {
    margin: 0;
}

.rx-verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rx-verify-result .rx-note {
    max-width: 520px;
    margin-top: 0;
}

/* Review card on confirm pages */
.rx-review .rx-amount-box {
    margin-bottom: 8px;
}

.rx-review .rx-detail-list {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .rx-service-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .rx-page a.rx-service {
        padding: 20px;
    }

    .rx-verify-panel {
        padding: 20px;
    }

    .rx-verify-actions .rx-btn,
    .rx-inline-actions,
    .rx-inline-actions .rx-btn {
        width: 100%;
    }
}

/* 7i. Vending ---------------------------------------------------------------- */

/* Pay-now options: several separate forms stacked as one list of full-width buttons */
.rx-pay-stack {
    display: grid;
    gap: 10px;
}

.rx-pay-stack form {
    display: grid;
    gap: 10px;
    margin: 0;
}

.rx-pay-stack .rx-btn {
    width: 100%;
}

/* Two-column receipt tables keep the total label on the left */
.rx-receipt-table tfoot td.rx-left {
    text-align: left;
}

/* Token on the receipt */
.rx-receipt-token {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.rx-receipt-token .rx-code {
    height: 38px;
    padding: 0 6px 0 14px;
    font-size: 15px;
    letter-spacing: .12em;
}

.rx-receipt-token .rx-code-text {
    max-width: none;
}

@media print {
    body.rx-print-page .rx-receipt-token .rx-copy {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .rx-receipt-token .rx-code {
        font-size: 13px;
        letter-spacing: .06em;
    }
}

/* Status messages from server/definitions.php — calm tints instead of the theme's solid colours */
.rx-page .alert {
    position: relative;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    font-size: 13.5px;
    font-weight: 500 !important;
    line-height: 1.5;
    text-align: left !important;
}

.rx-page .alert.alert-danger {
    color: var(--rx-danger);
    background: var(--rx-danger-50);
}

.rx-page .alert.alert-success {
    color: var(--rx-brand-700);
    background: var(--rx-brand-50);
}

.rx-page .alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.rx-page .alert .close {
    top: 50%;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    color: inherit;
    opacity: .55;
    text-shadow: none;
    transform: translateY(-50%);
    transition: opacity .2s var(--rx-ease), background-color .2s var(--rx-ease);
}

.rx-page .alert .close:hover {
    opacity: 1;
    background: rgba(16, 26, 20, .06);
}

/* 7j. Sign-in & password pages (body.rx-auth) -------------------------------- */
body.rx-auth {
    min-height: 100vh;
    font-family: var(--rx-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--rx-ink-2);
    background: var(--rx-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.rx-auth.accountbg {
    height: auto;
    background-image: none;
}

body.rx-auth h1,
body.rx-auth h2,
body.rx-auth .btn,
body.rx-auth .form-control {
    font-family: var(--rx-font);
}

.rx-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* Brand panel */
.rx-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    overflow: hidden;
    padding: 40px 48px 48px;
    color: #fff;
    background: var(--rx-brand-900) url("../images/use/banner1.png") center / cover no-repeat;
}

.rx-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(90% 60% at 0% 0%, rgba(64, 210, 127, .28) 0%, rgba(64, 210, 127, 0) 60%),
        linear-gradient(165deg, rgba(0, 146, 63, .62) 0%, rgba(6, 58, 32, .86) 55%, rgba(4, 28, 16, .94) 100%);
}

.rx-auth-brand > * {
    position: relative;
}

.rx-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.rx-auth-logo:hover {
    text-decoration: none;
}

.rx-auth-brand .rx-logo-mark {
    width: 42px;
    height: 42px;
    padding: 5px;
    border-radius: 12px;
    background: #fff;
}

.rx-auth-brand .rx-logo-word {
    font-size: 15px;
    color: #fff;
}

.rx-auth-brand .rx-logo-word b {
    color: var(--rx-accent);
}

.rx-auth-quote {
    max-width: 460px;
}

.rx-auth .rx-auth-quote h2 {
    margin: 0 0 14px;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.025em;
    color: #fff;
}

.rx-auth-quote p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .8);
}

.rx-auth-points {
    display: grid;
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.rx-auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, .92);
}

.rx-auth-points .rx-icon {
    width: 32px;
    height: 32px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    color: var(--rx-accent);
    background: rgba(255, 255, 255, .08);
}

/* Form panel */
.rx-auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 32px;
    background: var(--rx-surface);
}

.rx-auth-card {
    width: 100%;
    max-width: 400px;
    margin: auto 0;
}

.rx-auth-mobile-logo {
    display: none;
    margin-bottom: 36px;
}

.rx-auth .rx-auth-title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.022em;
    color: var(--rx-ink);
}

.rx-auth-sub {
    margin: 10px 0 32px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--rx-muted);
}

.rx-auth .rx-form .form-group {
    margin-bottom: 20px;
}

.rx-auth .rx-form .form-control {
    height: 50px;
}

.rx-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.rx-page .rx-form .rx-label-row .rx-label {
    margin: 0;
}

.rx-auth-link,
.rx-auth .rx-auth-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--rx-brand-700);
    text-decoration: none;
}

.rx-auth-link:hover,
.rx-auth .rx-auth-link:hover {
    color: var(--rx-brand);
    text-decoration: underline;
}

.rx-input-lead {
    position: absolute;
    top: 50%;
    left: 15px;
    display: inline-flex;
    color: var(--rx-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.rx-input-lead .rx-icon {
    width: 18px;
    height: 18px;
}

.rx-page .rx-form .rx-input-wrap--lead .form-control {
    padding-left: 44px;
}

.rx-auth .rx-auth-submit {
    margin-top: 8px;
}

.rx-auth .alert {
    margin: 0 0 24px;
    padding: 12px 44px 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500 !important;
    text-align: left !important;
}

.rx-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 36px 0 18px;
    font-size: 12.5px;
    color: var(--rx-muted);
}

.rx-auth-divider::before,
.rx-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rx-line);
}

.rx-auth-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.rx-auth-badges a {
    display: inline-flex;
    border-radius: 10px;
    transition: opacity .2s var(--rx-ease), transform .2s var(--rx-ease);
}

.rx-auth-badges a:hover {
    opacity: .85;
    transform: translateY(-1px);
}

.rx-auth-badges img {
    width: auto;
    height: 42px;
}

.rx-auth-alt {
    margin: 28px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--rx-muted);
}

.rx-auth-foot {
    margin: 32px 0 0;
    font-size: 12.5px;
    color: var(--rx-muted);
}

/* Password show/hide (resident-ui.js toggles .is-revealed) */
[data-rx-password] .rx-reveal-hide,
[data-rx-password].is-revealed .rx-reveal-show {
    display: none;
}

[data-rx-password] .rx-reveal-show,
[data-rx-password].is-revealed .rx-reveal-hide {
    display: inline-flex;
}

@media (max-width: 1024px) {
    .rx-auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-auth-brand {
        display: none;
    }

    .rx-auth-mobile-logo {
        display: inline-flex;
    }

    .rx-auth-mobile-logo .rx-logo-word {
        display: inline;
    }

    .rx-auth-panel {
        min-height: 100vh;
        background:
            radial-gradient(120% 50% at 50% 0%, var(--rx-brand-50) 0%, rgba(239, 247, 242, 0) 70%),
            var(--rx-surface);
    }
}

@media (max-width: 480px) {
    .rx-auth-panel {
        padding: 36px 20px 24px;
    }

    .rx-auth .rx-auth-title {
        font-size: 26px;
    }

    .rx-auth-sub {
        margin-bottom: 28px;
    }

    .rx-auth-badges img {
        height: 38px;
    }
}

/* 8. Responsive & motion --------------------------------------------------- */
@media (min-width: 1025px) {
    body.mine-sidenav .left-sidenav {
        position: sticky;
        top: var(--rx-topbar-h);
        align-self: flex-start;
        height: calc(100vh - var(--rx-topbar-h));
        overflow-y: auto;
    }
}

@media (max-width: 1024px) {
    body.mine-sidenav .topbar .topbar-left {
        width: auto;
        padding: 0 8px 0 20px;
        border-right: 0;
    }

    body.mine-sidenav .topbar .navbar-custom {
        margin-left: 0;
        padding: 0 16px 0 4px;
    }

    body.mine-sidenav .left-sidenav {
        top: var(--rx-topbar-h);
        z-index: 998;
        box-shadow: var(--rx-shadow-lg);
        animation: rx-slide-in .28s var(--rx-ease);
    }

    body.mine-sidenav .page-content {
        padding: 28px 24px 0;
    }
}

@media (max-width: 767px) {
    body.mine-sidenav .nav-user .nav-user-name.hidden-sm {
        display: none;
    }

    body.mine-sidenav .navbar-custom .nav-user {
        padding: 0 6px;
    }

    .rx-logo-word {
        display: none;
    }

    body.mine-sidenav .page-content {
        padding: 24px 16px 0;
    }

    body.mine-sidenav .footer {
        justify-content: center;
    }

    .rx-page-head {
        margin-bottom: 24px;
    }

    .rx-page .rx-title {
        font-size: 24px;
    }

    .rx-subtitle {
        font-size: 14px;
    }

    .rx-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 32px;
    }

    .rx-card {
        min-height: 0;
        padding: 20px;
    }

    .rx-card-value {
        font-size: 28px;
    }

    .rx-section {
        margin-bottom: 32px;
    }

    .rx-promo {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        margin-bottom: 32px;
        padding: 24px;
    }

    .rx-page .rx-promo-title {
        font-size: 20px;
    }

    .rx-promo .rx-btn {
        width: 100%;
    }

    .rx-page .modal .modal-dialog {
        margin: 12px;
    }

    .rx-page .modal-header {
        padding: 22px 20px 4px;
    }

    .rx-page .modal-body {
        padding: 16px 20px 22px;
    }

    .rx-modal-actions .rx-btn,
    .rx-page #result_user_b .btn,
    .rx-page #result_user_emer_b .btn {
        width: 100%;
    }

    /* Units table becomes a stacked list */
    .rx-page .rx-table thead {
        display: none;
    }

    .rx-page .rx-table,
    .rx-page .rx-table tbody,
    .rx-page .rx-table tr,
    .rx-page .rx-table td {
        display: block;
        width: 100% !important;
    }

    .rx-page .rx-table tbody tr {
        padding: 12px 20px;
        border-top: 1px solid var(--rx-line);
    }

    .rx-page .rx-table tbody tr:first-child {
        border-top: 0;
    }

    .rx-page .rx-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 0;
        border: 0;
        text-align: right;
    }

    .rx-page .rx-table tbody td::before {
        content: attr(data-label);
        font-size: 13px;
        font-weight: 500;
        color: var(--rx-muted);
        text-align: left;
    }

    .rx-page .rx-table tbody td.dataTables_empty {
        justify-content: center;
    }

    .rx-page .rx-table tbody td.dataTables_empty::before {
        content: none;
    }

    .rx-page .rx-table-card .dataTables_wrapper > .row:first-child,
    .rx-page .rx-table-card .dataTables_wrapper > .row:last-child {
        gap: 12px;
        padding: 14px 20px;
    }

    .rx-page .dataTables_wrapper .dataTables_length,
    .rx-page .dataTables_wrapper .dataTables_filter,
    .rx-page .dataTables_wrapper .dataTables_info,
    .rx-page .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
    }

    .rx-page .dataTables_wrapper .dataTables_filter label {
        display: flex;
        align-items: center;
    }

    .rx-page .dataTables_wrapper .dataTables_filter input {
        flex: 1;
        width: auto;
    }

    .rx-page .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: flex-start !important;
    }
}

@keyframes rx-slide-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.mine-sidenav *,
    body.mine-sidenav *::before,
    body.mine-sidenav *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
