/* CPL CMS — mobile-first dashboard and panel layout */

@media (max-width: 767px) {
    .fi-page-header-main-ctn {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
        gap: 1rem;
    }

    .fi-header-heading {
        font-size: 1.375rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .fi-header-actions-ctn {
        width: 100%;
        flex-wrap: wrap;
    }

    .fi-header-actions-ctn .fi-ac,
    .fi-header-actions-ctn .fi-btn {
        width: 100%;
        justify-content: center;
    }

    .fi-section-header {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .fi-section-header-after-ctn {
        margin-left: auto;
    }

    .fi-account-widget .fi-section-content {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .fi-account-widget-main {
        min-width: 0;
        flex: 1 1 12rem;
    }

    .fi-account-widget-heading,
    .fi-account-widget-user-name {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .fi-account-widget-logout-form {
        flex: 1 1 100%;
        width: 100%;
        margin-top: 0.25rem;
    }

    .fi-account-widget-logout-form .fi-btn {
        width: 100%;
        justify-content: center;
    }

    .fi-ta-ctn,
    .fi-fo-component-ctn,
    .fi-section,
    .fi-wi-widget {
        min-width: 0;
        max-width: 100%;
    }

    .fi-fo-file-upload,
    .fi-fo-rich-editor,
    .fi-fo-repeater {
        min-width: 0;
        max-width: 100%;
    }

    .fi-topbar .fi-logo,
    .fi-sidebar-header .fi-logo {
        max-width: 11rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.cpl-shortcut-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.cpl-shortcut-card {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #0a2c63;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.cpl-shortcut-card:hover {
    background: #f8fafc;
}

.cpl-empty {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.cpl-message-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cpl-message-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.875rem 0;
    border-top: 1px solid #e5e7eb;
}

.cpl-message-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.cpl-message-item-main {
    min-width: 0;
    flex: 1 1 12rem;
}

.cpl-message-name {
    margin: 0;
    color: #0a2c63;
    font-size: 0.875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cpl-message-meta {
    margin: 0.25rem 0 0;
    color: #6b7280;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.cpl-message-status {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.cpl-message-status-new {
    background: #fff7ed;
    color: #c2410c;
}

@media (min-width: 640px) {
    .cpl-shortcut-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1280px) {
    .cpl-shortcut-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fi-ta-ctn {
    max-width: 100%;
    min-width: 0;
}

.fi-ta-table {
    width: 100%;
}

.fi-ta-table > tbody {
    white-space: normal;
}

.fi-ta-table.fi-ta-table-stacked-on-mobile > tbody {
    white-space: normal;
}

.fi-ta-text,
.fi-ta-text-item {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.fi-ta-cell:not(:has(.fi-ta-actions)):not(.fi-ta-selection-cell) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 639px) {
    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell:has(.fi-ta-actions) {
        width: 100%;
        padding: 0.25rem 1rem 0.875rem;
        white-space: normal;
    }

    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell:has(.fi-ta-actions) > .fi-ta-cell-label {
        display: none;
    }

    .fi-ta-table.fi-ta-table-stacked-on-mobile > tbody > tr > .fi-ta-cell:has(.fi-ta-actions) > .fi-ta-actions {
        display: flex;
        width: 100%;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
    }

    .fi-ta-table.fi-ta-table-stacked-on-mobile .fi-ta-actions .fi-icon-btn,
    .fi-ta-table.fi-ta-table-stacked-on-mobile .fi-ta-actions .fi-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (min-width: 640px) {
    .fi-ta-cell:has(.fi-ta-actions) {
        width: 1%;
        white-space: nowrap;
        vertical-align: middle;
    }

    .fi-ta-actions {
        justify-content: flex-end;
        flex-wrap: nowrap;
        width: max-content;
    }

    .fi-ta-actions .fi-icon-btn,
    .fi-ta-actions .fi-btn {
        flex-shrink: 0;
    }
}
