/* CRM layout overrides — MUST load after app.css */

.body-role-manager .app-shell .table-card:has(.responsive-card-table),
.body-role-manager .app-shell .table-card:has(.crm-pool-table),
.body-role-manager .app-shell .table-card:has(.crm-my-table),
.body-role-manager .app-shell .table-card:has(.pipeline-task-table),
.body-role-manager .app-shell .pipeline-table-card,
.body-role-manager .app-shell .table-card:has(.trash-customer-table),
.body-role-manager .app-shell .table-card:has(.billing-ledger-table),
.body-role-manager .app-shell .pool-table-card,
.body-role-sales .app-shell .table-card:has(.responsive-card-table),
.body-role-sales .app-shell .table-card:has(.crm-my-table),
.body-role-sales .app-shell .pool-table-card,
.body-role-manager .crm-page-stack .table-card,
.body-role-manager .crm-page-stack .pool-table-card,
.body-role-manager .crm-page-stack form .table-card,
.body-role-manager .crm-page-stack form .pool-table-card,
.body-role-sales .crm-page-stack form .table-card {
    max-width: none !important;
    width: 100% !important;
    box-sizing: border-box;
}

.body-role-manager .pool-page-stack,
.body-role-manager .pool-page-stack > .crm-workspace-bar,
.body-role-manager .pool-page-stack > .toolbar-card,
.body-role-manager .pool-page-stack > .pool-filter-card,
.body-role-manager .pool-page-stack > .pool-filter-shell,
.body-role-manager .pool-page-stack > .pool-chip-card,
.body-role-manager .pool-page-stack > .pool-filter-action-bar,
.body-role-manager .pool-page-stack > .pool-pagination,
.body-role-manager .pool-page-stack form,
.body-role-sales .pool-page-stack,
.body-role-sales .pool-page-stack > .toolbar-card {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.body-role-manager .pool-table-card .table-responsive,
.body-role-sales .pool-table-card .table-responsive,
.body-role-manager .pipeline-table-card .table-responsive {
    width: 100%;
    max-width: none;
    overflow-x: auto;
}

@media (min-width: 1101px) {
    .body-role-manager .pipeline-task-table {
        width: 100%;
        min-width: 1160px;
        table-layout: fixed;
    }

    .body-role-manager .crm-pool-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .body-role-manager .crm-pool-table .crm-col-company {
        width: auto !important;
        min-width: 260px;
    }

    .body-role-manager .crm-pool-table .crm-company-name {
        max-width: min(460px, 36vw);
    }

    .body-role-manager .crm-pool-table .crm-company-meta,
    .body-role-manager .crm-pool-table .pool-enterprise-facts,
    .body-role-manager .crm-pool-table .pool-enterprise-scope {
        max-width: min(520px, 40vw);
    }

    .body-role-manager .crm-pool-table .pool-col-city,
    .body-role-manager .crm-pool-table .pool-col-industry,
    .body-role-manager .crm-pool-table .pool-col-follow,
    .body-role-manager .crm-pool-table .pool-col-assigned,
    .body-role-manager .crm-pool-table .pool-col-last-follow {
        white-space: nowrap;
    }
}

/* Pipeline task table — keep normal table cells (no sticky action column) */
.pipeline-task-table th:last-child,
.pipeline-task-table td:last-child,
.pipeline-task-table td.pipeline-actions-cell {
    position: static !important;
    box-shadow: none !important;
    z-index: auto !important;
    right: auto !important;
}

.pipeline-task-table tbody td:last-child,
.pipeline-task-table tbody tr:hover td:last-child,
.pipeline-task-table tbody tr:nth-child(even) td:last-child {
    background: inherit !important;
}

.pipeline-task-table thead th:last-child {
    background: var(--surface-soft) !important;
}
