/* Prevent all tables from overflowing page width */

/* Main page container */
#page {
    overflow-x: hidden;
    max-width: 100%;
}

/* All tables */
table.items,
#tasks-table,
#scripts-table,
#task-model-grid,
.items {
    max-width: 100%;
    overflow-x: auto;
    display: block;
    table-layout: fixed;
    word-wrap: break-word;
}

/* Table wrapper for horizontal scroll if needed */
.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 20px;
}

/* Ensure table cells don't overflow */
table.items th,
table.items td,
.items th,
.items td {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 300px;
}

/* Allow specific columns to be wider */
table.items th:first-child,
table.items td:first-child {
    max-width: 80px;
}

/* Make sure CGridView tables don't overflow */
.grid-view table {
    max-width: 100%;
    table-layout: fixed;
}

.grid-view {
    overflow-x: auto;
    max-width: 100%;
}

/* Responsive table container */
@media (max-width: 1200px) {
    table.items,
    .items {
        font-size: 10pt;
    }
    
    table.items th,
    table.items td,
    .items th,
    .items td {
        padding: 6px 8px;
    }
}

/* Ensure pagination doesn't break */
.pagination {
    overflow-x: auto;
    white-space: nowrap;
}

/* Fix for very long text in cells */
table.items td a,
.items td a {
    word-break: break-word;
    overflow-wrap: break-word;
}

