/* Shared customer topbar and its notification menu. */

.notification-panel,
.notification-panel * {
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.notification-panel::-webkit-scrollbar,
.notification-panel *::-webkit-scrollbar {
    display: none !important;
    width: 0;
    height: 0;
}

.app-topbar {
    position: sticky;
    z-index: 90;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    margin-left: -328px;
    padding: 0 16px;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
}

/* Lift the header above the workspace sidebar only while its currency menu is active. */
.app-topbar:has(.currency-switch__details:hover),
.app-topbar:has(.currency-switch__details:focus-within),
.app-topbar:has(.currency-switch__details[open]) {
    z-index: 160;
}

body:not(.app-body) .customer-global-topbar { margin-left: 0; }

.app-topbar-leading {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    min-width: 0;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.currency-switch {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: var(--ink);
}

.currency-switch__details { position: relative; }

.currency-switch__details > summary { list-style: none; }
.currency-switch__details > summary::-webkit-details-marker { display: none; }

.currency-switch__trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px 0 10px;
    color: var(--ink);
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.currency-switch__trigger:hover,
.currency-switch__details[open] > .currency-switch__trigger {
    box-shadow: 0 8px 22px rgba(17, 19, 24, 0.12);
    transform: translateY(-1px);
}

.currency-switch__trigger:focus-visible,
.currency-switch__menu button:focus-visible {
    outline: 3px solid rgba(40, 107, 227, 0.35);
    outline-offset: 2px;
}

.currency-switch__flag {
    display: grid;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    background: transparent;
    border-radius: 0;
    font-size: 17px;
    line-height: 1;
}

.currency-switch__code { letter-spacing: 0.01em; }

.currency-switch__chevron {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    opacity: 0.65;
}

.currency-switch__menu {
    position: absolute;
    z-index: 130;
    top: calc(100% + 3px);
    left: 0;
    display: none;
    width: 88.69px;
    padding: 5px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(17, 19, 24, 0.14);
}

.currency-switch__details[open] .currency-switch__menu,
.currency-switch__details:hover .currency-switch__menu,
.currency-switch__details:focus-within .currency-switch__menu {
    display: grid;
    gap: 2px;
}

.currency-switch__menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 5px 8px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.currency-switch__menu button:hover,
.currency-switch__menu button[aria-pressed="true"] {
    background: var(--action-bg);
}

.currency-switch--public .currency-switch__trigger {
    color: var(--home-text);
    background: var(--home-bg);
    border-color: var(--home-rule);
}

.currency-switch--public .currency-switch__menu {
    color: var(--home-text);
    background: var(--home-bg);
    border-color: var(--home-rule);
}

.currency-switch--public .currency-switch__menu button { color: var(--home-text); }

.balance-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px 0 10px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11px;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.balance-link:hover {
    box-shadow: 0 8px 22px rgba(17, 19, 24, 0.12);
    transform: translateY(-1px);
}

.balance-link__icon {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    background: var(--action-bg);
    border-radius: 50%;
    color: var(--action-ink);
}

.balance-link__icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.balance-link strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.customer-settings-link { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid var(--hairline); border-radius: 50%; background: var(--canvas); color: var(--muted); }
.customer-settings-link:hover, .customer-settings-link[aria-current="page"] { color: var(--signal); background: var(--hover); }
.customer-settings-link .material-symbols-outlined { font-size: 22px; }

.notification-center {
    position: relative;
}

.notification-bell {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 50%;
    color: var(--ink);
}

.notification-bell:hover,
.notification-bell[aria-expanded="true"] {
    background: var(--hover);
    border-color: var(--strong-line);
}

.notification-bell svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
}

.notification-unread-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: #e5484d;
    border: 2px solid var(--canvas);
    border-radius: 50%;
    box-sizing: content-box;
}

.notification-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + 12px);
    right: 0;
    width: min(390px, calc(100vw - 32px));
    overflow: hidden;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.notification-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hairline);
}

.notification-panel__header div {
    display: grid;
    gap: 3px;
}

.notification-panel__header strong {
    font-size: 15px;
}

.notification-panel__header span {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 10px;
}

.notification-panel__header button {
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.notification-panel__header button:disabled {
    cursor: default;
    opacity: 0.42;
}

.notification-panel__back {
    display: none;
}

.notification-panel__back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.notification-filters {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--hairline);
}

.notification-filters button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 12px;
    background: var(--quiet);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
}

.notification-filters button.is-active {
    background: var(--action-bg);
    border-color: var(--action-border);
    color: var(--action-ink);
}

.notification-filters button span {
    display: inline-grid;
    min-width: 17px;
    height: 17px;
    padding-inline: 4px;
    place-items: center;
    background: var(--canvas);
    border-radius: 999px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 8px;
}

.notification-list {
    max-height: min(470px, calc(100vh - 150px));
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 7px;
    gap: 12px;
    align-items: start;
    padding: 15px 16px;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink);
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    background: var(--hover);
}

.notification-item__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: var(--quiet);
    border: 1px solid var(--hairline);
    border-radius: 11px;
}

.notification-item__icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.notification-item__content {
    min-width: 0;
}

.notification-item__content strong,
.notification-item__content span,
.notification-item__content time {
    display: block;
}

.notification-item__content strong {
    margin-bottom: 3px;
    font-size: 13px;
}

.notification-item__content span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.notification-item__content time {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 9px;
}

.notification-item__unread {
    width: 7px;
    height: 7px;
    margin-top: 7px;
    background: #e5484d;
    border-radius: 50%;
}

.notification-item.is-read .notification-item__unread {
    visibility: hidden;
}

.notification-empty {
    margin: 0;
    padding: 36px 20px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.app-topbar-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.app-topbar-brand img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

@media (max-width: 820px) {
    .notification-panel {
        position: fixed;
        z-index: 2000;
        inset: 0;
        width: 100%;
        height: 100dvh;
        overflow: hidden;
        background: var(--quiet);
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .notification-panel__header {
        min-height: 76px;
        padding: 14px 18px;
        background: var(--quiet);
        border-bottom: 0;
    }

    .notification-panel__header div {
        flex: 1;
    }

    .notification-panel__header div span {
        display: none;
    }

    .notification-panel__header strong {
        font-size: 18px;
        font-weight: 500;
    }

    .notification-panel__back {
        display: grid;
        width: 24px;
        height: 40px;
        place-items: center;
        color: var(--ink);
        font-size: 18px;
        font-weight: 400;
    }

    .mobile-title-back__shaft {
        display: none;
    }

    .notification-panel__header > [data-notification-read-all] {
        width: 72px;
        visibility: hidden;
    }

    .notification-filters {
        min-height: 70px;
        padding: 14px 18px;
        gap: 10px;
        background: var(--quiet);
        border-bottom: 0;
    }

    .notification-filters button {
        flex: 1;
        min-height: 40px;
        padding-inline: 10px;
        background: var(--canvas);
        border: 0;
        font-size: 12px;
    }

    .notification-list {
        height: calc(100dvh - 146px);
        max-height: none;
        padding: 18px 18px 28px;
        background: var(--quiet);
    }

    .notification-item {
        grid-template-columns: 38px minmax(0, 1fr) 7px;
        margin-bottom: 14px;
        padding: 18px;
        background: var(--canvas);
        border: 0;
        border-radius: 14px;
    }

    .notification-item:last-child {
        border-bottom: 0;
    }

    .notification-item:hover {
        background: color-mix(in srgb, var(--ink) 4%, var(--canvas));
    }

    .notification-item__icon {
        width: 38px;
        height: 38px;
        background: color-mix(in srgb, var(--signal) 8%, var(--canvas));
        border: 0;
        border-radius: 10px;
    }

    .notification-item__content strong {
        margin-bottom: 12px;
        font-size: 16px;
    }

    .notification-item__content span {
        min-height: 42px;
        font-size: 13px;
    }

    .notification-item__content time {
        font-size: 10px;
    }

    .notification-item__content time::after {
        float: right;
        color: var(--ink);
        content: "View  ›";
        font-family: var(--sans);
        font-size: 12px;
        font-weight: 700;
    }

}

@media (max-width: 960px) {
    .app-topbar {
        display: flex;
        margin-left: 0;
    }

    .app-topbar-brand { gap: 8px; font-size: 17px; }
    .app-topbar-brand img { width: 30px; height: 30px; }
    .app-topbar-brand strong { display: none; }
    body:not(.app-body) .customer-global-topbar .guest-profile-trigger--desktop {
        display: grid;
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}

@media (min-width: 761px) and (max-width: 960px) {
    body:not(.app-body) .guest-menu { top: 74px; }
}

@media (max-width: 820px) {
    .app-topbar {
        min-height: 64px;
        padding-inline: 16px;
    }

    .balance-link {
        gap: 8px;
        padding-right: 11px;
    }

    .app-topbar-leading { gap: 10px; }
    .currency-switch__trigger { min-height: 38px; gap: 7px; padding-inline: 7px 10px; }

    .page-transactions .app-topbar {
        display: none !important;
    }

    body.has-open-notifications .mobile-bottom-nav {
        display: none !important;
    }

    .app-body:has(.transaction-receipt) .app-topbar {
        display: none;
    }
}

@media (max-width: 600px) {
    .customer-topbar-actions { gap: 6px; }
    .balance-link { gap: 6px; padding-inline: 6px 8px; }
    .balance-link__icon { width: 22px; height: 22px; }
    .balance-link__icon svg { width: 13px; height: 13px; }
    .notification-bell,
    .customer-settings-link {
        width: 36px;
        height: 36px;
    }
    .customer-settings-link { flex-basis: 36px; }
}

@media print {
    .app-topbar {
        display: none !important;
    }
}
