/* Responsive-only overrides. To disable, comment this file link in layout heads. */

img,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

/* Final mobile quick-tools normalization (kept at end to override earlier responsive rules) */
@media screen and (max-width: 1024px) {
    /* Remove extra wrapper chrome so inner quick-tool controls fill each grid cell */
    .top-header-right li > div.header-tool-fiscal,
    .top-header-right li > div.header-tool-branch,
    .top-header-right li > div.header-tool-language {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .top-header-right li > .header-tool-fiscal {
        grid-column: 1 / 2 !important;
    }

    .top-header-right li > .header-tool-branch {
        grid-column: 2 / 3 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        min-width: 0 !important;
    }

    .top-header-right li > .header-tool-language {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }

    .top-header-right li > .header-tool-language > div {
        width: 100% !important;
        margin: 0 !important;
    }

    .top-header-right li > .header-tool-count-notification {
        grid-column: 1 / 2 !important;
        width: 100% !important;
    }

    .top-header-right li > .header-tool-user-notification {
        grid-column: 2 / 3 !important;
        width: 100% !important;
    }

    /* Make fiscal + branch controls identical in outer footprint */
    .top-header-right li > .header-tool-fiscal > button.header-context-select-btn,
    .top-header-right li > .header-tool-branch > button.header-context-select-btn {
        width: 100% !important;
        height: 2.25rem !important;
        min-height: 2.25rem !important;
        margin: 0 !important;
        padding: 0 0.75rem !important;
        border-radius: 0.5rem !important;
        box-sizing: border-box !important;
    }

    .top-header-right li > .header-tool-count-notification > *,
    .top-header-right li > .header-tool-user-notification > * {
        width: 100% !important;
        margin: 0 !important;
    }

    .dark .top-header-right li > .header-tool-count-notification > div > .relative {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%) !important;
        border-color: #4b5563 !important;
        color: #e5e7eb !important;
    }

    .dark .top-header-right li > .header-tool-user-notification > div > .relative,
    .dark .top-header-right li > .header-tool-user-notification button {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%) !important;
        border-color: #4b5563 !important;
        color: #e5e7eb !important;
    }

    .dark .top-header-right li > .header-tool-count-notification > div > .relative:hover,
    .dark .top-header-right li > .header-tool-user-notification > div > .relative:hover,
    .dark .top-header-right li > .header-tool-user-notification button:hover {
        background: linear-gradient(180deg, #374151 0%, #1f2937 100%) !important;
        border-color: #6b7280 !important;
    }
}

.select2-container,
.select2,
.select2-selection {
    max-width: 100% !important;
}

:root {
    --app-accent: #059669;
    --app-accent-dark: #047857;
    --app-accent-soft: #ecfdf5;
    --app-header-border: #e5e7eb;
    --app-header-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.header-tools-toggle {
    display: none;
}

.header-tools-group {
    position: relative;
}

.header-tools-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* Shared quick-tool card look (web + mobile): fiscal/language/notifications */
.top-header-right .header-tool-fiscal > .btn,
.top-header-right .header-tool-language > .btn,
.top-header-right .header-tool-count-notification > div > .relative,
.top-header-right .header-tool-user-notification > div > .relative,
.top-header-right .header-tool-user-notification button {
    border: 1px solid #dbe4ef !important;
    border-radius: 0.625rem !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.top-header-right .header-tool-fiscal > .btn:hover,
.top-header-right .header-tool-language > .btn:hover,
.top-header-right .header-tool-count-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification button:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

/* Web profile dropdown rows: clear backgrounds and polished colors */
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) a {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    color: #4f46e5 !important;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) a,
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) a {
    background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%) !important;
    color: #5b21b6 !important;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) a {
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important;
    color: #3730a3 !important;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) a {
    background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%) !important;
    color: #dc2626 !important;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) a {
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important;
    color: #2563eb !important;
}

.top-header-right > .relative.inline-flex:last-child > button {
    border: 1px solid #dbe4ef;
    border-radius: 0.625rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 0.35rem 0.55rem;
}

/* Web profile trigger: focused/open bordered look (like previous UI) */
.top-header-right > .relative.inline-flex.header-user-group > button {
    border: 1px solid #dbe4ef !important;
    border-radius: 0.625rem !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    padding: 0.4rem 0.65rem !important;
    min-height: 2.3rem !important;
}

.top-header-right > .relative.inline-flex.header-user-group > button:focus-visible,
.top-header-right > .relative.inline-flex.header-user-group > button[aria-expanded="true"] {
    border: 2px solid #1f2937 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right {
    border-radius: 0.75rem !important;
    border-color: #dbe4ef !important;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14) !important;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
    padding: 0 !important;
    overflow: hidden;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a,
.top-header-right > .relative.inline-flex:last-child .origin-top-right a {
    white-space: nowrap !important;
    line-height: 1.15 !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right > .pt-0\.5.pb-2 {
    border: 0 !important;
    border-bottom: 1px solid #dbe4ef !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    margin-bottom: 0 !important;
    padding: 0.65rem 0.8rem !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
    display: block;
    margin: 0;
    padding: 0;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li {
    list-style: none;
    margin: 0;
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.7rem 0.8rem !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #4f46e5 !important;
    box-shadow: none !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a:hover {
    background: linear-gradient(180deg, #f3f7ff 0%, #f8fbff 100%) !important;
    color: #4338ca !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:last-child a {
    border-bottom: 0 !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a i {
    width: 1rem;
    text-align: center;
    opacity: 0.95;
}

.top-header-right a[href*='language='][class*='bg-indigo-500'] {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.2);
}

@media screen and (max-width: 1024px) {
    .navigation-bar {
        z-index: 40 !important;
        position: relative;
        top: 0 !important;
    }

    .navigation-bar .nav-wrapper {
        padding: 0 12px;
        z-index: 41;
    }

    .nav-wrapper .nav-links {
        z-index: 180;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        line-height: 1.2 !important;
        scrollbar-width: thin;
        width: min(90vw, 360px);
        max-width: calc(100vw - 12px);
        padding: 0 0 12px;
        position: fixed !important;
        top: 0 !important;
        left: -110% !important;
        height: 100svh !important;
        max-height: 100svh !important;
        margin: 0 !important;
        background: #f8fafc !important;
        box-shadow: inset -1px 0 0 #e2e8f0 !important;
        display: block !important;
        transition: left 0.2s ease;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    .nav-wrapper #menu-btn:checked ~ .nav-links {
        left: 0 !important;
    }

    .navigation-bar:has(#menu-btn:checked) {
        z-index: 220 !important;
    }

    .nav-wrapper #menu-btn:not(:checked) ~ .nav-links {
        left: -110% !important;
    }

    .nav-links li {
        width: 100%;
        margin: 1px 4px !important;
        float: none !important;
        display: block !important;
    }

    .nav-links .desktop-item,
    .nav-links .mega-box {
        display: none !important;
    }

    .navigation-bar .mobile-menu-trigger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 52;
    }

    .nav-wrapper #menu-btn:checked ~ .mobile-menu-trigger {
        opacity: 0;
        pointer-events: none;
    }

    .nav-wrapper .close-btn {
        display: none !important;
    }

    .nav-links .mobile-item {
        display: flex !important;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        border: 0;
        background: #059669;
        color: #ffffff;
        font-size: clamp(14px, 1.7vw, 15px) !important;
        font-weight: 500;
        line-height: 1.2;
        padding: 8px 11px !important;
        border-left: 2px solid transparent;
        border-radius: 0.4rem;
        text-align: left;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .nav-links > li.active > .mobile-item,
    .nav-links .mobile-item:hover {
        background: #047857;
        border-left-color: #ffffff;
        color: #ffffff;
        box-shadow: none !important;
    }

    .nav-links .mobile-item:focus-visible {
        outline: 2px solid rgba(5, 150, 105, 0.35);
        outline-offset: 1px;
    }

    .mobile-item-caret {
        font-size: 12px;
        line-height: 1;
        transition: transform 0.2s ease;
    }

    .mobile-item-caret.is-open {
        transform: rotate(180deg);
    }

    .nav-links .mobile-submenu {
        display: block;
        background: #edf2f7;
        margin: 0 4px 2px;
        padding: 1px 0;
        border: 1px solid #e2e8f0;
        border-left: 2px solid #cbd5e1;
        border-radius: 0.4rem;
    }

    .nav-links .mobile-section {
        padding: 0;
    }

    .nav-links .mobile-section > header {
        color: #047857;
        background: #dce9e2;
        border-bottom: 1px solid #d1fae5;
        font-size: clamp(13px, 1.45vw, 14px);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.045em;
        padding: 4px 9px;
        line-height: 1.25;
    }

    .nav-links .mobile-section > header button {
        line-height: 1.25 !important;
        min-height: 1.35rem !important;
    }

    .nav-links .mobile-links {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .nav-links .mobile-links li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-links .mobile-links li a {
        color: #334155 !important;
        display: block;
        padding: 5px 10px !important;
        font-size: clamp(12px, 1.25vw, 13px) !important;
        line-height: 1.25;
        border-left: 2px solid transparent;
        text-decoration: none;
        white-space: normal;
        transition: background-color 0.18s ease, border-color 0.18s ease;
    }

    .nav-links .mobile-links li a:hover,
    .nav-links .mobile-links li a.link-active {
        background: #059669;
        border-left-color: #059669;
        color: #ffffff !important;
    }

    .nav-wrapper .close-btn {
        position: sticky;
        top: 0;
        z-index: 181;
        display: flex !important;
        justify-content: flex-end;
        width: 100%;
        margin: 0 !important;
        padding: 10px 12px 8px;
        color: #0f172a;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.95) 100%);
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .nav-wrapper #menu-btn:not(:checked) ~ .nav-links .close-btn {
        display: none !important;
    }

    .nav-wrapper #menu-btn:checked ~ .nav-links .close-btn {
        display: flex !important;
    }

    .nav-wrapper #menu-btn:checked ~ .nav-links {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
        display: block !important;
    }

    .nav-wrapper .nav-links::-webkit-scrollbar {
        width: 6px;
    }

    .nav-wrapper .nav-links::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.35);
        border-radius: 8px;
    }

    .dark .nav-wrapper .nav-links {
        background: #111827 !important;
        box-shadow: inset -1px 0 0 #374151 !important;
    }

    .dark .nav-links .mobile-item {
        background: #1f2937;
        color: #a7f3d0;
    }

    .dark .nav-links > li.active > .mobile-item,
    .dark .nav-links .mobile-item:hover {
        background: #f8fafc;
        border-left-color: #10b981;
        color: #047857;
    }

    .dark .nav-links .mobile-item:focus-visible {
        outline-color: rgba(52, 211, 153, 0.35);
    }

    .dark .nav-links .mobile-submenu {
        background: #1f2937;
        border-color: #374151;
        border-left-color: #4b5563;
    }

    .dark .nav-links .mobile-section > header {
        color: #a7f3d0;
        background: rgba(5, 150, 105, 0.16);
        border-bottom-color: rgba(52, 211, 153, 0.2);
    }

    .dark .nav-links .mobile-links li a {
        color: #cbd5e1 !important;
    }

    .dark .nav-links .mobile-links li a:hover,
    .dark .nav-links .mobile-links li a.link-active {
        background: #f8fafc;
        border-left-color: #10b981;
        color: #047857 !important;
    }

    .dark .nav-wrapper .close-btn {
        color: #e5e7eb;
        background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.95) 100%);
        border-bottom-color: #374151;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    }
}

@media screen and (max-width: 1200px) {
    .modal,
    .modal-open .modal,
    .swal2-container {
        z-index: 1000 !important;
    }

    .navigation-bar {
        isolation: isolate;
    }

    /* Billing/receipt responsive utility: shared across modules */
    .receipt-entry-responsive,
    .receipt-entry-responsive * {
        box-sizing: border-box;
    }

    .receipt-entry-responsive {
        max-width: 100%;
        overflow-x: hidden;
    }

    #customer_id + span.select2.select2-container.select2-container--default,
    #customer_id+span.select2.select2-container.select2-container--default {
        width: 100% !important;
        max-width: 100% !important;
    }

    .receipt-entry-responsive .select2-container,
    .receipt-entry-responsive .select2-selection,
    .receipt-entry-responsive .select2-selection__rendered {
        max-width: 100% !important;
    }

    .receipt-entry-responsive .receipt-form-row,
    .receipt-entry-responsive .receipt-info-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 0.75rem;
    }

    .receipt-entry-responsive .receipt-form-row > div,
    .receipt-entry-responsive .receipt-info-row > div {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: initial !important;
    }

    .receipt-entry-responsive .receipt-form-row input,
    .receipt-entry-responsive .receipt-form-row select,
    .receipt-entry-responsive .receipt-form-row textarea,
    .receipt-entry-responsive .receipt-info-row input,
    .receipt-entry-responsive .receipt-info-row select,
    .receipt-entry-responsive .receipt-info-row textarea,
    .receipt-entry-responsive .receipt-form-row .col-span-4,
    .receipt-entry-responsive .receipt-info-row .col-span-4 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .receipt-entry-responsive .payment-details-header,
    .receipt-entry-responsive .payment-details-header .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .receipt-entry-responsive .receipt-customer-block {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 100% !important;
        flex-wrap: wrap;
        align-items: stretch;
        grid-column: 1 / -1;
    }

    .receipt-entry-responsive .receipt-customer-inputs-wrap,
    .receipt-entry-responsive .receipt-customer-inputs-row,
    .receipt-entry-responsive .receipt-customer-select-wrap,
    .receipt-entry-responsive .customer-select-container,
    .receipt-entry-responsive .receipt-customer-action-wrap {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .receipt-entry-responsive .receipt-customer-inputs-row,
    .receipt-entry-responsive .receipt-customer-select-wrap {
        width: 100%;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 0.75rem;
    }

    .receipt-entry-responsive .receipt-customer-inputs-row > div,
    .receipt-entry-responsive .receipt-customer-select-wrap > div {
        min-width: 0 !important;
        flex: 1 1 220px;
        width: 100%;
        max-width: 100%;
    }

    .receipt-entry-responsive .receipt-form-row > div:nth-child(1),
    .receipt-entry-responsive .receipt-form-row > div:nth-child(2) {
        grid-column: span 1;
    }

    .receipt-entry-responsive .payment-details-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
        overflow-y: auto;
    }

    .receipt-entry-responsive .payment-details-table {
        display: table !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed;
    }

    .receipt-entry-responsive .payment-details-table th,
    .receipt-entry-responsive .payment-details-table td {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    /* Tablet/mobile compact columns for payment details table */
    .receipt-entry-responsive .payment-details-table th:nth-child(6),
    .receipt-entry-responsive .payment-details-table th:nth-child(7),
    .receipt-entry-responsive .payment-details-table th:nth-child(8),
    .receipt-entry-responsive .payment-details-table th:nth-child(9),
    .receipt-entry-responsive .payment-details-table th:nth-child(10),
    .receipt-entry-responsive .payment-details-table th:nth-child(12),
    .receipt-entry-responsive .payment-details-table td:nth-child(6),
    .receipt-entry-responsive .payment-details-table td:nth-child(7),
    .receipt-entry-responsive .payment-details-table td:nth-child(8),
    .receipt-entry-responsive .payment-details-table td:nth-child(9),
    .receipt-entry-responsive .payment-details-table td:nth-child(10),
    .receipt-entry-responsive .payment-details-table td:nth-child(12) {
        display: none !important;
    }

    .receipt-entry-responsive .payment-details-table th,
    .receipt-entry-responsive .payment-details-table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(1),
    .receipt-entry-responsive .payment-details-table td:nth-child(1) {
        width: 6% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(2),
    .receipt-entry-responsive .payment-details-table td:nth-child(2) {
        width: 8% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(3),
    .receipt-entry-responsive .payment-details-table td:nth-child(3) {
        width: 14% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(4),
    .receipt-entry-responsive .payment-details-table td:nth-child(4) {
        width: 13% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(5),
    .receipt-entry-responsive .payment-details-table td:nth-child(5) {
        width: 39% !important;
        white-space: normal !important;
        word-break: break-word;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(11),
    .receipt-entry-responsive .payment-details-table td:nth-child(11) {
        width: 20% !important;
        text-align: right;
    }

    .receipt-entry-responsive .payment-details-table tfoot,
    .receipt-entry-responsive .payment-details-table tfoot tr,
    .receipt-entry-responsive .payment-details-table tfoot td,
    .receipt-entry-responsive .payment-details-table tfoot th {
        display: none !important;
    }

    .receipt-entry-responsive .payment-details-mobile-total {
        display: grid !important;
        grid-template-columns: 1fr auto auto;
        gap: 0.5rem;
        align-items: center;
        background: #e2e8f0;
        border: 1px solid #cbd5e1;
        border-top: 0;
        padding: 0.5rem 0.625rem;
        font-size: 12px;
        color: #475569;
        width: 100%;
    }

    .receipt-entry-responsive .payment-details-mobile-total .label {
        font-weight: 700;
        text-align: right;
    }

    .receipt-entry-responsive .payment-details-mobile-total .value {
        font-weight: 600;
        text-align: right;
        min-width: 64px;
    }

    /* Compact table mode only shows Net Amount column visibly; hide extra summary values */
    .receipt-entry-responsive .payment-details-mobile-total {
        grid-template-columns: 1fr auto !important;
    }

    .receipt-entry-responsive .payment-details-mobile-total .optional {
        display: none !important;
    }

    /* Payment mode / cash-bank / cheque rows */
    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
        align-items: start !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div {
        min-width: 0 !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center.gap-2 {
        flex-wrap: wrap;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > label {
        width: 110px !important;
        flex: 0 0 110px !important;
        min-width: 110px !important;
        white-space: normal !important;
        line-height: 1.2;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > .w-2\/3,
    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > div:not(label) {
        width: calc(100% - 118px) !important;
        flex: 1 1 200px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .receipt-entry-responsive .payment-mode-select,
    .receipt-entry-responsive .cash-bank-select,
    .receipt-entry-responsive .cheque-bank-select,
    .receipt-entry-responsive .payment-mode-select + .select2-container,
    .receipt-entry-responsive .cash-bank-select + .select2-container,
    .receipt-entry-responsive .cheque-bank-select + .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Remarks row */
    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center {
        white-space: normal !important;
        align-items: stretch !important;
    }

    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center > .w-full.flex.gap-2 {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem !important;
    }

    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center .w-1\/2 {
        width: 100% !important;
        min-width: 0 !important;
    }

    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center .w-1\/2 > .flex.gap-4.whitespace-nowrap {
        display: grid !important;
        grid-template-columns: minmax(115px, 30%) minmax(0, 1fr);
        gap: 0.5rem !important;
        white-space: normal !important;
        align-items: center;
    }

    /* Footer actions row */
    .receipt-entry-responsive .py-4.border-t.border-gray-200 > .flex.justify-between.space-x-2 {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
        justify-content: space-between !important;
    }

    .receipt-entry-responsive .py-4.border-t.border-gray-200 > .flex.justify-between.space-x-2 > div:last-child {
        margin-left: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    .receipt-entry-responsive .payment-details-header {
        align-items: flex-start !important;
    }

    .receipt-entry-responsive .payment-details-header > .flex {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 900px) {
    .receipt-entry-responsive .receipt-form-row {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .receipt-entry-responsive .receipt-form-row > div {
        grid-column: 1 / -1 !important;
    }

    .receipt-entry-responsive .receipt-form-row .p-1.rounded-sm > div.flex {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }
}

@media screen and (max-width: 640px) {
    .receipt-entry-responsive .receipt-form-row,
    .receipt-entry-responsive .receipt-info-row,
    .receipt-entry-responsive .receipt-customer-block,
    .receipt-entry-responsive .receipt-customer-inputs-row,
    .receipt-entry-responsive .receipt-customer-select-wrap {
        grid-template-columns: minmax(0, 1fr) !important;
        display: grid !important;
    }

    .receipt-entry-responsive .receipt-form-row > div,
    .receipt-entry-responsive .receipt-info-row > div,
    .receipt-entry-responsive .receipt-customer-inputs-row > div,
    .receipt-entry-responsive .receipt-customer-select-wrap > div {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-basis: 100% !important;
    }

    .receipt-entry-responsive .customer-search-hint {
        position: static !important;
        white-space: normal !important;
        margin-top: 0.25rem;
        display: block;
    }

    /* Keep mobile table readable without horizontal scroll */
    .receipt-entry-responsive .payment-details-table {
        table-layout: auto !important;
    }

    .receipt-entry-responsive .payment-details-table th,
    .receipt-entry-responsive .payment-details-table td {
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        font-size: 10px !important;
        line-height: 1.2;
    }

    /* Override Tailwind width utility classes like w-1/8 on mobile so visible columns can fill width */
    .receipt-entry-responsive .payment-details-table th[class*="w-"],
    .receipt-entry-responsive .payment-details-table td[class*="w-"] {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(1),
    .receipt-entry-responsive .payment-details-table th:nth-child(2),
    .receipt-entry-responsive .payment-details-table td:nth-child(1),
    .receipt-entry-responsive .payment-details-table td:nth-child(2) {
        width: 22px !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(3),
    .receipt-entry-responsive .payment-details-table td:nth-child(3) {
        width: 18% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(4),
    .receipt-entry-responsive .payment-details-table td:nth-child(4) {
        width: 16% !important;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(5),
    .receipt-entry-responsive .payment-details-table td:nth-child(5) {
        width: 42% !important;
        white-space: normal !important;
        word-break: break-word;
        min-width: 0;
    }

    .receipt-entry-responsive .payment-details-table th:nth-child(11),
    .receipt-entry-responsive .payment-details-table td:nth-child(11) {
        width: 24% !important;
        min-width: 0;
        text-align: right;
    }

    .receipt-entry-responsive .payment-details-mobile-total {
        grid-template-columns: 1fr auto;
        row-gap: 0.25rem;
        font-size: 11px;
    }

    .receipt-entry-responsive .payment-details-mobile-total .label {
        text-align: left;
    }

    .receipt-entry-responsive .payment-details-mobile-total .value {
        min-width: 52px;
    }

    .receipt-entry-responsive .payment-details-mobile-total .optional {
        display: none !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center,
    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center.gap-2 {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > label {
        width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
    }

    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > .w-2\/3,
    .receipt-entry-responsive .grid.grid-cols-5.gap-4.items-center > div.flex.w-full.items-center > div:not(label) {
        width: 100% !important;
        flex: 1 1 auto !important;
    }

    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center > .w-full.flex.gap-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .receipt-entry-responsive .flex.gap-4.whitespace-nowrap.items-center .w-1\/2 > .flex.gap-4.whitespace-nowrap {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .receipt-entry-responsive .py-4.border-t.border-gray-200 > .flex.justify-between.space-x-2 {
        flex-direction: column;
        align-items: stretch;
    }

    .receipt-entry-responsive .py-4.border-t.border-gray-200 > .flex.justify-between.space-x-2 > div:last-child {
        margin-left: 0;
        justify-content: flex-start;
    }

    .receipt-entry-responsive .py-4.border-t.border-gray-200 .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Desktop header breathing space + profile row backgrounds */
@media screen and (min-width: 641px) {
    .top-header-main {
        padding: 0.55rem 0.85rem !important;
    }

    .top-header-right {
        gap: 0.55rem !important;
        padding: 0.35rem 0.45rem !important;
        border-radius: 0.8rem !important;
    }

    .header-tools-panel {
        gap: 0.55rem !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form > a {
        border-bottom: 1px solid #dbe4ef !important;
        background: #ffffff !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right {
        min-width: 18.5rem !important;
        width: 18.5rem !important;
        max-width: 18.5rem !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(1) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
        border-left: 2px solid #bfdbfe !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(3) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #f6f0ff 100%) !important;
        border-left: 2px solid #ddd6fe !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(4) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
        border-left: 2px solid #bfdbfe !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(5) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #fff1f1 100%) !important;
        border-left: 2px solid #fca5a5 !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(6) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
        border-left: 2px solid #93c5fd !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:hover > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:hover > form > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:focus-within > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:focus-within > form > a {
        background: linear-gradient(180deg, #edf4ff 0%, #e6efff 100%) !important;
        box-shadow: inset 0 0 0 1px #cfe0ff !important;
    }
}

/* Desktop header tools polish (web only) */
@media screen and (min-width: 1025px) {
    :root {
        --header-tool-radius: 0.625rem;
    }

    .top-header-right .header-tools-panel {
        gap: 0.45rem !important;
    }

    /* Reduce space before profile trigger */
    .top-header-right {
        gap: 0.35rem !important;
    }

    .top-header-right > hr {
        margin-left: 0.2rem !important;
        margin-right: 0.2rem !important;
    }

    .header-tools-panel > div:first-child > span:last-child {
        border-radius: var(--header-tool-radius) !important;
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    .top-header-right .header-tools-panel > .relative.inline-flex li {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .top-header-right .header-tool-fiscal > .btn {
        min-height: 2rem !important;
        padding: 0.35rem 0.6rem !important;
        border-radius: var(--header-tool-radius) !important;
    }

    /* Language toggle should feel like fiscal-year control */
    .top-header-right .header-tool-language > a[href*='language='] {
        min-height: 2rem !important;
        height: 2rem !important;
        min-width: 5.2rem !important;
        width: 5.2rem !important;
        padding: 0.2rem !important;
        border-radius: var(--header-tool-radius) !important;
        border: 1px solid #dbe4ef !important;
        background: linear-gradient(180deg, #ffffff 0%, #f6f1ff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    }

    .top-header-right .header-tool-language > a .header-language-toggle-thumb {
        border-radius: 0.45rem !important;
    }

    /* Branch unit block: clear bounded control */
    .top-header-right .header-tool-branch {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        padding: 0.22rem 0.35rem !important;
        /*border: 1px solid #dbe4ef !important;*/
        border-radius: var(--header-tool-radius) !important;
        /*background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;*/
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    }

    .top-header-right .header-tool-branch .font-bold.text-sm {
        margin: 0 !important;
        color: #334155 !important;
        white-space: nowrap !important;
    }

    .top-header-right .header-tool-branch select {
        min-height: 1.95rem !important;
        border-radius: 0.5rem !important;
        border-color: #dbe4ef !important;
        background: #ffffff !important;
        padding-left: 0.55rem !important;
        padding-right: 1.75rem !important;
    }

    /* Notifications: grouped as one card, with inner icon triggers */
    .top-header-right .header-tool-count-notification,
    .top-header-right .header-tool-user-notification {
        display: inline-flex !important;
        align-items: center !important;
        padding: 0 !important;
        border: 1px solid #dbe4ef !important;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        min-height: 2rem !important;
    }

    .top-header-right .header-tool-count-notification {
        border-radius: var(--header-tool-radius) 0 0 var(--header-tool-radius) !important;
        margin-right: 0 !important;
        border-right: 0 !important;
    }

    .top-header-right .header-tool-user-notification {
        border-radius: 0 var(--header-tool-radius) var(--header-tool-radius) 0 !important;
        margin-left: 0 !important;
    }

    .top-header-right .header-tool-count-notification > .count-notification-root,
    .top-header-right .header-tool-user-notification > .user-notification-bell-root {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        min-height: 2rem !important;
        padding: 0.16rem 0.28rem !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .top-header-right .header-tool-count-notification > .count-notification-root {
        border-right: 1px solid #e6edf6 !important;
    }

    .top-header-right .header-tool-count-notification > .count-notification-root > .relative,
    .top-header-right .header-tool-user-notification > .user-notification-bell-root > .relative {
        min-height: auto !important;
        width: 100% !important;
        padding: 0.2rem 0.28rem !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .top-header-right .header-tool-count-notification:hover,
    .top-header-right .header-tool-user-notification:hover {
        background: linear-gradient(180deg, #f3f8ff 0%, #ecf3ff 100%) !important;
    }

    .top-header-right .header-tool-count-notification:hover > .count-notification-root > .relative,
    .top-header-right .header-tool-user-notification:hover > .user-notification-bell-root > .relative,
    .top-header-right .header-tool-count-notification > .count-notification-root > .relative:hover,
    .top-header-right .header-tool-user-notification > .user-notification-bell-root > .relative:hover {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Give the count-notification popup a little more breathing room without changing modal defaults */
    .top-header-right .header-tool-count-notification .modal-box,
    .top-header-right .header-tool-count-notification .customModal > .modal-box {
        padding: 1.75rem !important;
        margin: 0.25rem auto !important;
    }
}

@media screen and (max-width: 1024px) {
    .navigation-header {
        position: relative;
        z-index: 70;
        background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
        box-shadow: var(--app-header-shadow);
    }

    .navigation-header > header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        z-index: 80 !important;
        border-bottom: 1px solid var(--app-header-border) !important;
        box-shadow: none !important;
        background: linear-gradient(180deg, #fafdff 0%, #ffffff 65%, #f8fbff 100%) !important;
    }

    .top-header-main::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            radial-gradient(circle at 8% 16%, rgba(14, 165, 233, 0.05), transparent 44%),
            radial-gradient(circle at 88% 18%, rgba(5, 150, 105, 0.06), transparent 46%);
    }

    .top-header-main {
        position: relative;
        isolation: isolate;
    }

    .top-header-main > * {
        position: relative;
        z-index: 1;
    }

    .navigation-bar {
        z-index: 55 !important;
        background: linear-gradient(90deg, var(--app-accent) 0%, #0ea56f 100%) !important;
        box-shadow: 0 6px 14px rgba(5, 150, 105, 0.18);
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        border-bottom: 1px solid rgba(4, 120, 87, 0.55);
    }

    .top-header-main {
        height: auto !important;
        min-height: 3rem;
        padding: 0.5rem 0.75rem;
        align-items: flex-start;
        gap: 0.5rem;
        overflow: visible;
    }

    .top-header-left {
        min-width: 0;
        flex: 1 1 auto;
        background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248,251,255,0.96) 100%);
        border: 1px solid #e4edf5;
        border-radius: 0.75rem;
        padding: 0.45rem 0.6rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .top-header-left .org-meta {
        display: none;
    }

    .top-header-right {
        flex: 0 0 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: flex-start;
        gap: 0.35rem !important;
        min-width: 0;
        background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(249,252,255,0.95) 100%);
        border: 1px solid #e4edf5;
        border-radius: 0.75rem;
        padding: 0.45rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .top-header-right li {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    .top-header-right li > div:not(.header-tool-count-notification):not(.header-tool-user-notification) {
        background: rgba(255, 255, 255, 0.88);
        border: 1px solid #e7edf5;
        border-radius: 0.5rem;
        padding: 0.25rem 0.4rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .top-header-right a[href*='language='] {
        border: 1px solid #dceafc;
        background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
        border-radius: 0.5rem;
    }

    .top-header-right > .relative.inline-flex:last-child {
        z-index: 70;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        z-index: 90 !important;
    }

    .top-header-right .relative,
    .top-header-right .relative.inline-flex {
        z-index: 85;
    }

    .top-header-right .absolute,
    .top-header-right .origin-top-right {
        z-index: 130 !important;
    }

    .top-header-right li > livewire\:actions\.user-notification-bell [x-show="open"] {
        width: min(94vw, 23rem) !important;
        max-width: min(94vw, 23rem) !important;
        right: 0 !important;
        left: auto !important;
        z-index: 145 !important;
    }

    .top-header-right .relative,
    .top-header-right .relative.inline-flex {
        z-index: 85;
    }

    .top-header-right .absolute,
    .top-header-right .origin-top-right {
        z-index: 130 !important;
    }

    .top-header-right .inline-flex.h-2\.5.w-2\.5,
    .top-header-right [class*='notification'],
    .top-header-right .fa-bell,
    .top-header-right svg {
        flex-shrink: 0;
    }

    .top-header-right select {
        max-width: 9rem;
    }

    .top-header-left .text-md,
    .top-header-left .text-md * {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-content-scroll {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
        max-height: none !important;
        margin-top: 0.5rem !important;
    }

    .searchDrawer > .modal-box,
    .customModal > .modal-box,
    .searchModal > .modal-box,
    .searchModalOpening > .modal-box,
    .settleAmountModal > .modal-box,
    .settleAmountViewModal > .modal-box,
    .modal-box {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        min-width: auto !important;
    }
}

@media screen and (max-width: 768px) {
    .top-header-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start !important;
        gap: 0.4rem !important;
        overflow: visible !important;
    }

    .top-header-left {
        width: 100%;
        grid-column: 1;
    }

    .top-header-right {
        grid-column: 2;
        width: auto;
    }

    .top-header-right {
        display: grid !important;
        grid-template-columns: auto;
        grid-auto-rows: auto;
        justify-items: end !important;
        align-items: start !important;
        overflow: visible !important;
        padding: 0 !important;
        gap: 0.35rem !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        width: auto !important;
        max-width: min(60vw, 15.5rem) !important;
    }

    .top-header-right > * {
        flex: 0 0 auto;
        min-width: 0;
        width: auto;
    }

    .header-user-group {
        grid-row: 1;
        grid-column: 1;
        width: auto !important;
        max-width: min(58vw, 14rem);
        justify-self: end;
    }

    .header-tools-toggle {
        display: inline-flex !important;
        grid-row: 2;
        grid-column: 1;
        align-items: center;
        gap: 0.45rem;
        justify-content: space-between;
        min-height: 2.15rem;
        padding: 0.35rem 0.6rem;
        border: 1px solid #dbe4ef;
        border-radius: 0.625rem;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        color: #334155;
        font-size: 0.75rem;
        font-weight: 600;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        width: auto;
        min-width: 9.5rem;
        max-width: min(58vw, 14rem);
    }

    .header-tools-group {
        grid-row: 2;
        grid-column: 1;
        width: auto;
        justify-self: end;
    }

    .header-tools-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        position: absolute;
        top: calc(100% + 0.35rem);
        right: 0;
        left: auto;
        width: min(94vw, 24rem);
        max-width: min(94vw, 24rem);
        z-index: 135;
        border: 1px solid #dbe4ef;
        border-radius: 0.85rem;
        background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
        box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
        padding: 0.5rem;
        margin-top: 0;
        overflow: visible;
    }

    .header-tools-panel > div:first-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    .header-tools-panel > div:first-child > span:last-child {
        width: 100%;
        justify-content: center;
    }

    .top-header-right {
        position: relative;
    }

    .header-tools-panel > .relative.inline-flex {
        width: 100%;
        margin: 0 !important;
        grid-column: 1 / -1;
    }

    .header-tools-panel > .relative.inline-flex > div:first-child {
        width: 100%;
    }

    .header-tools-panel > .relative.inline-flex li {
        margin: 0;
    }

    .top-header-right li {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        justify-content: stretch !important;
        width: 100%;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
        white-space: normal;
        background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
        border: 1px solid #e4edf5;
        border-radius: 0.75rem;
        padding: 0.5rem;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
    }

    .top-header-right li > * {
        min-width: 0;
    }

    .top-header-right li > div:not(.header-tool-count-notification):not(.header-tool-user-notification) {
        width: 100%;
        box-sizing: border-box;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        border: 1px solid #e3ebf4;
        border-radius: 0.625rem;
        padding: 0.45rem 0.55rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .top-header-right li > .header-tool-fiscal {
        grid-column: 1 / 2;
    }

    .top-header-right li > .header-tool-language {
        grid-column: 2 / 3;
        align-self: stretch;
        min-height: 100%;
        width: 100%;
    }

    .top-header-right li > .header-tool-language > .btn {
        width: 100%;
        height: 100%;
        min-height: 3rem;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.4rem !important;
    }

    .top-header-right li > .header-tool-fiscal > .btn,
    .top-header-right li > .header-tool-language > .btn,
    .top-header-right li > .header-tool-branch,
    .top-header-right li > .header-tool-count-notification > *,
    .top-header-right li > .header-tool-user-notification > * {
        transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    }

    .top-header-right li > .header-tool-fiscal > .btn:hover,
    .top-header-right li > .header-tool-language > .btn:hover,
    .top-header-right li > .header-tool-branch:hover,
    .top-header-right li > .header-tool-count-notification > *:hover,
    .top-header-right li > .header-tool-user-notification > *:hover {
        border-color: #cddced !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right li > .header-tool-count-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification > div > .relative:hover {
        background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%) !important;
        border-color: #cddced !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right li > .header-tool-branch {
        grid-column: 1 / -1;
    }

    .top-header-right li > .header-tool-count-notification {
        grid-column: 1 / 2;
        width: 100%;
    }

    .top-header-right li > .header-tool-user-notification {
        grid-column: 2 / 3;
        width: 100%;
    }

    .top-header-right li > .header-tool-count-notification > *,
    .top-header-right li > .header-tool-user-notification > * {
        width: 100%;
        display: block;
    }

    .top-header-right li > .header-tool-count-notification > div,
    .top-header-right li > .header-tool-user-notification > div {
        width: 100%;
        height: 100%;
        min-height: 3rem;
    }

    .top-header-right li > .header-tool-count-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification > div > .relative {
        width: 100%;
        min-height: 3rem;
        border: 1px solid #e3ebf4 !important;
        border-radius: 0.625rem !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        padding: 0.45rem 0.55rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .top-header-right li > .header-tool-count-notification > div > .relative > *,
    .top-header-right li > .header-tool-user-notification > div > .relative > * {
        margin-left: 0 !important;
    }

    .top-header-right li > div:not(.header-tool-count-notification):not(.header-tool-user-notification) > div {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .top-header-right li > a,
    .top-header-right li > livewire\:actions\.count-notification,
    .top-header-right li > livewire\:actions\.user-notification-bell {
        justify-self: start;
        width: 100%;
    }

    .top-header-left .logo img {
        width: 2.5rem;
    }

    .top-header-left .text-md {
        font-size: 0.875rem !important;
    }

    .top-header-right .font-bold.text-sm {
        display: inline-flex;
        align-items: center;
        font-size: 0.75rem !important;
        color: #1f2937;
        line-height: 1.2;
    }

    .top-header-right select,
    .top-header-right .p-1,
    .top-header-right .w-48 {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 2.2rem;
        border-color: #d9e2ee !important;
        border-radius: 0.45rem !important;
        background-color: #ffffff !important;
    }

    .top-header-right li > div .font-bold.text-sm {
        margin-bottom: 0.2rem;
        color: #0f172a;
    }

    .top-header-right a[href*='language='] {
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0.45rem 0.55rem !important;
        min-height: 2.2rem;
        width: 100%;
        box-sizing: border-box;
    }

    .header-language-option.header-language-option-active {
        background: #4f46e5 !important;
        border-color: #4f46e5 !important;
        color: #ffffff !important;
    }

    .header-language-option.header-language-option-active i,
    .header-language-option.header-language-option-active span {
        color: #ffffff !important;
    }

    .top-header-right a[href*='language='][class*='bg-indigo-500'] {
        background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
        border-color: #4f46e5 !important;
        color: #fff !important;
    }

    .top-header-right li > livewire\:actions\.count-notification,
    .top-header-right li > livewire\:actions\.user-notification-bell {
        width: 100%;
    }

    .top-header-right li > livewire\:actions\.count-notification > *,
    .top-header-right li > livewire\:actions\.user-notification-bell > * {
        width: 100%;
    }

    .top-header-right li > livewire\:actions\.count-notification > div,
    .top-header-right li > livewire\:actions\.user-notification-bell > div {
        width: 100%;
    }

    .top-header-right li > livewire\:actions\.count-notification > div > .relative,
    .top-header-right li > livewire\:actions\.user-notification-bell > div > .relative {
        min-height: 2.2rem;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 0.35rem 0.55rem;
        border: 1px solid #e3ebf4;
        border-radius: 0.625rem;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .top-header-right li > livewire\:actions\.user-notification-bell button {
        width: 100%;
        min-height: 2.2rem;
        justify-content: flex-start !important;
        border: 1px solid #e3ebf4 !important;
        border-radius: 0.625rem !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
        padding: 0.35rem 0.55rem !important;
    }

    .top-header-right li > livewire\:actions\.count-notification .badge-error,
    .top-header-right li > livewire\:actions\.user-notification-bell .badge-error {
        left: 0.7rem !important;
        top: -0.25rem !important;
        z-index: 2;
    }

    .top-header-right li > livewire\:actions\.count-notification,
    .top-header-right li > livewire\:actions\.user-notification-bell {
        position: relative;
        z-index: 110;
    }

    .top-header-right li > livewire\:actions\.count-notification .absolute,
    .top-header-right li > livewire\:actions\.user-notification-bell .absolute {
        z-index: 140 !important;
    }

    .top-header-right > hr {
        display: none !important;
    }

    .top-header-right > .relative.inline-flex:last-child {
        width: auto;
        max-width: 100%;
        align-self: start;
        z-index: 80;
    }

    .top-header-right > .relative.inline-flex:last-child button {
        width: auto;
        max-width: min(58vw, 14rem);
        justify-content: space-between;
        min-height: 2.4rem;
        padding: 0.45rem 0.55rem;
        border: 1px solid #dbe4ef;
        border-radius: 0.625rem;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .top-header-right > .relative.inline-flex:last-child .flex.items-center.truncate {
        min-width: 0;
        max-width: 100%;
    }

    .top-header-right > .relative.inline-flex:last-child .truncate.ml-2 {
        max-width: min(34vw, 96px);
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        top: calc(100% + 0.35rem) !important;
        right: 0 !important;
        left: auto !important;
        min-width: min(92vw, 20rem) !important;
        max-width: min(92vw, 22rem) !important;
        border-radius: 0.75rem !important;
        border-color: #dbe4ef !important;
        box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16) !important;
        z-index: 140 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right a {
        white-space: nowrap !important;
        line-height: 1.15 !important;
    }

    .top-header-right li > livewire\:actions\.user-notification-bell [x-show="open"] {
        right: 0 !important;
        left: auto !important;
        top: calc(100% + 0.35rem) !important;
        width: calc(100vw - 1.25rem) !important;
        max-width: calc(100vw - 1.25rem) !important;
        z-index: 220 !important;
    }

    .top-header-right {
        max-width: 100%;
        overflow: visible;
    }

    .navigation-bar .nav-wrapper {
        min-height: 2.75rem;
        display: flex;
        align-items: center;
        border-radius: 0;
        padding-top: 0.1rem;
        padding-bottom: 0.1rem;
    }

    .navigation-bar .mobile-menu-trigger {
        color: #f8fafc;
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .navigation-bar .mobile-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.14);
    }

    .page-content-scroll > * {
        max-width: 100%;
    }

    .page-content-scroll nav[aria-label="Breadcrumb"],
    .page-content-scroll .border.border-base-300,
    .page-content-scroll .rounded-md,
    .page-content-scroll .rounded-lg {
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-content-scroll [class*="grid"],
    .page-content-scroll [class*="flex"] {
        min-width: 0;
    }

    .page-content-scroll {
        margin-top: 0.2rem !important;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    table th,
    table td {
        white-space: nowrap;
    }
}

@media screen and (max-width: 520px) {
    .top-header-main {
        padding: 0.5rem 0.5rem !important;
    }

    .top-header-right li {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child {
        width: auto;
    }

    .top-header-right > .relative.inline-flex:last-child button {
        width: auto;
        justify-content: space-between;
    }

    .top-header-right > .relative.inline-flex:last-child .truncate.ml-2 {
        max-width: min(72vw, 240px);
    }

    .top-header-right li > div:not(.header-tool-count-notification):not(.header-tool-user-notification) {
        padding: 0.4rem 0.5rem;
    }

    .top-header-right li {
        gap: 0.35rem !important;
    }

    .header-tools-panel {
        width: min(96vw, 23rem) !important;
        max-width: min(96vw, 23rem) !important;
    }

    .header-user-group {
        max-width: min(82vw, 18rem);
    }

    .header-tools-group {
        max-width: min(56vw, 12rem);
    }

    .top-header-right > .relative.inline-flex:last-child .truncate.ml-2 {
        max-width: min(30vw, 82px);
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(90vw, 19rem) !important;
        min-width: min(90vw, 19rem) !important;
        max-width: min(90vw, 19rem) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        padding: 0.35rem !important;
        background: transparent !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li {
        margin: 0 0 0.35rem 0 !important;
        border-radius: 0.75rem !important;
        overflow: hidden;
        border: 1px solid #dfe8f3 !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:last-child {
        margin-bottom: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a {
        width: 100% !important;
        min-height: 2.9rem;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        padding: 0.75rem 0.9rem !important;
        border: 0 !important;
        border-bottom: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover {
        border-color: #cfdcec !important;
        background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%) !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a:hover {
        background: transparent !important;
        color: inherit !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) a { color: #4f46e5 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) a { color: #4338ca !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) a { color: #4f46e5 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) a { color: #3730a3 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) a { color: #7c3aed !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) a { color: #2563eb !important; }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) {
        border-color: #fee2e2 !important;
        background: linear-gradient(180deg, #fffafa 0%, #fff5f5 100%) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5):hover {
        border-color: #fecaca !important;
        background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) a {
        color: #dc2626 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) {
        border-color: #dbeafe !important;
        background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6):hover {
        border-color: #bfdbfe !important;
        background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a i {
        opacity: 1;
    }

    .top-header-right li > .header-tool-fiscal > .btn:hover,
    .top-header-right li > .header-tool-language > .btn:hover,
    .top-header-right li > .header-tool-count-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification > div > .relative:hover {
        background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%) !important;
        border-color: #cddced !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    /* Final mobile polish: profile dropdown full-width rows + quick-tool parity */
    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(94vw, 21rem) !important;
        min-width: min(94vw, 21rem) !important;
        max-width: min(94vw, 21rem) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li {
        display: block !important;
        padding: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.55rem !important;
        box-sizing: border-box !important;
        padding: 0.8rem 0.95rem !important;
        min-height: 3rem !important;
        border-radius: 0 !important;
        white-space: nowrap !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:focus-within {
        border-color: #cfdcec !important;
        box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) {
        background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%) !important;
        border-color: #d8e7ff !important;
    }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2),
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) {
        background: linear-gradient(180deg, #fbfaff 0%, #f4f1ff 100%) !important;
        border-color: #e7dffd !important;
    }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) {
        background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%) !important;
        border-color: #dbeafe !important;
    }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) {
        background: linear-gradient(180deg, #f7fffb 0%, #ecfdf5 100%) !important;
        border-color: #ccefdc !important;
    }

    /* Quick-tools card parity: notifications should look like fiscal/language cards */
    .top-header-right li > .header-tool-fiscal,
    .top-header-right li > .header-tool-language,
    .top-header-right li > .header-tool-count-notification,
    .top-header-right li > .header-tool-user-notification {
        width: 100%;
        min-width: 0;
    }

    .top-header-right li > .header-tool-fiscal > .btn,
    .top-header-right li > .header-tool-language > .btn {
        min-height: 3rem !important;
        border-radius: 0.625rem !important;
        border: 1px solid #dfe8f3 !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        color: #1f2937 !important;
    }

    .top-header-right li > .header-tool-count-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification button {
        min-height: 3rem !important;
        border-radius: 0.625rem !important;
        border-width: 1px !important;
        padding: 0.45rem 0.55rem !important;
        transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease !important;
    }

    .top-header-right li > .header-tool-count-notification > div > .relative {
        background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%) !important;
        border-color: #d6e6fb !important;
    }

    .top-header-right li > .header-tool-user-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification button {
        background: linear-gradient(180deg, #fbfcff 0%, #f2f5ff 100%) !important;
        border-color: #dfe4ff !important;
    }

    .top-header-right li > .header-tool-fiscal > .btn:hover,
    .top-header-right li > .header-tool-language > .btn:hover,
    .top-header-right li > .header-tool-count-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification button:hover {
        background: linear-gradient(180deg, #f8fbff 0%, #eaf3ff 100%) !important;
        border-color: #cddced !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right li > .header-tool-user-notification button {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        color: #334155 !important;
    }

    .header-language-option.header-language-option-active {
        background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
        border-color: #4f46e5 !important;
        box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22) !important;
    }

    /* Keep quick-tools cards simple and consistent (white-ish default + gray hover) */
    .top-header-right li > .header-tool-fiscal > .btn,
    .top-header-right li > .header-tool-language > .btn,
    .top-header-right li > .header-tool-count-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification > div > .relative,
    .top-header-right li > .header-tool-user-notification button {
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
        border-color: #dbe4ef !important;
        color: #334155 !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    }

    .top-header-right li > .header-tool-fiscal > .btn:hover,
    .top-header-right li > .header-tool-language > .btn:hover,
    .top-header-right li > .header-tool-count-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification > div > .relative:hover,
    .top-header-right li > .header-tool-user-notification button:hover {
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
        border-color: #cbd5e1 !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    /* Profile dropdown mobile: reset generic quick-tools LI styles and make rows full-width */
    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(94vw, 22rem) !important;
        min-width: min(94vw, 22rem) !important;
        max-width: min(94vw, 22rem) !important;
        overflow: visible !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        display: block !important;
        padding: 0.4rem !important;
        background: transparent !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 0 0.4rem 0 !important;
        width: 100% !important;
        white-space: normal !important;
        border-radius: 0.75rem !important;
        border: 1px solid #e2e8f0 !important;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        overflow: hidden !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:last-child {
        margin-bottom: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a {
        display: flex !important;
        align-items: center !important;
        gap: 0.6rem !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 0.8rem 0.95rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        border: 0 !important;
        background: transparent !important;
        justify-content: flex-start !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a span,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a span {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:focus-within {
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
        border-color: #cbd5e1 !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a:hover,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a:hover {
        background: transparent !important;
        color: inherit !important;
    }

    /* subtle row differentiation, still white-ish */
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) { border-color: #dbeafe !important; background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2),
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) { border-color: #e9d5ff !important; background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%) !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) { border-color: #dbeafe !important; background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) { border-color: #fecaca !important; background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%) !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) { border-color: #bfdbfe !important; background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important; }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) > form > a { color: #4f46e5 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) > form > a { color: #5b21b6 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) > form > a { color: #3730a3 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) > form > a { color: #dc2626 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) > form > a { color: #2563eb !important; }
}

.dark .navigation-header {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
}

.dark .navigation-header > header {
    background: linear-gradient(180deg, #111827 0%, #0f172a 70%, #111827 100%) !important;
    border-bottom-color: #243447 !important;
}

.dark .top-header-main::before {
    background:
        radial-gradient(circle at 8% 16%, rgba(56, 189, 248, 0.08), transparent 44%),
        radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.10), transparent 46%);
}

.dark .top-header-left,
.dark .top-header-right {
    background: linear-gradient(180deg, rgba(17,24,39,0.92) 0%, rgba(15,23,42,0.95) 100%) !important;
    border-color: #243447 !important;
    box-shadow: 0 1px 2px rgba(2, 6, 23, 0.25) !important;
}

.dark .top-header-right li {
    background: linear-gradient(180deg, rgba(17,24,39,0.9) 0%, rgba(15,23,42,0.95) 100%) !important;
    border-color: #243447 !important;
}

.dark .top-header-right li > div,
.dark .top-header-right li > livewire\:actions\.count-notification > div > .relative,
.dark .top-header-right li > livewire\:actions\.user-notification-bell > div > .relative,
.dark .top-header-right > .relative.inline-flex:last-child button {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

.dark .top-header-right a[href*='language='] {
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%) !important;
    border-color: #334155 !important;
}

.dark .top-header-right a[href*='language='][class*='bg-indigo-500'] {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

.dark .header-tools-toggle {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

.dark .header-tools-panel {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.5) !important;
}

.dark .top-header-right .font-bold.text-sm,
.dark .top-header-left .text-md,
.dark .top-header-left .text-md * {
    color: #e5e7eb !important;
}

.dark .top-header-right select,
.dark .top-header-right .p-1,
.dark .top-header-right .w-48 {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right,
.dark .top-header-right li > livewire\:actions\.user-notification-bell [x-show="open"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.5) !important;
}

.dark .top-header-right li > livewire\:actions\.user-notification-bell [x-show="open"] * {
    border-color: #334155;
}

.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right > .pt-0\.5.pb-2,
.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
    box-shadow: 0 1px 2px rgba(2, 6, 23, 0.25) !important;
}

.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a {
    color: #a5b4fc !important;
    border: 0 !important;
    border-bottom: 1px solid #334155 !important;
    border-radius: 0 !important;
}

.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a:hover {
    background: linear-gradient(180deg, #172036 0%, #111827 100%) !important;
    color: #c7d2fe !important;
}

.dark .top-header-right > .relative.inline-flex:last-child .origin-top-right > .pt-0\.5.pb-2 {
    border: 0 !important;
    border-bottom: 1px solid #334155 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}

/* Final header polish overrides (keep simple, shared web/mobile card look) */
.top-header-right .header-tool-fiscal > .btn,
.top-header-right .header-tool-language > .btn,
.top-header-right .header-tool-count-notification > div > .relative,
.top-header-right .header-tool-user-notification > div > .relative,
.top-header-right .header-tool-user-notification button {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border: 1px solid #dbe4ef !important;
    border-radius: 0.625rem !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.top-header-right .header-tool-fiscal > .btn {
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
    border-color: #cfe1fb !important;
}

.top-header-right .header-tool-language > .btn {
    background: linear-gradient(180deg, #ffffff 0%, #f6f1ff 100%) !important;
    border-color: #dfd0ff !important;
}

.top-header-right .header-tool-count-notification > div > .relative,
.top-header-right .header-tool-count-notification > div > .relative {
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
    border-color: #cfe1fb !important;
}

.top-header-right .header-tool-user-notification > div > .relative,
.top-header-right .header-tool-user-notification button {
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%) !important;
    border-color: #d7dee8 !important;
}

.top-header-right .header-tool-fiscal > .btn:hover,
.top-header-right .header-tool-language > .btn:hover,
.top-header-right .header-tool-count-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification button:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a {
    border-radius: 0 !important;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a > span,
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a > span {
    flex: 1 1 auto;
    min-width: 0;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) a {
    background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%) !important;
    border-left: 2px solid #bfdbfe;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) a,
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) a {
    background: linear-gradient(180deg, #ffffff 0%, #f4eeff 100%) !important;
    border-left: 2px solid #ddd6fe;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) a {
    background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%) !important;
    border-left: 2px solid #bfdbfe;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) a {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f0 100%) !important;
    border-left: 2px solid #fca5a5;
}
.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) a {
    background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%) !important;
    border-left: 2px solid #93c5fd;
}

.top-header-right > .relative.inline-flex:last-child .origin-top-right ul li a:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
}

@media screen and (max-width: 520px) {
    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(98vw, 26rem) !important;
        min-width: min(98vw, 26rem) !important;
        max-width: min(98vw, 26rem) !important;
        overflow: visible !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        display: block !important;
        padding: 0.4rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li {
        display: block !important;
        width: 100% !important;
        margin: 0 0 0.4rem 0 !important;
        padding: 0 !important;
        border-radius: 0.75rem !important;
        overflow: hidden !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: center !important;
        gap: 0.55rem !important;
        padding: 0.8rem 0.95rem !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        border-bottom: 0 !important;
        line-height: 1.2 !important;
        padding-right: 1rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > a span,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li > form > a span {
        display: block !important;
        flex: 1 1 auto !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-width: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:focus-within {
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
        border-color: #cbd5e1 !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(1) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%) !important;
        border-left: 2px solid #bfdbfe !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(3) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #f4eeff 100%) !important;
        border-left: 2px solid #ddd6fe !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(4) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%) !important;
        border-left: 2px solid #bfdbfe !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(5) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #fff0f0 100%) !important;
        border-left: 2px solid #fca5a5 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:nth-child(6) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%) !important;
        border-left: 2px solid #93c5fd !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:hover > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:focus-within > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul li:focus-within > form > a {
        background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    }
}

/* Mobile profile dropdown hard reset (prevents quick-tools LI grid styles from shrinking rows) */
@media screen and (max-width: 640px) {
    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(98vw, 26rem) !important;
        min-width: min(98vw, 26rem) !important;
        max-width: min(98vw, 26rem) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        display: block !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-self: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > form > a {
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0.6rem !important;
        box-sizing: border-box !important;
        padding: 0.82rem 0.95rem !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        border-radius: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #dbe4ef !important;
        box-shadow: none !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > a > span,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > form > a > span {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Simple polished row colors like previous UI (flat rows + separators) */
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(1) > form > a { background: #f8fbff !important; color: #4f46e5 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(3) > form > a { background: #fbf8ff !important; color: #5b21b6 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(4) > form > a { background: #f8fbff !important; color: #4338ca !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(5) > form > a { background: #fff7f7 !important; color: #dc2626 !important; }
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(6) > form > a { background: #f5faff !important; color: #2563eb !important; }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:last-child > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:last-child > form > a {
        border-bottom: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:hover > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:hover > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:focus-within > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:focus-within > form > a {
        background: #eef2f7 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        padding: 0 !important;
        border-top: 1px solid #dbe4ef !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        border: 1px solid #dbe4ef !important;
        border-radius: 0.75rem !important;
        overflow: hidden !important;
    }
}

/* Mobile profile dropdown: restore previous simple bordered style */
@media screen and (max-width: 640px) {
    .top-header-right > .relative.inline-flex:last-child {
        width: auto !important;
        max-width: min(62vw, 15.5rem) !important;
    }

    .top-header-right > .relative.inline-flex:last-child > button {
        width: auto !important;
        max-width: min(62vw, 15.5rem) !important;
        min-height: 2.35rem !important;
        border: 2px solid #1f2937 !important;
        border-radius: 0.625rem !important;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        padding: 0.35rem 0.55rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child .truncate.ml-2 {
        display: inline-block !important;
        max-width: min(36vw, 110px) !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right {
        width: min(96vw, 18rem) !important;
        min-width: min(96vw, 18rem) !important;
        max-width: min(96vw, 18rem) !important;
        border: 1px solid #dbe4ef !important;
        border-radius: 0.75rem !important;
        background: #ffffff !important;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14) !important;
        overflow: hidden !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right > .pt-0\.5.pb-2 {
        background: #ffffff !important;
        border-bottom: 1px solid #dbe4ef !important;
        padding: 0.7rem 0.9rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul {
        padding: 0 !important;
        border-top: 0 !important;
        background: #ffffff !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li {
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li > form > a {
        background: #ffffff !important;
        border: 0 !important;
        border-bottom: 1px solid #dbe4ef !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        padding: 0.75rem 0.9rem !important;
        min-height: 2.75rem !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:last-child > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:last-child > form > a {
        border-bottom: 0 !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(1) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(3) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(4) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(5) > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:nth-child(6) > form > a {
        background: #ffffff !important;
    }

    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:hover > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:hover > form > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:focus-within > a,
    .top-header-right > .relative.inline-flex:last-child .origin-top-right ul > li:focus-within > form > a {
        background: #f8fbff !important;
    }
}

/* Mobile profile trigger/dropdown restore (previous look) */
@media screen and (max-width: 640px) {
    .top-header-right > .relative.inline-flex.header-user-group {
        width: auto !important;
        max-width: min(62vw, 15.5rem) !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group > button {
        width: auto !important;
        max-width: min(62vw, 15.5rem) !important;
        min-height: 2.35rem !important;
        border: 2px solid #1f2937 !important;
        border-radius: 0.625rem !important;
        background: #ffffff !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        padding: 0.35rem 0.55rem !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .truncate.ml-2 {
        display: inline-block !important;
        max-width: min(36vw, 110px) !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right {
        width: min(95vw, 20rem) !important;
        min-width: min(95vw, 20rem) !important;
        max-width: min(95vw, 20rem) !important;
        right: 0 !important;
        left: auto !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul {
        padding: 0 !important;
        background: #ffffff !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        overflow: visible !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form > a {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 2.95rem !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.6rem !important;
        padding: 0.78rem 0.9rem !important;
        box-sizing: border-box !important;
        border: 0 !important;
        border-bottom: 1px solid #dbe4ef !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    /* Default row colors (mobile profile) */
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(1) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(1) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important;
    }
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(2) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(2) > form > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(3) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(3) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%) !important;
    }
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(4) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(4) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    }
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(5) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(5) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%) !important;
    }
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(6) > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:nth-child(6) > form > a {
        background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%) !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > a > i,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form > a > i {
        flex: 0 0 1rem !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > a > span,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form > a > span {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:last-child > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:last-child > form > a {
        border-bottom: 0 !important;
    }

    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > a:hover,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li > form > a:hover,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:hover > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:hover > form > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:focus-within > a,
    .top-header-right > .relative.inline-flex.header-user-group .origin-top-right ul > li:focus-within > form > a {
        background: linear-gradient(180deg, #edf4ff 0%, #e6efff 100%) !important;
        box-shadow: inset 0 0 0 1px #cfe0ff !important;
    }
}

/* Slightly stronger hover on header quick tools (web + mobile) */
.top-header-right .header-tool-fiscal > .btn:hover,
.top-header-right .header-tool-language > .btn:hover,
.top-header-right .header-tool-count-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification > div > .relative:hover,
.top-header-right .header-tool-user-notification button:hover {
    background: linear-gradient(180deg, #eef4ff 0%, #e7eefb 100%) !important;
    border-color: #bfd0e8 !important;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.10) !important;
}

@media screen and (max-width: 640px) {
    .navigation-header {
        min-height: auto !important;
        height: auto !important;
    }

    .top-header-right .header-tool-language > a {
        display: inline-grid !important;
        grid-template-columns: 1fr 1fr !important;
        align-items: center !important;
        justify-items: center !important;
        width: 100% !important;
        min-width: 92px !important;
        height: 36px !important;
        padding: 4px !important;
        gap: 0 !important;
        border-radius: 9999px !important;
    }

    .top-header-right .header-tool-language > a img {
        display: block !important;
        height: 14px !important;
        width: auto !important;
        min-width: 18px !important;
        max-width: 22px !important;
        object-fit: contain !important;
        visibility: visible !important;
    }

    .top-header-right .header-tool-language > a > span {
        min-width: 0 !important;
    }

    .top-header-right li > .header-tool-language > a[href*='language='] {
        background: linear-gradient(180deg, #ffffff 0%, #f6f1ff 100%) !important;
        border: 1px solid #dfd0ff !important;
    }

    .top-header-right .header-tool-language > a .header-language-toggle-thumb {
        z-index: 0 !important;
    }

    .top-header-right .header-tool-language > a > span:not(.header-language-toggle-thumb) {
        position: relative !important;
        z-index: 1 !important;
    }

    /* Remove mobile gap between top header and navigation bar */
    .navigation-header > header {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        min-height: auto !important;
        height: auto !important;
    }

    .navigation-bar {
        margin-top: 0 !important;
        transform: translateY(-1px);
    }

    .navigation-bar .nav-wrapper {
        margin-top: 0 !important;
        min-height: 2.35rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .navigation-bar {
        min-height: 2.35rem !important;
    }

    /* Mobile org header: show branch/unit line under organization name */
    .top-header-left .org-meta {
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        color: #64748b !important;
        line-height: 1.2 !important;
    }

    .top-header-left .text-md {
        display: flex !important;
        align-items: flex-start !important;
    }

    .top-header-left .text-md > .flex.flex-col {
        min-width: 0 !important;
        gap: 0.1rem !important;
    }

    .top-header-left .text-md > .flex.flex-col > span:first-child {
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        line-height: 1.1 !important;
    }

    .top-header-left .text-md,
    .top-header-left .text-md * {
        overflow: visible !important;
    }

    .top-header-right .header-tool-count-notification > .count-notification-root,
    .top-header-right .header-tool-user-notification > .user-notification-bell-root {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }
}
