/*
 * HARPAL SEWA 3.25 — the "HX" layer: one premium look on desktop, a native-app experience on phones.
 * Loaded after app.css (website, member area, business portal, seller centre) and after admin.css (admin panel),
 * so it refines what is there without changing the page markup. (c) JHAPATECHNICAL
 *
 *  1. Tokens            5. Phones: lists as cards, filters, sheets, forms, touch
 *  2. Desktop polish    6. Admin panel on phones (app bar, tab bar, sheets)
 *  3. Page transitions  7. My Harpal (member home) and the admin dashboard
 *  4. Phones: app shell 8. Reduced motion
 */

/* ============================================================ 1. Tokens */
:root {
    --hx-brand: var(--jm-primary, #008fcc);
    --hx-brand-2: var(--jm-secondary, #04a2e0);
    --hx-brand-ink: var(--jm-primary-text, #0072a3);
    --hx-ink: #0f1b2d;
    --hx-ink-2: #334155;
    --hx-muted: #64748b;
    --hx-line: #e6ecf3;
    --hx-line-2: #eef2f7;
    --hx-page: #f4f7fb;
    --hx-card: #ffffff;
    --hx-tint: #eef7fc;
    --hx-r: 16px;
    --hx-r-sm: 12px;
    --hx-r-lg: 22px;
    --hx-sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
    --hx-sh-2: 0 6px 18px -6px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
    --hx-sh-3: 0 22px 48px -16px rgba(16, 24, 40, .22);
    --hx-ease: cubic-bezier(.2, .8, .2, 1);
    --hx-safe-b: env(safe-area-inset-bottom, 0px);
    --hx-tabbar-h: 64px;
}

/* ============================================================ 2. Desktop polish (every screen size) */

/* Tables: calm headers, clear rows, a soft hover. */
.table > thead > tr > th {
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hx-muted);
    background: #f8fafc; border-bottom: 1px solid var(--hx-line); white-space: nowrap; vertical-align: middle;
}
.table > tbody > tr > td { border-color: var(--hx-line-2); vertical-align: middle; }
.table > tbody > tr { transition: background-color .15s ease; }
@media (hover: hover) { .table > tbody > tr:hover > td { background-color: #f9fbfe; } }
.table > tbody > tr:last-child > td { border-bottom-width: 0; }

/* Pagination as soft pills. */
.pagination { gap: .3rem; flex-wrap: wrap; }
.pagination .page-link { border: 1px solid var(--hx-line); border-radius: 10px !important; min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 .7rem; color: var(--hx-ink-2); font-weight: 600; font-size: .86rem; background: #fff; box-shadow: var(--hx-sh-1); }
.pagination .page-item.active .page-link { background: var(--hx-brand); border-color: var(--hx-brand); color: #fff; box-shadow: 0 6px 14px -6px var(--hx-brand); }
.pagination .page-item.disabled .page-link { background: #f8fafc; color: #a3aebe; box-shadow: none; }
.pagination .page-link:focus { box-shadow: 0 0 0 .2rem rgba(0, 143, 204, .2); }

/* Focus that is easy to see (keyboard users), never on a mouse click. */
:where(a, button, .btn, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--hx-brand); outline-offset: 2px; }
.form-control:focus, .form-select:focus { border-color: var(--hx-brand); box-shadow: 0 0 0 .22rem rgba(0, 143, 204, .14); }

/* Dropdowns and alerts. */
.dropdown-menu { border-radius: 14px; border: 1px solid var(--hx-line); box-shadow: var(--hx-sh-3); padding: .4rem; }
.dropdown-menu .dropdown-item { border-radius: 9px; padding: .5rem .75rem; }
.dropdown-menu .dropdown-divider { margin: .35rem .25rem; border-color: var(--hx-line-2); }
.alert { border-radius: 14px; }

/* Modals: rounded, airy. */
.modal-content { border-radius: var(--hx-r-lg); border: 0; box-shadow: var(--hx-sh-3); }
.modal-header { border-bottom-color: var(--hx-line-2); }
.modal-footer { border-top-color: var(--hx-line-2); }

/* Broken pictures never show the browser's broken-image icon (hx.js marks them). */
img.hx-broken { visibility: hidden; }
.hx-broken-host { display: none !important; }

/* ============================================================ 3. Page transitions (phones and tablets)
   The opt-in, @view-transition { navigation: auto }, is an inline <style> in the layouts' <head>: Chrome checks it
   before the next page's stylesheets apply, so a rule in this file (or inside @media) is missed. Computers and
   "reduce motion" skip the transition (hx.js, on pageswap) and show no animation. */
@media (min-width: 992px), (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-image-pair(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media (max-width: 991.98px) {
    ::view-transition-old(root) { animation: hx-page-out .16s ease-in both; }
    ::view-transition-new(root) { animation: hx-page-in .26s var(--hx-ease) both; }
    .hs-tabbar, .adm-tabbar { view-transition-name: hx-tabbar; }
    .hx-appbar { view-transition-name: hx-appbar; }
    ::view-transition-old(hx-tabbar), ::view-transition-new(hx-tabbar),
    ::view-transition-old(hx-appbar), ::view-transition-new(hx-appbar) { animation: none; mix-blend-mode: normal; }
}
@keyframes hx-page-in { from { opacity: 0; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes hx-page-out { to { opacity: 0; transform: translate3d(-12px, 0, 0); } }

/* Thin progress line while the next page loads (website and member area; the admin panel has its own). */
.hx-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, var(--hx-brand), var(--hx-brand-2)); box-shadow: 0 0 10px rgba(0, 143, 204, .45); }
.hx-progress.go { opacity: 1; animation: hx-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes hx-progress { 0% { width: 0; } 12% { width: 38%; } 40% { width: 66%; } 100% { width: 92%; } }

/* ============================================================ 4. Phones: the app shell of the website */

/* App bar on inner pages: back, the page title, two actions. The website header stays on the home page. */
.hx-appbar { display: none; }
@media (max-width: 767.98px) {
    body.hx-inner .hs-topbar, body.hx-inner .hs-header { display: none !important; }
    .hx-appbar {
        display: flex; align-items: center; gap: .35rem; position: sticky; top: 0; z-index: 1030;
        height: calc(56px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) .5rem 0;
        background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
        border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease;
    }
    .hx-appbar.is-scrolled { border-bottom-color: var(--hx-line); box-shadow: 0 6px 18px -14px rgba(16, 24, 40, .35); }
    .hx-ab-btn {
        width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; border: 0; background: transparent; color: var(--hx-ink);
        display: inline-grid; place-items: center; position: relative; font-size: 1.2rem; text-decoration: none;
    }
    .hx-ab-btn:active { background: #eef2f7; transform: scale(.94); }
    .hx-ab-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
    .hx-ab-btn b { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--jm-accent, #eb0000); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
    .hx-ab-title { flex: 1; min-width: 0; font-family: var(--jm-serif, inherit); font-weight: 700; font-size: 1.04rem; color: var(--hx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
    .hx-ab-title small { display: block; font-family: var(--jm-font, inherit); font-size: .7rem; font-weight: 600; color: var(--hx-muted); letter-spacing: 0; }

    .hx-appbar.has-large-title .hx-ab-title > span { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s var(--hx-ease); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
    .hx-appbar.has-large-title.show-title .hx-ab-title > span { opacity: 1; transform: none; }
    .hx-ab-title > span { display: block; overflow: hidden; text-overflow: ellipsis; }

    /* Breadcrumbs repeat the app bar: hide them on phones. */
    body.hx-inner .module-crumbs, body.hx-inner .mod-crumbs, body.hx-inner .cm-crumbs, body.hx-inner nav[aria-label="breadcrumb" i] { display: none !important; }

    /* The website footer becomes a short app footer: the link groups fold, the big blocks go. */
    body.hx-inner .hs-footer-cta, body.hx-inner .hs-footer-brand, body.hx-inner .hs-footer-trust, body.hx-inner .hs-footer-glow { display: none !important; }
    body.hx-inner .hs-footer { padding-top: .5rem; background: transparent; color: var(--hx-muted); }
    body.hx-inner .hs-footer .hs-footer-main { gap: 0; }
    body.hx-inner .hs-footer .hs-footer-col { border-top: 1px solid var(--hx-line); }
    body.hx-inner .hs-footer .hs-footer-col > summary { color: var(--hx-ink-2); padding: .8rem .25rem; }
    body.hx-inner .hs-footer .hs-footer-col a { color: var(--hx-ink-2); }
    body.hx-inner .hs-footer .hs-legal { border-top: 1px solid var(--hx-line); color: var(--hx-muted); font-size: .75rem; }
    body.hx-inner .hs-footer .hs-legal a, body.hx-inner .hs-footer .hs-legal strong { color: var(--hx-brand-ink); }
    body.hx-auth.hx-inner .hs-footer .hs-footer-main { display: none !important; } /* signed in: the tab bar and the menu lead everywhere */

    /* The bottom tab bar: a floating, frosted bar with a soft active capsule. */
    .hs-tabbar { border-top: 0; box-shadow: 0 -1px 0 var(--hx-line), 0 -12px 30px -18px rgba(16, 24, 40, .3); }
    .hs-tabbar > a, .hs-tabbar > button { -webkit-tap-highlight-color: transparent; transition: transform .15s var(--hx-ease), color .15s ease; }
    .hs-tabbar > a:active, .hs-tabbar > button:active { transform: scale(.92); }

    /* A page starts with breathing room under the app bar. */
    body.hx-inner main#main > .container:first-child, body.hx-inner main#main > section:first-child { scroll-margin-top: 64px; }
}

/* ============================================================ 5. Phones: lists as cards, filters, sheets, forms, touch */
@media (max-width: 767.98px) {
    /* Tables with three or more columns turn into a list of cards (hx.js labels every cell from the header). */
    table.hx-cards, table.hx-cards > tbody, table.hx-cards > tbody > tr, table.hx-cards > tbody > tr > td { display: block; width: 100%; }
    table.hx-cards { background: transparent !important; border: 0 !important; margin: 0 !important; }
    table.hx-cards > thead { display: none; }
    table.hx-cards > tfoot { display: block; }
    table.hx-cards > tbody > tr {
        position: relative; background: var(--hx-card); border: 1px solid var(--hx-line); border-radius: var(--hx-r);
        padding: .8rem .95rem .7rem; margin: 0 0 .7rem; box-shadow: var(--hx-sh-1);
        transition: transform .14s var(--hx-ease), box-shadow .14s ease;
    }
    table.hx-cards > tbody > tr:active { transform: scale(.985); }
    table.hx-cards > tbody > tr > td {
        display: flex; align-items: baseline; justify-content: space-between; gap: .9rem; text-align: right;
        padding: .32rem 0 !important; border: 0 !important; background: transparent !important; font-size: .88rem; min-width: 0; word-break: break-word;
    }
    table.hx-cards > tbody > tr > td::before {
        content: attr(data-label); flex: 0 0 auto; max-width: 46%; text-align: left; color: var(--hx-muted);
        font-size: .74rem; font-weight: 600; letter-spacing: .01em; line-height: 1.6;
    }
    table.hx-cards > tbody > tr > td:not([data-label])::before, table.hx-cards > tbody > tr > td[data-label=""]::before { content: none; }
    table.hx-cards > tbody > tr > td.hx-td-main {
        display: block; text-align: left; font-size: .97rem; padding: 0 2.2rem .55rem 0 !important; margin-bottom: .35rem;
        border-bottom: 1px dashed var(--hx-line) !important;
    }
    table.hx-cards > tbody > tr > td.hx-td-main::before { content: none; }
    table.hx-cards > tbody > tr > td.hx-td-actions { justify-content: flex-end; flex-wrap: wrap; gap: .4rem; padding-top: .55rem !important; }
    table.hx-cards > tbody > tr > td.hx-td-actions::before { content: none; }
    table.hx-cards > tbody > tr > td.hx-td-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 38px; padding: .3rem .85rem; border-radius: 11px; line-height: 1.2; }
    table.hx-cards > tbody > tr > td.hx-td-actions .btn.btn-icon, table.hx-cards > tbody > tr > td.hx-td-actions .btn:has(> i:only-child) { width: 38px; padding: 0; }
    table.hx-cards > tbody > tr > td.hx-td-actions form { display: inline-flex; margin: 0; }
    table.hx-cards > tbody > tr > td.hx-td-check { position: absolute; top: .7rem; right: .8rem; width: auto; padding: 0 !important; }
    table.hx-cards > tbody > tr > td.hx-td-check::before { content: none; }
    table.hx-cards > tbody > tr > td.hx-td-blank { display: none; }
    table.hx-cards > tbody > tr.hx-row-full { background: transparent; border-style: dashed; box-shadow: none; text-align: center; }
    table.hx-cards > tbody > tr.hx-row-full > td { display: block; text-align: center; }
    table.hx-cards > tbody > tr.hx-row-full > td::before { content: none; }
    table.hx-cards > tbody > tr > td > .d-flex { justify-content: flex-end; }
    table.hx-cards > tbody > tr > td.hx-td-main > .d-flex { justify-content: flex-start; }
    .hx-cards-host { background: transparent !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; padding-left: 0 !important; padding-right: 0 !important; }
    .hx-cards-host > .card-header, .hx-cards-host > .panel-head { padding-left: .25rem; padding-right: .25rem; border-bottom: 0; }

    /* Filters fold away behind one button; the search box stays. */
    .hx-fold:not(.is-open) .hx-fold-item { display: none !important; }
    .hx-fold.is-open .hx-fold-item { animation: hx-drop .22s var(--hx-ease) both; }
    .hx-fold { padding: .65rem !important; }
    .hx-fold .row { --bs-gutter-y: .5rem; }
    .hx-fold-toggle-wrap { display: flex !important; align-items: stretch; }
    .hx-fold-toggle {
        display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 44px; padding: 0 1rem; width: 100%;
        border: 1px solid var(--hx-line); border-radius: 12px; background: #fff; color: var(--hx-ink); font-weight: 600; font-size: .9rem; white-space: nowrap;
    }
    .hx-fold-toggle b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hx-brand); color: #fff; font-size: .7rem; line-height: 20px; }
    .hx-fold.is-open .hx-fold-toggle { background: var(--hx-tint); border-color: rgba(0, 143, 204, .35); color: var(--hx-brand-ink); }
    .hx-fold-search { flex: 1 1 auto !important; width: auto !important; max-width: none !important; }

    /* Dialogs open from the bottom, like the phone's own sheets. */
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-dialog:not([class*="modal-fullscreen"]) {
        position: fixed; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; width: 100%; min-height: 0; display: block;
        transform: translate3d(0, 100%, 0); transition: transform .32s var(--hx-ease);
    }
    .modal.show:not(.hx-no-sheet):not(#hsSearch) .modal-dialog:not([class*="modal-fullscreen"]) { transform: none; }
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-dialog:not([class*="modal-fullscreen"]) .modal-content {
        border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; padding-bottom: var(--hx-safe-b);
    }
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-dialog:not([class*="modal-fullscreen"]) .modal-content::before {
        content: ""; display: block; width: 42px; height: 5px; border-radius: 99px; background: #d6dde7; margin: .55rem auto 0;
    }
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-dialog-scrollable .modal-content { overflow: hidden; }
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-footer { flex-wrap: nowrap; }
    .modal:not(.hx-no-sheet):not(#hsSearch) .modal-footer > .btn { flex: 1 1 0; min-height: 46px; border-radius: 13px; }

    /* Bottom sheets made by the site (offcanvas-bottom) get the same handle and corners. */
    .offcanvas-bottom { border-radius: 24px 24px 0 0; max-height: 88vh; max-height: 88dvh; height: auto; padding-bottom: var(--hx-safe-b); }

    /* Forms: big, easy fields; no zoom on iPhone; the save button stays in reach on long forms. */
    .form-control, .form-select { font-size: 16px; min-height: 46px; border-radius: 12px; }
    .form-control.form-control-sm, .form-select.form-select-sm { min-height: 42px; font-size: 16px; }
    textarea.form-control:not([rows="1"]):not([rows="2"]) { min-height: 96px; }
    .form-check-input { width: 1.25em; height: 1.25em; }
    .form-switch .form-check-input { width: 2.4em; height: 1.35em; }
    .form-label { font-weight: 600; font-size: .86rem; color: var(--hx-ink-2); margin-bottom: .35rem; }
    .btn { min-height: 42px; border-radius: 12px; }
    .btn-sm { min-height: 36px; border-radius: 10px; }
    /* Small search forms set to the right on computers take the whole row on phones. */
    form.ms-auto.d-flex { flex: 1 1 100%; margin-left: 0 !important; }
    form.ms-auto.d-flex > input:not([type="hidden"]), form.ms-auto.d-flex > .form-control { flex: 1 1 auto; min-width: 0; max-width: none !important; }
    .btn-lg { min-height: 52px; border-radius: 14px; }
    .hx-sticky-actions {
        position: sticky; bottom: calc(var(--hx-tabbar-h) + var(--hx-safe-b) + .5rem); z-index: 1025;
        padding: .6rem; margin: 1rem -.35rem 0; border-radius: 18px; display: flex; flex-wrap: wrap; gap: .5rem;
        background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
        box-shadow: 0 10px 30px -12px rgba(16, 24, 40, .3), 0 0 0 1px var(--hx-line);
    }
    body.in-app .hx-sticky-actions, body:not(.hx-has-tabbar) .hx-sticky-actions { bottom: calc(var(--hx-safe-b) + .5rem); }
    .hx-sticky-actions > .btn, .hx-sticky-actions > button { flex: 1 1 auto; min-height: 48px; }

    /* Tabs and pills scroll sideways like an app's segmented bar. */
    .nav-tabs, .nav-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .nav-tabs::-webkit-scrollbar, .nav-pills::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-link, .nav-pills .nav-link { white-space: nowrap; scroll-snap-align: start; }

    /* Cards and page heads: tighter, rounder, more app-like. */
    .page-head { gap: .6rem; margin-bottom: 1rem; }
    .page-head h1 { font-size: 1.2rem; }
    .page-head .btn { flex: 1 1 auto; }
    .card, .jm-card, .dcard { border-radius: var(--hx-r); }

    /* Touch: no grey flash, a gentle press on everything tappable. */
    a, button, .btn, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; }
    .btn:active:not(:disabled), a.card:active, a.jm-card:active, a.dcard:active, .list-group-item-action:active, .dlist-item:active,
    a.dk:active, .dash-sheet-grid a:active, .dquick a:active, .dchip:active, .hx-press:active { transform: scale(.97); transition: transform .1s ease; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
    img { -webkit-user-drag: none; }
}
@keyframes hx-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Small phones: even tighter cards. */
@media (max-width: 380px) {
    table.hx-cards > tbody > tr { padding: .7rem .8rem .6rem; }
    table.hx-cards > tbody > tr > td { font-size: .84rem; }
}

/* ============================================================ 6. Admin panel on phones and tablets */
.adm-tabbar { display: none; }
@media (max-width: 991.98px) {
    .admin-body .admin-content { padding-bottom: calc(92px + var(--hx-safe-b)); }
    .adm-tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
        padding: .3rem .4rem calc(.35rem + var(--hx-safe-b)); background: rgba(255, 255, 255, .94);
        backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
        box-shadow: 0 -1px 0 #e3e9f4, 0 -12px 30px -18px rgba(15, 23, 51, .35);
    }
    .adm-tabbar > a, .adm-tabbar > button {
        display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .25rem 0; border: 0; background: transparent;
        color: #6b7a90; font-size: .68rem; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
        transition: transform .15s var(--hx-ease), color .15s ease;
    }
    .adm-tabbar > a:active, .adm-tabbar > button:active { transform: scale(.92); }
    .adm-ti { position: relative; width: 46px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-size: 1.2rem; transition: background-color .2s ease; }
    .adm-ti b { position: absolute; top: -3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--jm-accent, #eb0000); color: #fff; font-size: .62rem; line-height: 18px; box-shadow: 0 0 0 2px #fff; }
    .adm-tabbar > a.active { color: var(--hx-brand-ink); }
    .adm-tabbar > a.active .adm-ti { background: rgba(0, 143, 204, .12); color: var(--hx-brand); }
    .adm-tabbar .adm-tab-main {
        width: 58px; height: 58px; margin: -26px auto 0; border-radius: 50%; display: grid; place-items: center; padding: 0; color: #fff; font-size: 1.35rem;
        background: linear-gradient(135deg, var(--hx-brand), var(--hx-brand-2)); box-shadow: 0 10px 22px -8px rgba(0, 143, 204, .7), 0 0 0 5px #fff;
    }
    .admin-body .admin-crumb { display: none !important; }
    .admin-body .admin-topbar { height: 58px; }
    .admin-body .admin-title { font-size: 1.02rem; }
    .admin-body .admin-content { padding-top: 1rem; }

    /* Sheets: the work waiting and the quick search. */
    .adm-sheet { border-radius: 24px 24px 0 0; max-height: 86vh; max-height: 86dvh; height: auto !important; }
    .adm-sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: #d6dde7; margin: .55rem auto 0; }
    .adm-sheet .offcanvas-header { padding: .75rem 1.1rem .6rem; }
    .adm-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .5rem; border-radius: 14px; color: var(--hx-ink); text-decoration: none; }
    .adm-row:active { background: #f1f5fa; transform: scale(.985); }
    .adm-row + .adm-row { border-top: 1px solid #f0f3f8; }
    .adm-row-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 143, 204, .1); color: var(--hx-brand); font-size: 1.1rem; }
    .adm-row.sm { padding: .5rem .4rem; }
    .adm-row.sm .adm-row-ic { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: .98rem; }
    .adm-row-n { min-width: 28px; height: 24px; padding: 0 .5rem; border-radius: 999px; background: #fff1f1; color: #c81e1e; font-size: .76rem; display: grid; place-items: center; }
    .adm-empty { text-align: center; padding: 1.6rem 1rem 2rem; }
    .adm-empty > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .6rem; background: #e8f7ef; color: #1f9d5b; font-size: 1.6rem; }
    .adm-find-form { position: relative; }
    .adm-find-form > i { position: absolute; z-index: 2; left: .9rem; top: 50%; transform: translateY(-50%); color: #8a96b3; pointer-events: none; }
    .adm-find-form > .form-control { padding-left: 2.5rem; border-radius: 14px; background: #f3f6fc; border-color: transparent; }
    .adm-find-group { margin-top: .6rem; }
    .adm-find-h { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8a96b3; padding: .4rem .5rem .2rem; }
    .adm-find-group .adm-row + .adm-row { border-top: 0; }
    .admin-body .admin-sidebar.offcanvas-lg { width: min(86vw, 320px); }
    /* The settings save bar and other bars pinned to the bottom sit above the tab bar. */
    .admin-body .st-savebar, .admin-body .sticky-bottom-bar { bottom: calc(76px + var(--hx-safe-b)); }
}
@media (max-width: 991.98px) {
    body.hx-has-tabbar:not(.admin-body) .sticky-bottom-bar { bottom: calc(80px + var(--hx-safe-b)); }
}

/* ============================================================ 7. Member home ("My Harpal") and "Show all" lists */
.hub-hero { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.25rem;
    margin-bottom: 1.25rem; padding: 1.5rem; border-radius: 26px; color: #fff;
    background: radial-gradient(520px 300px at 100% 0%, rgba(255, 255, 255, .16), transparent 62%), radial-gradient(480px 280px at 0% 100%, rgba(4, 162, 224, .5), transparent 70%),
                linear-gradient(125deg, #053a61 0%, #0a6aa8 50%, var(--hx-brand) 100%);
    box-shadow: 0 24px 48px -26px rgba(0, 95, 150, .85); }
.hub-hero.has-cover { background: linear-gradient(120deg, rgba(4, 30, 58, .9), rgba(0, 110, 170, .62)), var(--cover) center / cover; }
.hub-hero::after { content: ""; position: absolute; z-index: -1; right: -80px; bottom: -110px; width: 280px; height: 280px; border-radius: 50%; border: 44px solid rgba(255, 255, 255, .06); pointer-events: none; }
.hub-hero-main { display: flex; flex-direction: column; justify-content: space-between; gap: 1.1rem; min-width: 0; }
.hub-me { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.hub-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .74); }
.hub-name { font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; margin: .15rem 0 .45rem; color: #fff; }
.hub-chips { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .78rem; }
.hub-search { position: relative; margin: 0; }
.hub-search > i { position: absolute; z-index: 2; left: 1rem; top: 50%; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.hub-search .form-control { min-height: 48px; padding-left: 2.6rem; border: 0; border-radius: 999px; box-shadow: 0 10px 24px -14px rgba(2, 32, 64, .6); }
.hub-wallet { display: flex; flex-direction: column; justify-content: space-between; gap: .9rem; min-width: 0; padding: 1.05rem 1.1rem; border-radius: 20px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hub-wallet-top { display: block; min-width: 0; color: #fff; text-decoration: none; }
.hub-wallet-top:hover { color: #fff; }
.hub-wallet-l { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .84); }
.hub-wallet-v { display: block; margin-top: .25rem; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.hub-wallet-x { display: block; font-size: .74rem; color: rgba(255, 255, 255, .74); }
.hub-wallet-acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; }
.hub-wallet-acts a { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .25rem; border-radius: 14px; color: #fff; text-decoration: none;
    font-size: .74rem; font-weight: 600; background: rgba(255, 255, 255, .14); transition: background-color .15s, transform .15s; }
.hub-wallet-acts a i { font-size: 1.05rem; line-height: 1; }
.hub-wallet-acts a:hover { color: #fff; background: rgba(255, 255, 255, .26); }
.hub-wallet-acts a:active { transform: scale(.95); }

.hub-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.hub-kpi { display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .9rem 1rem; border-radius: 18px; background: #fff; border: 1px solid #e6ecf5;
    color: var(--hx-ink); text-decoration: none; box-shadow: var(--hx-sh-1); transition: transform .15s, box-shadow .15s; }
.hub-kpi:hover { color: var(--hx-ink); transform: translateY(-2px); box-shadow: 0 14px 28px -18px var(--t1, #008fcc); }
.hub-kpi b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--tt, var(--t1)); }
.hub-kpi .min-w-0 > span { display: block; font-size: .8rem; font-weight: 700; }
.hub-kpi small { display: block; font-size: .7rem; color: var(--hx-muted); }

.hub-side { display: flex; flex-direction: column; gap: 1rem; height: 100%; }
.hub-side > #my-activity { flex: 1 1 auto; }
.hub-quick { grid-auto-rows: 1fr; }
.hub-note.is-unread .fw-semibold::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: .35rem; border-radius: 50%; background: var(--hx-brand); vertical-align: middle; }

/* Notifications page: grouped by day, an icon for each kind of update, unread ones marked. */
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.nt-day { margin: 0 0 .45rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hx-muted); }
.nt-list { overflow: hidden; }
.nt-item { position: relative; display: flex; align-items: flex-start; gap: .85rem; padding: .9rem 1rem; color: inherit; text-decoration: none; transition: background-color .15s; }
.nt-item + .nt-item { border-top: 1px solid #eef2f7; }
.nt-item:hover { background: #f8fafd; color: inherit; }
.nt-item.is-unread { background: rgba(0, 143, 204, .045); }
.nt-title { display: block; font-weight: 600; color: var(--hx-ink); line-height: 1.3; }
.nt-item.is-unread .nt-title { font-weight: 700; }
.nt-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .15rem; font-size: .84rem; color: #4b5565; }
.nt-time { display: block; margin-top: .25rem; font-size: .72rem; color: var(--hx-muted); }
.nt-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: .4rem; border-radius: 50%; background: var(--hx-brand); box-shadow: 0 0 0 3px rgba(0, 143, 204, .15); }
.dcard-head > a { color: var(--jm-primary-text, #0072a3); text-decoration: none; }
.hub-empty { display: flex; align-items: center; gap: .8rem; padding: .3rem 1.2rem 1.2rem; }
.hub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: .9rem; scroll-margin-top: 80px; }
.hub-svc-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .9rem; }
.hub-svc-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.hub-quick-more, .hx-showall { display: none; }
#my-activity { scroll-margin-top: 80px; }

/* Home app bar: the brand instead of back. */
.hx-ab-brand { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; height: 40px; padding-left: .2rem; color: var(--hx-ink); text-decoration: none; font-weight: 800; }
.hx-ab-brand img { max-height: 30px; width: auto; }
.hx-ab-brand .brand-text { font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }

@media (max-width: 767.98px) {
    /* The member menu is in the tab bar's sheet: no chip bar under the app bar. */
    .member-mobile-nav { display: none !important; }

    .hub-hero { grid-template-columns: minmax(0, 1fr); gap: .95rem; padding: 1.1rem; border-radius: 24px; }
    .hub-me { gap: .8rem; }
    .hub-me .avatar-ring { width: 58px; height: 58px; }
    .hub-eyebrow { font-size: .64rem; }
    .hub-name { font-size: 1.32rem; margin-bottom: .35rem; }
    .hub-chips { font-size: .72rem; gap: .3rem; }
    .hub-wallet { flex-direction: row; align-items: center; gap: .6rem; padding: .8rem .85rem; border-radius: 18px; }
    .hub-wallet-top { flex: 1 1 auto; }
    .hub-wallet-v { font-size: 1.3rem; }
    .hub-wallet-acts { flex: 0 0 auto; grid-auto-columns: 54px; gap: .35rem; }
    .hub-wallet-acts a { padding: .45rem .1rem; border-radius: 13px; font-size: .64rem; }

    .hub-kpis { gap: .5rem; margin-bottom: 1rem; }
    .hub-kpi { flex-direction: column; align-items: flex-start; gap: .45rem; padding: .7rem .75rem; border-radius: 16px; }
    .hub-kpi .ti.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: .85rem; border-radius: 10px; }
    .hub-kpi b { font-size: 1.15rem; }
    .hub-kpi .min-w-0 { width: 100%; }
    .hub-kpi .min-w-0 > span { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hub-kpi small { display: none; }

    /* Quick actions: four round tiles a row; the first seven and "More". */
    .hub-quick { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .2rem !important; padding-left: .45rem !important; padding-right: .45rem !important; }
    .hub-quick > a, .hub-quick-more { border: 0; background: transparent; box-shadow: none; padding: .5rem .1rem; font-size: .68rem; gap: .35rem; line-height: 1.2; }
    .hub-quick > a:hover { transform: none; box-shadow: none; }
    .hub-quick > a:active .ti, .hub-quick-more:active .ti { transform: scale(.92); }
    .hub-quick .ti { width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; font-size: 1.15rem; transition: transform .15s; }
    .hub-quick-more { display: flex; flex-direction: column; align-items: center; color: var(--hx-ink); font-weight: 600; text-align: center; }
    .hub-quick-more .ti { color: #fff; background: linear-gradient(135deg, #64748b, #94a3b8); box-shadow: none; }

    /* Services: compact cards, links in one swipeable row. */
    .hub-services { --bs-gutter-y: .7rem; }
    .hub-services .dtone-card { padding: .85rem .9rem; border-radius: 18px; }
    .hub-services .dtone-card:hover { transform: none; }
    .hub-svc-head { gap: .7rem; margin-bottom: .65rem; }
    .hub-svc-head .ti.lg { width: 44px; height: 44px; flex-basis: 44px; border-radius: 14px; font-size: 1.15rem; }
    .hub-svc-go { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tb); color: var(--tt, var(--t1)); }
    .hub-svc-stats { --bs-gutter-x: .4rem; --bs-gutter-y: .4rem; margin-bottom: .65rem !important; }
    .hub-svc-stats .dtone-stat { padding: .35rem .5rem; border-radius: 10px; }
    .hub-svc-stats .dtone-stat strong { font-size: .95rem; }
    .hub-svc-stats .dtone-stat span { font-size: .64rem; }
    .hub-svc-links { flex-wrap: nowrap; gap: .4rem; margin: 0 -.9rem; padding: 0 .9rem .1rem; overflow-x: auto; scrollbar-width: none; }
    .hub-svc-links::-webkit-scrollbar { display: none; }
    .hub-svc-links .dchip { flex: 0 0 auto; padding: .34rem .7rem; font-size: .76rem; white-space: nowrap; }

    /* "Show all": long lists show their first items. */
    .hx-clip-6:not(.is-all) > :nth-child(n+7):not([data-hx-more]),
    .hx-clip-7:not(.is-all) > :nth-child(n+8):not([data-hx-more]) { display: none !important; }
    .hx-showall { display: flex; align-items: center; justify-content: center; gap: .35rem; width: 100%; margin: .8rem 0 0; padding: .72rem; border: 1px solid var(--hx-line); border-radius: 14px;
        background: #fff; color: var(--jm-primary-text, #0072a3); font-size: .86rem; font-weight: 700; box-shadow: var(--hx-sh-1); }
    .hx-showall:active { transform: scale(.98); background: #f5f8fc; }

    /* A row of cards marked hx-swipe slides sideways instead of stacking. */
    .row.hx-swipe { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: .35rem; }
    .row.hx-swipe::-webkit-scrollbar { display: none; }
    .row.hx-swipe > [class*="col"] { flex: 0 0 84%; max-width: 84%; scroll-snap-align: start; }

    /* Edit profile: the cover hint keeps clear of the profile picture. */
    .ap-cover-hint { place-content: start end; justify-items: end; text-align: right; padding: .8rem 1rem; font-size: .86rem; }
    .ap-cover-hint i { font-size: 1.3rem; }
    .ap-cover-hint small { display: none; }

    /* Today's date strip: icon and date in one row, the holiday under them. */
    .today-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .75rem; row-gap: .45rem; align-items: center; }
    .today-strip > .ts-tag { grid-column: 1 / -1; justify-self: start; }
    .hub-quick { grid-auto-rows: auto; }
}

/* Business portal on phones: back and the page's name on inner pages. */
.hsp-back { flex: 0 0 40px; width: 40px; height: 40px; margin-left: -.35rem; border-radius: 50%; display: grid; place-items: center; color: var(--hx-ink); font-size: 1.25rem; text-decoration: none; }
.hsp-back:active { background: #eef2f7; transform: scale(.94); }
.hsp-top-page { flex: 1 1 auto; line-height: 1.2; }
.hsp-top-page small { font-size: .68rem; color: var(--hx-muted); }
.hsp-top-page strong { font-size: 1rem; color: var(--hx-ink); }

/* ============================================================ 8. "Reduce motion": no slides, no grow effects */
@media (prefers-reduced-motion: reduce) {
    .hx-progress.go { animation: none; width: 70%; }
    .hx-appbar, .hub-kpi, .hub-wallet-acts a, .hub-quick .ti, .nt-item, .adm-row, .hx-showall, .hsp-back,
    table.hx-cards > tbody > tr, .hx-fold-toggle, .dtone-card, .dquick a { transition: none !important; }
    .hub-kpi:hover, .dtone-card:hover, .dquick a:hover { transform: none; }
}
