/* crm - responsive fixes for this module only. Loaded after css/shared/responsive.css
   on every page in the area. See DOCS/Showcase-Mobile.md. */

@media (max-width: 1023.98px) {

    /* Lifecycle tab strip (Prospecting / Customer Relations / National Accounts)
       is wider than a phone once the icons load; it must scroll inside itself.
       If it widens the document, the module-tab scrollIntoView shoves the whole
       page sideways. */
    .lifecycle-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .lifecycle-tabs::-webkit-scrollbar {
        display: none;
    }

    .lifecycle-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Companies / Activities / Next Actions put flex:1 on the input itself,
       not on a wrapper, so the shared full-width rule misses it. */
    .filter-section input.filter-input[style*="flex: 1"] {
        flex-basis: 100% !important;
        min-width: 0;
    }

    /* Next Actions "Show Completed" label loses its divider once the row wraps */
    .filter-section label[style*="border-left"] {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
    }
}

@media (max-width: 767.98px) {

    /* CRM Dashboard: Pipeline Overview + Next Actions are an inline 2fr 1fr grid */
    body[data-current-module="CRM"] div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Deals kanban: three columns scroll sideways inside their own container */
    .pipeline-container {
        grid-template-columns: repeat(3, minmax(270px, 1fr));
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .pipeline-column {
        min-height: 0;
    }

    /* Next Actions rows: checkbox + details on the first line, the three action
       buttons on their own full-width line */
    .action-item {
        flex-wrap: wrap;
        gap: 12px;
    }

    .action-details {
        flex: 1 1 200px;
        min-width: 0;
    }

    .action-actions {
        flex-basis: 100%;
    }

    .action-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
