/* Cres Detail Page — fix header layout for permohonan view pages
   Force title to single-line + wrap actions to next row when narrow */

/* Page header container — allow wrap when content too wide */
.fi-page-header {
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: flex-start !important;
}

/* Title block — full width on narrow, auto on wide */
.fi-page-header > div:first-child {
    flex: 1 1 100% !important;
    min-width: 280px !important;
}

/* Title heading — ensure single line, ellipsis if overflow */
.fi-header-heading,
.fi-page-header h1 {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* Subheading — wrap normally */
.fi-header-subheading {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Actions zone — flex wrap */
.fi-header-actions,
.fi-page-header > div:last-child {
    flex: 1 1 100% !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
}

/* Wider screens — keep header inline */
@media (min-width: 1400px) {
    .fi-page-header {
        flex-wrap: nowrap !important;
    }
    .fi-page-header > div:first-child {
        flex: 1 1 auto !important;
    }
    .fi-header-actions,
    .fi-page-header > div:last-child {
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
    }
}
