.app-topbar {
    position: sticky;
    top: 0;
    z-index: 120;
    align-self: stretch;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 78px;
    padding: 17px 30px;
    border-bottom: 1px solid #e8edf2;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 5px 20px rgba(10, 15, 40, 0.045);
    backdrop-filter: blur(14px);
}

.topbar-heading { min-width: 0; }
.app-topbar h1 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    color: #101a31;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.2;
}

.topbar-title-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #e2eef5;
    border-radius: 14px;
    background: linear-gradient(145deg, #f3faff, #e9f4fb);
    color: #2389bb;
    font-size: 19px;
}

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

.topbar-notifications {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid #e7ebf0;
    border-radius: 14px;
    background: #fff;
    color: #4f5d72;
    font-size: 18px;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.topbar-notifications:hover,
.topbar-notifications[aria-expanded="true"] {
    border-color: #cfe4f0;
    background: #f2f9fd;
    color: #167eab;
    transform: translateY(-1px);
}

.topbar-notifications:focus-visible,
.topbar-refresh:focus-visible {
    outline: 3px solid rgba(35, 137, 187, .3);
    outline-offset: 2px;
}

.notification-indicator:not([hidden]) {
    position: absolute;
    top: 7px;
    right: 6px;
    display: grid;
    height: 8px;
    box-sizing: border-box;
    place-items: center;
    width: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d65d55;
}

.notification-indicator.has-count {
    width: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-width: 1px;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid #e8edf2;
}

.topbar-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dcebf4;
    border-radius: 14px;
    background: #edf7fc;
    color: #174c68;
    font-size: 12px;
    font-weight: 600;
}

.topbar-user-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.topbar-user-copy strong { overflow: hidden; max-width: 170px; color: #263247; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-copy small { color: #7c8798; font-size: 11px; }

.topbar-refresh {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid #e4eaf0;
    border-radius: 13px;
    background: #fff;
    color: #48566b;
    font-size: 12px;
    font-weight: 600;
}

.topbar-refresh:hover { background: #f4f8fb; color: #1c6687; }
.mobile-cart-jump { display: none; }
.trim-subscription-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 24px 14px;
    padding: 11px 14px;
    border: 1px solid #f0d7a4;
    border-radius: 12px;
    background: #fff9eb;
    color: #6d4b12;
}
.trim-subscription-warning > i { flex: 0 0 auto; margin-top: 2px; color: #a66b12; }
.trim-subscription-warning p { margin: 0; font-size: 12px; line-height: 1.5; }
.trim-subscription-warning strong { font-weight: 650; }
.trim-notification-panel {
    position: fixed;
    z-index: 1300;
    width: min(360px, calc(100vw - 24px));
    padding: 17px;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(10, 15, 40, .18);
}

.trim-notification-panel[hidden] { display: none; }
.trim-notification-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid #edf0f4; }
.trim-notification-heading h2 { margin: 0; color: #152039; font-size: 16px; }
.trim-notification-close { display: grid; flex: 0 0 34px; width: 34px; min-width: 34px; height: 34px; min-height: 34px; place-items: center; padding: 0; border: 0; border-radius: 10px; background: #f3f5f8; color: #526076; font-size: 14px; line-height: 1; }
.trim-notification-close:hover { background: #e8edf3; color: #263247; }
.trim-notification-close:focus-visible { outline: 2px solid #53b7e8; outline-offset: 2px; }
.trim-notification-empty { display: flex; align-items: flex-start; gap: 12px; padding: 15px 2px 2px; }
.trim-notification-empty > i { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #f1f7fa; color: #3c7893; font-size: 17px; }
.trim-notification-empty strong { display: block; margin: 1px 0 4px; color: #344054; font-size: 13px; }
.trim-notification-empty p { margin: 0; color: #778397; font-size: 12px; line-height: 1.5; }
.trim-notification-subscription { display: flex; align-items: flex-start; gap: 11px; margin: 10px 0 7px; padding: 11px 9px; border: 1px solid #f0d7a4; border-radius: 12px; background: #fff9eb; color: #6d4b12; }
.trim-notification-subscription > i { flex: 0 0 auto; margin-top: 2px; color: #a66b12; }
.trim-notification-subscription-copy { display: grid; min-width: 0; gap: 3px; }
.trim-notification-subscription-copy strong { color: #6d4b12; font-size: 12px; font-weight: 650; line-height: 1.35; }
.trim-notification-subscription-copy small { color: #7d6740; font-size: 11px; line-height: 1.45; }
.trim-notification-content { max-height: min(360px, 55vh); overflow-y: auto; }
.trim-notification-list { display: grid; gap: 2px; padding: 8px 0; }
.trim-notification-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 7px; border-radius: 12px; color: inherit; text-decoration: none; }
.trim-notification-item:hover { background: #f6f8fa; }
.trim-notification-item.is-unread { background: #f5faff; }
.trim-notification-item-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #eaf4f9; color: #247c9f; }
.trim-notification-item-copy { display: grid; min-width: 0; gap: 3px; }
.trim-notification-item-copy strong { color: #344054; font-size: 12px; font-weight: 650; line-height: 1.35; }
.trim-notification-item-copy small { color: #778397; font-size: 11px; line-height: 1.35; }
.trim-notification-footer { display: block; padding: 11px 2px 1px; border-top: 1px solid #edf0f4; color: #257898; font-size: 12px; font-weight: 650; text-align: center; text-decoration: none; }
.trim-notification-footer:hover { color: #145b75; }

@media (max-width: 900px) {
    :root { --trim-mobile-topbar-offset: max(70px, calc(54px + env(safe-area-inset-top))); }

    .app-topbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        min-height: 70px;
        gap: 12px;
        padding: max(11px, env(safe-area-inset-top)) 16px 11px;
    }

    .trim-subscription-warning { margin: 8px 12px 10px; }

    .main-content { padding-top: var(--trim-mobile-topbar-offset); }

    .users-mobile-view,
    body.sales-page[data-mobile-pos-mode="consultation"] > .mobile-sales-view {
        padding-top: var(--trim-mobile-topbar-offset);
        box-sizing: border-box;
    }
    .app-topbar h1 { gap: 9px; font-size: 17px; }
    .topbar-title-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }
    .app-topbar .topbar-actions { gap: 8px; }
    .topbar-notifications { width: 40px; height: 40px; border-radius: 13px; }
    .topbar-user { padding-left: 0; border-left: 0; }
    .topbar-user-copy { display: none; }
    .topbar-avatar { width: 38px; height: 38px; border-radius: 13px; }
    .topbar-refresh { width: 40px; min-height: 40px; padding: 0; }
    .topbar-refresh span { display: none; }
    .mobile-cart-jump { display: inline-flex; min-height: 40px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #dcebf4; border-radius: 12px; background: #f2f9fd; color: #174c68; font-size: 12px; font-weight: 600; text-decoration: none; }
    .mobile-cart-jump b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 50%; background: #174c68; color: #fff; font-size: 10px; }
}

@media (max-width: 370px) {
    .app-topbar { padding-right: 11px; padding-left: 11px; }
    .app-topbar h1 { font-size: 15px; }
    .topbar-title-icon { width: 34px; height: 34px; }
    .topbar-notifications { width: 36px; height: 36px; }
    .topbar-avatar { width: 34px; height: 34px; }
    .app-topbar .topbar-actions { gap: 6px; }
}
