﻿:root {
	--resourcetablewidth: 100%;
	--allocationtablewidth: 100%;
}

.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
}

.noWrap {
    white-space: nowrap;
}


.mud-table-cell-custom-group {
    font-weight: 500;
}

.mud-table-cell-custom-group-footer {
    padding-bottom: 50px;
    text-align: right !important;
}

.allocationcell {
    text-align: right;
    white-space: nowrap;
    text-align: center;
    min-width: 80px !important;
    width: 80px !important;
}

.ra .mud-table-cell-custom-group{
    font-size: 0.9rem;
    font-weight: 600;
}

.ra .teamgroup{
    padding-left: 0px !important;
    font-size: 1.1rem;
    font-weight: 700
}

/* Ensure Total Hours column specifically maintains width */
.mud-table-cell[data-label="Total Hours"] {
    min-width: 130px !important;
    width: 130px !important;
    text-align: center;
}

/* Force all weekly allocation columns to maintain width */
.mud-table .mud-table-cell.allocationcell {
    min-width: 80px !important;
    width: 80px !important;
    max-width: 80px !important;
}

/* Ensure weekly allocation input fields maintain width */
.allocationcell .mud-input {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Set dropdown menu background to light grey only in dark mode */
.mud-theme-dark .mud-menu .mud-paper {
    background-color: #E0E0E0 !important;
    color: #212121 !important;
}

/* ===== Begin change: Force explicit width for vertical-text header ===== */


/* Fix first 3 columns for Resource Assignment Table */
.resourceAssignTable .mud-table-root {
    table-layout: fixed;
    width: var(--resourcetablewidth);
}

.resourceAssignTable.mud-table-sticky-header th:nth-child(-n+4) {
    z-index: 3 !important;
}
.resourceAssignTable.mud-table td:nth-child(-n+9) {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: break-spaces
}

/* Allow multiline for Notes column */
/* Notes column allows full content to wrap naturally */
.resourceAssignTable.mud-table td:nth-child(10) {
    white-space: normal;
    overflow: visible !important; /* Allow full content visibility */
    text-overflow: unset;
    vertical-align: top;
}

/* Ensure textarea auto-resizes properly */
/*.resourceAssignTable.mud-table td:nth-child(10) textarea {
    resize: none;*/ /* prevent manual resize */
    /*overflow: visible !important;*/ /* Show all content, no scroll bars */
    /*max-height: none !important;*/ /* Remove any height restrictions */
/*}*/

.resourceAssignTable.mud-table td {
    vertical-align: top; /* or 'bottom' if that's what you prefer */
}

.resourceAssignTable.mud-table th:nth-child(n+12),
.resourceAssignTable.mud-table td:nth-child(n+12) {
    width: 60px;
}

.resourceAssignTable.mud-table td:nth-child(1), .resourceAssignTable.mud-table-sticky-header th:nth-child(1) {
    position: sticky;
    left: 0;
    background-color: var(--mud-palette-surface);
    z-index: 1;
    width: 90px;
    min-width: 90px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}
/*corrects the total from scrolling*/
.resourceAssignTable.mud-table td:nth-child(2):not(.mud-table-cell-custom-group-footer), .resourceAssignTable.mud-table-sticky-header th:nth-child(2):not(.mud-table-cell-custom-group-footer) {
    position: sticky;
    left: 90px;
    width: 140px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.resourceAssignTable.mud-table td:nth-child(3), .resourceAssignTable.mud-table-sticky-header th:nth-child(3) {
    position: sticky;
    left: 230px;
    width: 140px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.resourceAssignTable.mud-table td:nth-child(4), .resourceAssignTable.mud-table-sticky-header th:nth-child(4) {
    position: sticky;
    left: 370px;
    width: 140px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
    box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
}
/* Fix first 3 columns for Allocation Summary Table */

.mud-table-cell.vertical-text {
    border-bottom: 0px !important;
    border-top: 1px solid var(--mud-palette-table-lines);
}
.mud-table-cell.aloWeekCol {
    border-bottom: 0px !important;
    border-top: 1px solid var(--mud-palette-table-lines);
    text-align: center;
}

.ra .allocationSumTable thead > tr th:nth-child(-n+5) {
    position: sticky !important;
    z-index: 4 !important;
    width: 30px;
}

/* Sticky first four columns (Regular Rows + Grouped Headers) */

.allocationSumTable>table {
    table-layout: fixed;
    width: var(--allocationtablewidth);
}

.allocationSumTable td:nth-child(1):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(1):not(.aloWeekCol) {
    position: sticky;
    left: 0 !important;
    width: 40px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}

.allocationSumTable th:nth-child(1):not(.aloWeekCol) {
    position: sticky;
    left: 0px !important;
    width: 40px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable .mud-table-group-row th:nth-child(1):not(.aloWeekCol) {
    position: sticky;
    left: 0px !important;
    width: 40px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable td:nth-child(2):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(2):not(.aloWeekCol) {
    position: sticky;
    left: 40px !important;
    width: 80px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}
.allocationSumTable th:nth-child(2):not(.aloWeekCol) {
    position: sticky;
    left: 40px !important;
    width: 80px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}
.allocationSumTable .mud-table-group-row th:nth-child(2):not(.aloWeekCol) {
    position: sticky;
    left: 40px !important;
    width: 80px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

/* Adjust left positioning for other sticky columns */
.allocationSumTable td:nth-child(3):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(3):not(.aloWeekCol) {
    position: sticky;
    left: 120px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}
.allocationSumTable th:nth-child(3):not(.aloWeekCol) {
    position: sticky;
    left: 120px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}
.allocationSumTable .mud-table-group-row th:nth-child(3):not(.aloWeekCol) {
    position: sticky;
    left: 120px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable td:nth-child(4):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(4):not(.aloWeekCol) {
    position: sticky;
    left: 320px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}
.allocationSumTable th:nth-child(4):not(.aloWeekCol) {
    position: sticky;
    left: 320px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}
.allocationSumTable .mud-table-group-row th:nth-child(4):not(.aloWeekCol) {
    position: sticky;
    left: 320px !important;
    width: 200px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable td:nth-child(5):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(5):not(.aloWeekCol) {
    position: sticky;
    left: 520px !important;
    width: 115px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}
.allocationSumTable th:nth-child(5):not(.aloWeekCol) {
    position: sticky;
    left: 520px !important;
    width: 115px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}
.allocationSumTable .mud-table-group-row th:nth-child(5):not(.aloWeekCol) {
    position: sticky;
    left: 520px !important;
    width: 115px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable td:nth-child(6):not(.aloWeekCol),
.allocationSumTable .mud-table-group-footer th:nth-child(6):not(.aloWeekCol) {
    position: sticky;
    left: 635px !important;
    width: 50px;
    background-color: var(--mud-palette-surface);
    z-index: 2 !important;
    box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
}

.allocationSumTable th:nth-child(6):not(.aloWeekCol) {
    position: sticky;
    left: 635px !important;
    width: 50px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable .mud-table-group-row th:nth-child(6):not(.aloWeekCol) {
    position: sticky;
    left: 635px !important;
    width: 50px;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

.allocationSumTable.mud-table th:nth-child(n+6),
.allocationSumTable.mud-table td:nth-child(n+6) {
    text-align: right;
}

/* Sticky Grouped Header (Colspan Elements) */
.allocationSumTable .mud-table-group-row th {
    position: sticky;
    left: 0;
    background-color: var(--mud-palette-surface);
    z-index: 5 !important;
}

/* Sticky Footer (Totals) */
.allocationSumTable .mud-table-group-footer th {
    position: sticky;
    left: 50px;
    width:130px;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}

.allocationSumTable .assignmenttotal {
    padding-bottom: 50px;
    text-align: right !important;
    position: sticky;
    left: 0 !important;
    z-index: 2 !important;
    box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
}

.group-header-fake-colspan {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--mud-palette-surface);
    font-weight: bold;
    white-space: nowrap;
    padding: 8px 16px;
    /* Visually stretch this cell across multiple columns */
    width: calc(100% + 3000px);
}

.team-member-group-header {
    @extend .group-header-fake-colspan;
    font-size: 1.3rem;
}

.team-group-header {
    @extend .group-header-fake-colspan;
    font-size: 1.6rem;
}

.indent-wrapper {
    transform: translateX(40px);
}

.mud-table-row {
    border-bottom: 1px solid var(--mud-palette-surface) !important;
}

/* ===== ResourceAssignments Specific Styles ===== */
/* ResourceAssignments specific styles */
.resourceAssignTable .total-hours-column {
    min-width: 130px !important;
    width: 130px !important;
    max-width: 130px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Force Total Hours column width in all contexts */
.resourceAssignTable .mud-table-cell[data-label="Total Hours"],
.resourceAssignTable .mud-table-cell.total-hours-column,
.resourceAssignTable .mud-th.total-hours-column {
    min-width: 130px !important;
    width: 130px !important;
    max-width: 130px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Ensure allocation cells maintain proper width in ResourceAssignments */
.resourceAssignTable .allocationcell {
    min-width: 80px !important;
    width: 80px !important;
    text-align: center;
    white-space: nowrap;
}
/* ===== End ResourceAssignments Specific Styles ===== */
