/* Workforce Viewer - Team Structure Stylesheet */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    font-size: 12px;
    line-height: 1.4;
}

/* Parent Team Navigation Styling */
.parent-team-navigation {
    margin-top: -8px;
    margin-bottom: 8px;
    text-align: right;
    font-size: 11px;
}

.breadcrumb-navigation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 35px;
    right: 60px;
}

.breadcrumb-label {
    font-weight: bold;
    color: #666;
    font-size: 10px;
}

.parent-team-link {
    text-decoration: none;
    color: #007bff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 4px;
    border-radius: 2px;
    transition: background-color 0.2s;
    font-size: 11px;
}

.parent-team-link:hover {
    background-color: #e3f2fd;
    text-decoration: underline;
}

.parent-team-name {
    font-weight: 500;
}

.parent-team-number {
    font-size: 10px;
    color: #666;
    font-weight: normal;
}

/* Home Team Navigation Styling */
.home-team-navigation {
    margin-top: -8px;
    margin-bottom: 8px;
    text-align: right;
    font-size: 11px;
}

/* Custom Tooltip Styling */
[data-tooltip] {
    position: relative;
    /* cursor: help; */
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 10px;
    transform: none;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transition-delay: 0.3s; /* Fast 300ms delay instead of 1000ms */
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

[data-tooltip]:after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transition-delay: 0.3s;
    z-index: 99999;
}

/* First member in team section - tooltip below */
.member:first-child [data-tooltip]:before {
    bottom: auto;
    top: 100%;
}

/* First member in team section - arrow flipped */
.member:first-child [data-tooltip]:after {
    bottom: auto;
    top: 90%;
    border-top-color: transparent;
    border-bottom-color: #333;
}

[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
    opacity: 1;
    transition-delay: 0.3s;
}

/* User Display and Logout Button Styling */
#user-display {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-welcome-text {
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.logout-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background: #dee2e6;
}

.logout-btn svg {
    opacity: 0.9;
}

/* Adjust tooltip position for elements near page edges */
[data-tooltip].tooltip-left:before {
    left: 0;
    transform: none;
}

[data-tooltip].tooltip-right:before {
    left: auto;
    right: 0;
    transform: none;
}

/* Tier 3 Team Styling */
.tier3-team {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    width: 100%;
    /* max-width: 1400px;  */
    box-sizing: border-box;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Main content column (left side) */
.tier3-main-content {
    flex: 0 0 20%; /* Take 30% of the space */
    min-width: 0; /* Allows flex item to shrink below its content size */
}

/* Summary column (right side) */
.tier3-summary-column {
    flex: 0 0 79%; /* Take 70% of the space */
    min-width: 0; /* Allows flex item to shrink below its content size */
}

/* Tier 1 specific column overrides for 40%/60% split */
#tier1-container .tier3-main-content {
    flex: 0 0 20%; /* Take 40% of the space for tier1 */
}

#tier1-container .tier3-summary-column {
    flex: 0 0 79%; /* Take 60% of the space for tier1 */
}

/* Improve layout for tier 3 content */
.tier3-team .tabs-container {
    width: 100%;
    max-width: none; /* Remove max-width restriction for flex layout */
}

.tier3-team h1 {
    margin-top: 0;
    font-size: 18px;
    color: #333;
}

.tier3-team p {
    margin: 5px 0;
    font-size: 12px;
}

/* Team description styling */
.tier3-team p.description-container, .tier4-team p.description-container {
    position: relative;
    cursor: pointer;
    height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines to show */
    line-clamp: 3; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Description container wrapper */
.tier3-team .description-wrapper, .tier4-team .description-wrapper {
    position: relative;
    cursor: pointer;
}

/* Description container placeholder */
.tier3-team .description-placeholder, .tier4-team .description-placeholder {
    height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines to show */
    line-clamp: 3; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Override for Tier 4 page descriptions - show full description without line clamping */
.tier4-team-info .description-wrapper .description-placeholder,
.tier4-description-full {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    -webkit-line-clamp: none !important;
    line-clamp: none !important;
    -webkit-box-orient: unset !important;
    text-overflow: clip !important;
    white-space: normal !important;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 8px;
    line-height: 1.4;
    color: #333;
    font-size: 14px;
}

/* Description container overlay */
.tier3-team .description-overlay, .tier4-team .description-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 3px;
    line-height: 1.4;
    min-height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    max-width: 600px;
    display: none;
    overflow-x: hidden;
}

/* Show description container overlay on hover */
.tier3-team .description-wrapper:hover .description-overlay,
.tier4-team .description-wrapper:hover .description-overlay {
    display: block;
}

.tier3-team .description-wrapper:hover .description-placeholder,
.tier4-team .description-wrapper:hover .description-placeholder {
    opacity: 0.3;
}

/* Tier 4 Teams Container - for horizontal scrolling of team cards */
.tier4-container {
    position: relative; /* Make this the positioned parent for drop zones */
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    padding-bottom: 10px; /* Add space for scrollbar */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #a8d1e0 #f0f0f0; /* Firefox */
}

/* Override for tier4-items-container - full width data sections */
#tier4-items-container.tier4-container {
    display: block;
    overflow: visible;
    width: 100%;
    max-width: none;
    padding: 0;
    margin-top: 20px;
}

/* Webkit scrollbar styling for tier 4 container */
.tier4-container::-webkit-scrollbar {
    height: 8px;
}

.tier4-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.tier4-container::-webkit-scrollbar-thumb {
    background: #a8d1e0;
    border-radius: 4px;
}

.tier4-container::-webkit-scrollbar-thumb:hover {
    background: #7db8d1;
}

/* Tier 4 Team Styling */
.tier4-team {
    background-color: #e8f4f8;
    border: 1px solid #a8d1e0;
    border-radius: 5px;
    padding: 10px;
    min-width: 300px;
    max-width: 350px;
    flex-shrink: 0; /* Prevent shrinking in horizontal scroll */
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; /* Needed for absolute positioning of children */
}

.tier4-team h2 {
    margin-top: 0;
    font-size: 14px;
    color: #005177;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Team description styling for tier 4 */
.tier4-team p {
    margin: 3px 0;
    font-size: 11px;
}

/* Team Content Structure */
.team-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Team Members Styling */
.team-members {
    margin-bottom: 5px;
}

.team-members h3 {
    font-size: 13px;
    margin: 5px 0;
    color: #444;
    border-bottom: 1px solid #ddd;
    padding-bottom: 3px;
}

.member {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
}

.member .name {
    font-weight: bold;
    cursor: help;
    max-width: 200px; /* Limit name width to bring roles closer */
    flex-shrink: 0;
}

.member .role {
    color: #666;
    text-align: right;
}

/* Tier 3 team specific styling - roles closer to names with right justification */
.tier3-team .member {
    justify-content: flex-start;
    gap: 0;
}

.tier3-team .member .member-info {
    display: flex;
    justify-content: space-between;
    width: fit-content;
    min-width: 100%;
}

.tier3-team .member .name {
    max-width: none; /* Remove width limit for tier 3 */
}

.tier3-team .member .role {
    text-align: right;
}

.contractor {
    font-style: italic;
}

.name.inactive,
.member-concise.inactive {
    text-decoration: line-through;
}

/* Team count pill styling */
.team-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #c5e8ff;
    color: rgb(19, 13, 100);
    font-size: 9px;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    height: 14px;
    min-width: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    vertical-align: middle;
}

/* Member highlight animation for URL parameter targeting */
.member-highlight {
    animation: memberHighlight 0.75s ease-in-out;
    background: linear-gradient(90deg, 
        rgba(255, 215, 0, 0.3) 0%, 
        rgba(255, 215, 0, 0.5) 50%, 
        rgba(255, 215, 0, 0.3) 100%);
    border-radius: 4px;
    padding: 8px;
    margin: -4px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.tier4-table tr.member-highlight {
    background: linear-gradient(90deg, 
        rgba(255, 215, 0, 0.2) 0%, 
        rgba(255, 215, 0, 0.4) 50%, 
        rgba(255, 215, 0, 0.2) 100%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

@keyframes memberHighlight {
    0% {
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.1) 0%, 
            rgba(255, 215, 0, 0.2) 50%, 
            rgba(255, 215, 0, 0.1) 100%);
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
        transform: scale(1);
    }
    25% {
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.4) 0%, 
            rgba(255, 215, 0, 0.6) 50%, 
            rgba(255, 215, 0, 0.4) 100%);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        transform: scale(1.02);
    }
    50% {
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.3) 0%, 
            rgba(255, 215, 0, 0.5) 50%, 
            rgba(255, 215, 0, 0.3) 100%);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
        transform: scale(1.01);
    }
    75% {
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.2) 0%, 
            rgba(255, 215, 0, 0.4) 50%, 
            rgba(255, 215, 0, 0.2) 100%);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    100% {
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.1) 0%, 
            rgba(255, 215, 0, 0.2) 50%, 
            rgba(255, 215, 0, 0.1) 100%);
        transform: scale(1);
    }
}

/* Component highlight animation for URL parameter targeting */
.component-highlight {
    animation: componentHighlight 0.75s ease-in-out;
    background: linear-gradient(90deg, 
        rgba(40, 167, 69, 0.3) 0%, 
        rgba(40, 167, 69, 0.5) 50%, 
        rgba(40, 167, 69, 0.3) 100%);
    border-radius: 4px;
    padding: 8px;
    margin: -4px;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
}

.tier4-table tr.component-highlight {
    background: linear-gradient(90deg, 
        rgba(40, 167, 69, 0.2) 0%, 
        rgba(40, 167, 69, 0.4) 50%, 
        rgba(40, 167, 69, 0.2) 100%);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

@keyframes componentHighlight {
    0% {
        background: linear-gradient(90deg, 
            rgba(40, 167, 69, 0.1) 0%, 
            rgba(40, 167, 69, 0.2) 50%, 
            rgba(40, 167, 69, 0.1) 100%);
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.2);
        transform: scale(1);
    }
    25% {
        background: linear-gradient(90deg, 
            rgba(40, 167, 69, 0.4) 0%, 
            rgba(40, 167, 69, 0.6) 50%, 
            rgba(40, 167, 69, 0.4) 100%);
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
        transform: scale(1.02);
    }
    50% {
        background: linear-gradient(90deg, 
            rgba(40, 167, 69, 0.3) 0%, 
            rgba(40, 167, 69, 0.5) 50%, 
            rgba(40, 167, 69, 0.3) 100%);
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
        transform: scale(1.01);
    }
    75% {
        background: linear-gradient(90deg, 
            rgba(40, 167, 69, 0.2) 0%, 
            rgba(40, 167, 69, 0.4) 50%, 
            rgba(40, 167, 69, 0.2) 100%);
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
        transform: scale(1);
    }
    100% {
        background: linear-gradient(90deg, 
            rgba(40, 167, 69, 0.1) 0%, 
            rgba(40, 167, 69, 0.2) 50%, 
            rgba(40, 167, 69, 0.1) 100%);
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.2);
        transform: scale(1);
    }
}

/* Workload highlight animation for URL parameter targeting */
.workload-highlight {
    animation: workloadHighlight 0.75s ease-in-out;
    border-radius: 4px;
    padding: 2px;
    margin: -2px;
    box-shadow: 0 0 15px rgba(199, 21, 133, 0.4);
}

.tier4-table tr.workload-highlight {
    background: linear-gradient(90deg, 
        rgba(199, 21, 133, 0.2) 0%, 
        rgba(199, 21, 133, 0.4) 50%, 
        rgba(199, 21, 133, 0.2) 100%);
    box-shadow: 0 0 10px rgba(199, 21, 133, 0.3);
}

@keyframes workloadHighlight {
    0% {
        background: linear-gradient(90deg, 
            rgba(199, 21, 133, 0.1) 0%, 
            rgba(199, 21, 133, 0.2) 50%, 
            rgba(199, 21, 133, 0.1) 100%);
        box-shadow: 0 0 5px rgba(199, 21, 133, 0.2);
        transform: scale(1);
    }
    25% {
        background: linear-gradient(90deg, 
            rgba(199, 21, 133, 0.4) 0%, 
            rgba(199, 21, 133, 0.6) 50%, 
            rgba(199, 21, 133, 0.4) 100%);
        box-shadow: 0 0 20px rgba(199, 21, 133, 0.5);
        transform: scale(1.02);
    }
    50% {
        background: linear-gradient(90deg, 
            rgba(199, 21, 133, 0.3) 0%, 
            rgba(199, 21, 133, 0.5) 50%, 
            rgba(199, 21, 133, 0.3) 100%);
        box-shadow: 0 0 15px rgba(199, 21, 133, 0.4);
        transform: scale(1.01);
    }
    75% {
        background: linear-gradient(90deg, 
            rgba(199, 21, 133, 0.2) 0%, 
            rgba(199, 21, 133, 0.4) 50%, 
            rgba(199, 21, 133, 0.2) 100%);
        box-shadow: 0 0 10px rgba(199, 21, 133, 0.3);
        transform: scale(1);
    }
    100% {
        background: linear-gradient(90deg, 
            rgba(199, 21, 133, 0.1) 0%, 
            rgba(199, 21, 133, 0.2) 50%, 
            rgba(199, 21, 133, 0.1) 100%);
        box-shadow: 0 0 5px rgba(199, 21, 133, 0.2);
        transform: scale(1);
    }
}

/* Tabs Container */
.tabs-container {
    margin-top: 0px;
    padding-top: 0px;
}

/* Special positioning for tier 4 team tabs */
.tier4-team .tabs-container {
    position: absolute;
    width: calc(100% - 20px); /* Adjust for padding */
    left: 10px;
    /* The top position will be set dynamically by JavaScript */
}

/* Tabs Styling */
.tabs {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ccc;
    height: 22px; /* Fixed height for tab buttons */
}

.tab-button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background-color: #f9f9f9;
    margin-right: 2px;
    cursor: pointer;
    font-size: 11px;
}

.tab-button.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    font-weight: bold;
}

.tab-content {
    display: none; /* Hide by default */
    border: 1px solid #eee;
    padding: 5px;
    border-radius: 0 0 4px 4px;
    position: relative;
    min-height: 250px; /* Minimum height */
    height: auto; /* Allow height to adjust based on content */
    max-height: 500px; /* Maximum height */
    box-sizing: border-box;
}

/* Specific adjustments for tier 3 team */
.tier3-team .tab-content {
    min-height: 0; /* Allow it to shrink as needed */
    max-height: none; /* Remove fixed height */
    height: auto; /* Let content determine the height */
    overflow-y: visible; /* Don't scroll the entire tab content */
    position: relative; /* For positioning the page container */
}

.tab-content.active {
    display: flex; /* Use flex for active tabs */
    flex-direction: column;
}

.tab-content p:only-child {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Components and Workloads */
.component, .workload {
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: visible; /* Allow tooltips to show */
    text-overflow: ellipsis;
    height: auto; /* Allow height adjustment */
    min-height: 18px; /* Minimum height */
    position: relative; /* Ensure tooltips can position relative to these */
}

/* Special handling for tier 3 components/workloads */
.tier3-team .component, .tier3-team .workload {
    max-width: 100%; /* Ensure full width utilization */
    font-weight: 500; /* Slightly bolder for better readability */
}

.component {
    background-color: #e8f8e8;
    border: 1px solid #c8e8c8;
}

.workload {
    background-color: #f8e8e8;
    border: 1px solid #e8c8c8;
}

/* Search Match Indicators */
.match-type {
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.team-match-indicator {
    background-color: #e3f2fd;
    color: #1976d2;
}

.member-match-indicator {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.workload-match-indicator {
    background-color: #f8e8e8;
    color: #d81b60;
    border: 1px solid #e8c8c8;
}

.component-match-indicator {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.member-match {
    color: #7b1fa2;
    font-size: 12px;
    margin: 4px 0;
}

.workload-match {
    color: #d81b60;
    font-size: 12px;
    margin: 4px 0;
}

.component-match {
    color: #155724;
    font-size: 12px;
    margin: 4px 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    padding: 8px 0 0 0;
    height: 26px;
    width: 100%;
    margin-top: 10px;
}

/* Special positioning for team pages */
.tier4-team .tab-content {
    padding-bottom: 40px; /* Space for pagination */
    position: relative;
}

/* For tier 3 teams */
.tier3-team .pagination {
    margin-top: 10px;
}.pagination button {
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    padding: 2px 6px;
    margin: 0 2px;
    cursor: pointer;
    font-size: 10px;
    border-radius: 3px;
}

.pagination button.active {
    background-color: #007acc;
    color: white;
    font-weight: bold;
    border-color: #0062a3;
}

/* Page container styling */
.page-container {
    position: relative;
    min-height: 320px;
}

/* Tier 3 specific page container styling */
.tier3-team .page-container, .tier3-page-container {
    min-height: 0;
    height: auto;
}

/* Make component/workload items in tier 3 team more compact */
.tier3-team .component, .tier3-team .workload {
    padding: 3px 8px;
    margin-bottom: 3px;
    min-height: 16px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Empty space filler for empty/sparse pages */
.empty-page-notice {
    display: flex;
    padding-top: 14px;
    justify-content: center;
    align-items: center;
    color: #666;
    font-style: italic;
}

/* Team Structure Summary Table */
.team-structure-summary {
    margin: 0;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.team-structure-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
    text-align: center;
}

/* Multi-column layout for role groups */
.role-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.role-group {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 8px;
    min-height: 120px;
}

.role-group h4 {
    margin: 0 0 8px 0;
    font-size: 10px;
    font-weight: bold;
    color: #005177;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

.role-group .role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 9px;
    border-bottom: 1px dotted #f0f0f0;
}

.role-group .role-item:last-child {
    border-bottom: none;
}

.role-group .role-name {
    flex: 1;
    margin-right: 4px;
    line-height: 1.2;
}

.role-group .role-count {
    font-weight: bold;
    color: #005177;
    min-width: 15px;
    text-align: right;
}

/* Totals column styling */
.totals-group {
    background-color: #f0f8ff;
    border: 2px solid #005177;
}

.totals-group h4 {
    color: #005177;
}

.totals-group .role-item {
    font-weight: bold;
    font-size: 10px;
    padding: 3px 0;
}

.totals-group .role-count {
    font-size: 11px;
}

/* Legacy table styling - keeping for fallback */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    display: none; /* Hidden by default, shown only if role groups fail */
}

.summary-table th,
.summary-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.summary-table th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
    font-size: 10px;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table tr:nth-child(even) {
    background-color: #f8f8f8;
}

.summary-table .number-cell {
    text-align: right;
    font-weight: bold;
    color: #005177;
    min-width: 40px;
}

/* Tier 2 Team Styling */
.tier2-team {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    /* max-width: 1400px; */
    box-sizing: border-box;
}

.tier2-team .team-header h1 {
    margin-top: 0;
    font-size: 24px;
    color: #007bff;
    font-weight: bold;
}

.tier2-team .team-number {
    font-size: 14px;
    color: #6c757d;
    font-weight: bold;
    margin: 5px 0;
}

.tier2-team-number {
    font-size: 12px;
    color: #005177;
    font-weight: 600;
    font-family: monospace;
    margin-bottom: 5px;
}

.tier2-team-name {
    font-size: 20px;
    color: #005177;
    font-weight: 700;
    margin-bottom: 0px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tier1-team-number {
    font-size: 12px;
    color: #005177;
    font-weight: 600;
    font-family: monospace;
    margin-bottom: 5px;
}

.tier1-team-name {
    font-size: 20px;
    color: #005177;
    font-weight: 700;
    margin-bottom: 0px;
}

/* Description wrapper for dual-element approach */
.tier2-team .description-wrapper {
    position: relative;
    cursor: pointer;
}

/* Placeholder that always maintains 3-line space */
.tier2-team .description-placeholder {
    font-size: 14px;
    color: #495057;
    margin: 10px 0 20px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em; /* 3 lines Ã— 1.5 line-height */
}

/* Overlay that shows full text on hover */
.tier2-team .description-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    min-height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    max-width: 600px;
    display: none; /* Hidden by default */
}

/* Show overlay on hover */
.tier2-team .description-wrapper:hover .description-overlay {
    display: block;
}

/* Optionally fade placeholder on hover */
.tier2-team .description-wrapper:hover .description-placeholder {
    opacity: 0.3;
}

.tier2-team .team-stats {
    display: flex;
    gap: 30px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.tier2-team .stat-item {
    text-align: center;
    min-width: 120px;
}

.tier2-team .stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.tier2-team .stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier2-team .team-leadership {
    margin-top: 25px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.tier2-team .team-leadership h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #495057;
}

.tier2-team .manager-info {
    font-size: 14px;
    color: #495057;
}

.tier2-team .manager-title {
    color: #6c757d;
    font-style: italic;
}

/* Tier 3 Teams Container for Tier 2 pages */
.tier3-teams-container {
    margin-top: 30px;
}

.tier3-teams-container h2 {
    font-size: 20px;
    color: #495057;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    /* margin-top: 20px; */
}

/* Team Card Styling */
.team-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

/* Tier 4 Card Specific Styling */
.tier4-card {
    min-width: 350px;
    max-width: 350px;
    width: 350px;
    flex-shrink: 0; /* Prevent shrinking in flex container */
    cursor: default; /* Remove cursor since only team name is clickable */
}

/* Hide link icon by default */
.tier4-card .link-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show link icon on card hover */
.tier4-card:hover .link-icon {
    opacity: 1;
}

/* ==========================================
   TIER 4 VIEW TOGGLE STYLES
   ========================================== */

/* Header container for title and toggle buttons */
.tier4-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.tier4-header-container h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/* View toggle button group */
.tier4-view-toggle {
    display: flex;
    gap: 5px;
    background-color: #fff;
    border-radius: 5px;
    padding: 3px;
    border: 1px solid #dee2e6;
}

.view-toggle-btn {
    padding: 6px 14px;
    font-size: 12px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    font-weight: 500;
}

.view-toggle-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.view-toggle-btn.active {
    background-color: #007bff;
    color: white;
}

/* ==========================================
   CONCISE VIEW STYLES
   ========================================== */

/* Concise view container - enable wrapping */
.tier4-container.tier4-concise-view {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    overflow: visible;
}

/* Concise canvas view - free-form positioning */
.tier4-container.tier4-concise-canvas {
    position: relative;
    display: block;
    min-height: 800px;
    height: auto;
    overflow: visible;
    padding: 10px;
    /* Grid pattern background */
    background: 
        /* Page break lines - Vertical repeating every 2200px, Horizontal every 1600px */
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent calc(2200px - 2px), 
            rgba(134, 134, 134, 0.25) calc(2200px - 2px), 
            rgba(134, 134, 134, 0.25) 2200px,
            transparent 2200px,
            transparent calc(2200px + 2px)
        ),
        repeating-linear-gradient(0deg, 
            transparent, 
            transparent calc(1600px - 2px), 
            rgba(134, 134, 134, 0.25) calc(1600px - 2px), 
            rgba(134, 134, 134, 0.25) 1600px,
            transparent 1600px,
            transparent calc(1600px + 2px)
        ),
        /* Grid pattern */
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 2200px 100%, 100% 1600px, 50px 50px, 50px 50px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    background-attachment: local;
}

/* Canvas reset button */
.canvas-reset-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.canvas-reset-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.canvas-reset-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Canvas print button */
.canvas-print-btn {
    position: absolute;
    top: 48px;
    right: 10px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.canvas-print-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.canvas-print-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Print styles - only show canvas */
@media print {
    /* Default to landscape orientation */
    @page {
        size: landscape;
    }
    
    /* Hide everything except the tier4-container */
    body > *:not(#tier4-container):not(script) {
        display: none !important;
    }
    
    /* Hide buttons */
    .canvas-reset-btn,
    .canvas-print-btn {
        display: none !important;
    }
    
    /* Hide toggle buttons */
    .tier4-header-container {
        display: none !important;
    }
    
    /* Hide tier3 container */
    #tier3-container {
        display: none !important;
    }
    
    /* Ensure canvas is visible and fits page */
    #tier4-container.tier4-concise-canvas {
        overflow: visible !important;
        background: none !important;
        padding: 20px !important;
        min-height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Ensure cards are visible */
    .tier4-card-concise {
        page-break-inside: avoid;
    }
}

/* Concise card styling - smaller, stackable */
.tier4-card-concise {
    background-color: #e8f4f8;
    border: 1px solid #a8d1e0;
    border-radius: 5px;
    padding: 10px;
    min-width: 200px;
    max-width: 250px;
    width: 250px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: move;
}

.tier4-concise-canvas .tier4-card-concise {
    cursor: move;
    position: absolute;
}

.tier4-card-concise:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #007bff;
    z-index: 10;
}

/* Concise card header */
.tier4-card-concise .card-header-concise {
    margin-bottom: 8px;
    cursor: move;
}

.tier4-card-concise .card-header-concise h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.3;
}

.tier4-card-concise .card-header-concise h3 a {
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
}

.tier4-card-concise .card-header-concise h3 a:hover {
    text-decoration: underline;
}

/* Override tier4-team-link to be inline in concise cards */
.tier4-card-concise .tier4-team-link {
    display: inline;
}

.tier4-card-concise .member-count-badge {
    background-color: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    margin-top: 4px;
}

/* Hide link icon by default in concise view */
.tier4-card-concise .link-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show link icon on hover in concise view */
.tier4-card-concise:hover .link-icon {
    opacity: 1;
}

/* Concise card content */
.tier4-card-concise .card-content-concise {
    margin-top: 8px;
}

/* Concise members list */
.tier4-card-concise .team-members-concise {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tier4-card-concise .member-concise {
    font-size: 11px;
    color: #495057;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.tier4-card-concise .member-concise:hover {
    background-color: #fff;
}

.tier4-card-concise .member-concise .team-count {
    background-color: #007bff;
    color: white;
    font-size: 8px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 10px;
    margin-left: 4px;
}

/* ==========================================
   DRAG AND DROP STYLES
   ========================================== */

/* Drag handle */
.tier4-card .drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    cursor: grab;
    color: #666;
    font-size: 14px;
    transition: opacity 0.2s ease;
    z-index: 10;
    user-select: none;
    line-height: 1;
}

.tier4-card:hover .drag-handle {
    opacity: 1;
}

.tier4-card.dragging .drag-handle {
    cursor: grabbing;
}

/* Drag states */
.tier4-card.dragging {
    opacity: 0.5;
    z-index: 1000;
}

/* Drop zone wrapper - zero width, flows with flexbox but takes no space */
.drop-zone-wrapper {
    width: 0;
    height: auto;
    position: relative;
    flex-shrink: 0; /* Don't shrink in flex container */
    overflow: visible; /* Allow drop zone to extend beyond wrapper */
}

/* Drop zone styling - positioned relative to its wrapper */
.drop-zone {
    position: absolute;
    width: 45px;
    height: 100%;
    left: -25px; /* Position 25px to the left of wrapper */
    top: 0;
    border: 2px dashed #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    opacity: 0; /* Hidden by default */
    transition: all 0.2s ease;
    z-index: 1000; /* Above cards */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Don't interfere when hidden */
}

/* Show drop zones ONLY when drag is in progress */
.tier4-container.drag-in-progress .drop-zone {
    opacity: 1; /* Show drop zones when drag is active */
    pointer-events: auto; /* Enable interaction when visible */
}

/* Highlight drop zone on hover during drag */
.drop-zone.drag-over {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.2);
    border-style: solid;
}

/* Smooth transitions for cards */
.tier4-card {
    position: relative; /* For absolute positioning of drag handle */
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Reset button styles */
.tier4-controls {
    margin-bottom: 15px;
    text-align: right;
    padding: 0 10px;
}

.reset-order-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reset-order-btn:hover {
    background: #e9ecef;
}

.reset-order-btn:active {
    background: #dee2e6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tier4-card .drag-handle {
        font-size: 16px;
        padding: 4px 6px;
        opacity: 0.7; /* More visible on mobile */
    }
    
    .tier4-card:hover .drag-handle {
        opacity: 1;
    }
    
    .drop-zone {
        width: 12px; /* Slightly smaller on mobile */
    }
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #007bff;
}

/* Hide link icon by default for all team cards */
.team-card .link-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show link icon on card hover for all team cards */
.team-card:hover .link-icon {
    opacity: 1;
}

.team-card .card-header {
    margin-bottom: 5px;
}

.team-card .card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #007bff;
    font-weight: bold;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card .team-number {
    font-size: 12px;
    color: #6c757d;
    font-weight: bold;
    margin: 5px 0 0 0;
    font-family: monospace;
}

.team-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.team-card .team-description {
    font-size: 13px;
    color: #495057;
    margin: 10px 0 15px 0;
    line-height: 1.4;
    height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    position: relative;
    cursor: pointer;
}

/* Tier 4 card descriptions (on tier 3 pages) - should be truncated to 3 lines */
.tier4-team .description-placeholder {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 5px;
    line-height: 1.4;
    color: #333;
    font-size: 13px;
    
    /* 3-line truncation for cards */
    height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Hover overlay for team card descriptions */
.team-card .team-description:hover {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 3px;
    -webkit-line-clamp: none;
    line-clamp: none;
    -webkit-box-orient: initial;
    overflow: visible;
    height: auto;
    max-width: 400px;
    display: block;
    text-overflow: initial;
}

/* Invisible placeholder to maintain space when hovering */
.team-card .team-description:hover::before {
    content: "";
    display: block;
    height: 4.2em; /* Same as original height */
    position: static;
    z-index: -1;
}

/* Team card description wrapper */
.team-card .description-wrapper {
    position: relative;
    cursor: pointer;
}

/* Team card placeholder */
.team-card .description-placeholder {
    font-size: 13px;
    color: #495057;
    margin: 10px 0 15px 0;
    line-height: 1.4;
    height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background-color: #f8f8f8;
    padding: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Team card overlay */
.team-card .description-overlay {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 3px;
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
    min-height: 4.2em; /* Exactly 3 lines (assuming 1.4 line height) */
    max-width: 400px;
    display: none;
}

/* Show team card overlay on hover */
.team-card .description-wrapper:hover .description-overlay {
    display: block;
}

.team-card .description-wrapper:hover .description-placeholder {
    opacity: 0.3;
}

.team-card .team-stats-mini {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.team-card .stat-mini {
    text-align: center;
    flex: 1; /* Each stat takes equal space */
}

.team-card .stat-mini .stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.team-card .stat-mini .stat-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.team-card .stat-mini .stat-sublabel {
    font-size: 8px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: -2px;
    display: block;
}

/* Team stats mini styling for tier1/tier2/tier3 main content areas */
.tier3-main-content .team-stats-mini {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.tier3-main-content .stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px; /* Space between rows */
}

.tier3-main-content .stats-row:last-child {
    margin-bottom: 0; /* Remove margin from last row */
}

.tier3-main-content .stat-mini {
    text-align: center;
    flex: 1; /* Each stat takes equal space */
}

.tier3-main-content .stat-mini .stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.tier3-main-content .stat-mini .stat-label {
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.tier3-main-content .stat-mini .stat-sublabel {
    font-size: 8px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: -2px;
    display: block;
}

.team-card .team-manager-mini {
    font-size: 12px;
    color: #495057;
    margin: 10px 0;
    padding: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
}

.team-card .team-manager-mini .manager-title {
    color: #6c757d;
    font-style: italic;
}

.team-card .team-members-mini {
    /* max-height: 150px; */
    /* overflow-y: auto; */
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 11px;
}

.team-card .team-members-mini .member {
    margin-bottom: 4px;
}

.team-card .team-members-mini .member {
    display: block; /* Override the flex from general .member rule */
    margin-bottom: 3px;
}

.team-card .team-members-mini .member:last-child {
    margin-bottom: 0;
}

.team-card .team-members-mini .member-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    width: 100%;
    min-width: 250px; /* Ensure enough space for proper alignment */
}

.team-card .team-members-mini .name {
    font-weight: 500;
    color: #495057;
}

.team-card .team-members-mini .name.contractor {
    font-family: Arial, sans-serif;
}

.team-card .team-members-mini .role {
    color: #6c757d;
    font-size: 10px;
    text-align: right;
    overflow-x: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 14px
}

.team-card .team-members-mini .team-count {
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    padding: 1px 4px;
    font-size: 8px;
    margin-left: 4px;
}

.team-card .card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.team-card .view-details {
    font-size: 12px;
    color: #007bff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Additional Tier 2 Team Styles */
.stats-section {
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #005177;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-structure-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.team-structure-summary h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #005177;
    font-size: 18px;
}

.role-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.role-category h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #005177;
    padding-bottom: 5px;
}

.role-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.role-name {
    font-size: 11px;
    color: #333;
}

.role-count {
    font-size: 11px;
    font-weight: bold;
    color: #005177;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
}

.tier3-teams-section {
    margin: 30px 0;
}

.tier3-teams-section h2 {
    margin-bottom: 10px;
    color: #005177;
    font-size: 18px;
}

.tier3-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.tier3-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tier3-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide link icon by default */
.tier3-card .link-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show link icon on card hover */
.tier3-card:hover .link-icon {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .teams-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .tier2-team .team-stats {
        justify-content: center;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
}

/* Tier 4 Team Specific Styling */

/* Workloads Section */
.tier4-workloads-section {
    margin: 0px 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.tier4-workloads-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier4-workloads-section h2::before {
    content: "ðŸ“Š";
    font-size: 20px;
}

/* Components Section */
.tier4-components-section {
    margin: 0px 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.tier4-components-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier4-components-section h2::before {
    content: "ðŸ”§";
    font-size: 20px;
}

/* Base Table Styling for Tier 4 */
.tier4-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    table-layout: fixed; /* Fixed layout for better overflow control */
}

.tier4-table thead th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 4px;
    text-align: left;
    font-size: 11px;
    border-right: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.tier4-table thead th:last-child {
    border-right: none;
}

.tier4-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0; /* Light grey horizontal lines */
}

.tier4-table tbody tr:hover {
    background-color: #f8f9fa;
}

.tier4-table tbody tr:last-child {
    border-bottom: none;
}

.tier4-table tbody td {
    padding: 3px 4px;
    vertical-align: top;
    border-right: 1px solid #f5f5f5; /* Very light grey vertical lines */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.tier4-table tbody td:last-child {
    border-right: none;
}

/* Empty state styling */
.tier4-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background-color: white;
    border-radius: 6px;
    border: 2px dashed #dee2e6;
}

.tier4-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.tier4-empty-state .empty-message {
    font-size: 16px;
    margin-bottom: 8px;
}

.tier4-empty-state .empty-submessage {
    font-size: 12px;
    color: #adb5bd;
}

/* Tier 4 Table Column Styling */
.tier4-name-column {
    min-width: 180px;
    font-weight: 500;
}

.tier4-title-column {
    min-width: 200px;
}

.tier4-role-column {
    min-width: 150px;
    font-weight: 500;
    color: #0056b3;
}

.tier4-email-column {
    min-width: 220px;
}

/* Email Link Styling */
.email-link {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.email-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.email-link:visited {
    color: #6f42c1;
}

/* Team count badge styling for table context */
.tier4-table .team-count {
    background-color: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 6px;
    font-weight: bold;
}

.tier4-table .contractor {
    font-style: italic;
}

/* Tier 4 Layout Improvements - Inspired by Tier 3 */
.tier4-main-content {
    flex: 0 0 100%; /* Full width for the top section */
    min-width: 0;
    padding-right: 20px;
}

.tier4-summary-column {
    flex: 0 0 100%; /* Full width for the bottom section */
    min-width: 0;
    margin-top: 30px;
}

/* Override tier3-team flex layout for tier 4 containers */
#tier4-container.tier3-team {
    display: block; /* Override the flex display to stack vertically */
}

/* Header section with two columns */
.tier4-header-section {
    display: flex;
    gap: 30px;
    margin-bottom: 0px;
}

.tier4-team-info {
    flex: 0 0 30%; /* Team info takes 40% of header width */
    min-width: 0;
}

.tier4-team-members {
    flex: 0 0 69%; /* Team members takes 58% of header width */
    min-width: 0;
}

.tier4-main-content h1 {
    color: #005177;
    font-size: 28px;
    margin-bottom: 0px;
    font-weight: 600;
}

.tier4-team-info .team-metadata {
    margin-top: 15px;
    color: #6c757d;
    font-size: 14px;
}

.tier4-team-name {
    font-size: 20px;
    color: #005177;
    font-weight: 700;
    margin-bottom: 0px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tier4-team-number {
    font-size: 12px;
    color: #005177;
    font-weight: 600;
    font-family: monospace;
    margin-bottom: 15px;
}

.tier4-main-content h3 {
    color: #005177;
    font-size: 18px;
    margin: 0 0 0px 0;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.tier4-data-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 30px 0 0 0;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.tier4-workloads-section,
.tier4-components-section {
    width: 100%; /* Full width for each section */
    overflow: visible;
    box-sizing: border-box;
}

.tier4-data-sections h3 {
    color: #005177;
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

/* Tier 4 Team Members Table Styling */
.tier4-team-members {
    margin-top: 0px;
}

.tier4-team-members .tier4-table {
    font-size: 13px;
}

.tier4-team-members .tier4-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid #dee2e6;
}

.tier4-team-members .tier4-table td {
    padding: 3px 8px;
    vertical-align: top;
}

/* Tier 4 Data Sections Styling */
.tier4-workloads-section,
.tier4-components-section {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent any content overflow */
}

.tier4-workloads-section {
    border-left: 4px solid #c71585;
}

.tier4-components-section {
    border-left: 4px solid #28a745;
}

/* Components table specific styling to handle overflow */
.tier4-components-section .tier4-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.tier4-components-section .tier4-table th:first-child,
.tier4-components-section .tier4-table td:first-child {
    width: 8%; /* ID column - narrow */
}

.tier4-components-section .tier4-table th:nth-child(2),
.tier4-components-section .tier4-table td:nth-child(2) {
    width: 15%; /* Name column */
}

.tier4-components-section .tier4-table th:nth-child(3),
.tier4-components-section .tier4-table td:nth-child(3) {
    width: 20%; /* Description column */
}

.tier4-components-section .tier4-table th:nth-child(4),
.tier4-components-section .tier4-table td:nth-child(4) {
    width: 15%; /* Paging Group column */
}

.tier4-components-section .tier4-table th:nth-child(5),
.tier4-components-section .tier4-table td:nth-child(5) {
    width: 10%; /* Tags column */
}

.tier4-components-section .tier4-table th:nth-child(6),
.tier4-components-section .tier4-table td:nth-child(6) {
    width: 10%; /* Repositories column */
}

.tier4-components-section .tier4-table th:nth-child(7),
.tier4-components-section .tier4-table td:nth-child(7) {
    width: 8%; /* Target Resiliency column */
}

.tier4-components-section .tier4-table th:nth-child(8),
.tier4-components-section .tier4-table td:nth-child(8) {
    width: 8%; /* Current Resiliency column */
}

.tier4-components-section .tier4-table th:nth-child(9),
.tier4-components-section .tier4-table td:nth-child(9) {
    width: 6%; /* IRW Exempt column */
}

/* Workloads table specific styling */
.tier4-workloads-section .tier4-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.tier4-workloads-section .tier4-table th:first-child,
.tier4-workloads-section .tier4-table td:first-child {
    width: 8%; /* ID column - narrow */
}

.tier4-workloads-section .tier4-table th:nth-child(2),
.tier4-workloads-section .tier4-table td:nth-child(2) {
    width: 15%; /* Name column */
}

.tier4-workloads-section .tier4-table th:nth-child(3),
.tier4-workloads-section .tier4-table td:nth-child(3) {
    width: 25%; /* Description column */
}

.tier4-workloads-section .tier4-table th:nth-child(4),
.tier4-workloads-section .tier4-table td:nth-child(4) {
    width: 15%; /* Paging Group column */
}

.tier4-workloads-section .tier4-table th:nth-child(5),
.tier4-workloads-section .tier4-table td:nth-child(5) {
    width: 20%; /* Labels column */
}

.tier4-workloads-section .tier4-table th:nth-child(6),
.tier4-workloads-section .tier4-table td:nth-child(6) {
    width: 8%; /* Target Resiliency column */
}

.tier4-workloads-section .tier4-table th:nth-child(7),
.tier4-workloads-section .tier4-table td:nth-child(7) {
    width: 8%; /* Current Resiliency column */
}

.tier4-workloads-section .tier4-table th:nth-child(8),
.tier4-workloads-section .tier4-table td:nth-child(8) {
    width: 6%; /* IRW Exempt column */
}

/* Tier 4 Team Link Styling */
.tier4-team-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.tier4-team-link:hover {
    color: #007bff;
    text-decoration: none;
    text-shadow: 0 0 1px rgba(0, 123, 255, 0.3);
    cursor: pointer;
}

/* Tier 4 Components Table - New Column Styling */
.tier4-repositories-column {
    line-height: 1.2 !important;
    max-height: 80px;
    overflow: visible;
    font-size: 11px;
}

.tier4-labels-column,
.tier4-tags-column {
    line-height: 1.2 !important;
    max-height: 80px;
    overflow: visible;
    font-size: 11px;
}

.tier4-paging-group-column {
    font-size: 11px;
    word-wrap: break-word;
}

.tier4-target-resiliency-column,
.tier4-current-resiliency-column {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
}

.tier4-irw-exempt-column {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
}

.tier4-irw-exempt-column:contains("Yes") {
    color: #d73027;
}

.tier4-irw-exempt-column:contains("No") {
    color: #1a9850;
}

/* Not Set Styling */
.not-set {
    color: #dc3545 !important; /* Red for Not set values */
    background-color: rgb(255, 223, 228);
    font-style: italic;
}

/* Component Description Hover Strategy */
.component-description-wrapper {
    position: relative;
    width: 100%;
}

.component-description-placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: opacity 0.2s ease;
}

/* Only show cursor pointer when text is actually truncated */
.component-description-wrapper:hover .component-description-placeholder {
    cursor: pointer;
}

.component-description-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 3px;
    line-height: 1.4;
    max-width: 400px;
    word-wrap: break-word;
    white-space: normal;
    display: none;
}

/* Only show overlay and dim placeholder for truncated text */
.component-description-wrapper.truncated:hover .component-description-overlay {
    display: block;
}

.component-description-wrapper.truncated:hover .component-description-placeholder {
    opacity: 0.3;
}

.component-description-wrapper.truncated {
    cursor: pointer;
}

/* Component Repositories Hover Strategy */
.component-repositories-wrapper {
    position: relative;
    width: 100%;
}

.component-repositories-placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: opacity 0.2s ease;
}

/* Only show cursor pointer when text is actually truncated */
.component-repositories-wrapper:hover .component-repositories-placeholder {
    cursor: pointer;
}

.component-repositories-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 3px;
    line-height: 1.4;
    max-width: 400px;
    word-wrap: break-word;
    white-space: normal;
    display: none;
}

/* Only show overlay and dim placeholder for multiple repositories */
.component-repositories-wrapper.multiple-repos:hover .component-repositories-overlay {
    display: block;
}

.component-repositories-wrapper.multiple-repos:hover .component-repositories-placeholder {
    opacity: 0.3;
}

.component-repositories-wrapper.multiple-repos {
    cursor: pointer;
}

/* Repository Count Pill */
.repo-count-pill {
    display: inline-block;
    background-color: #007bff;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Repository Links */
.repo-link {
    color: #007bff;
    text-decoration: none;
}

.repo-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.repo-link:visited {
    color: #6f42c1;
}

.repo-link:visited:hover {
    color: #5a2a9d;
}

/* External Link Icon */
.external-link-icon {
    font-size: 0.9em;
    margin-left: 4px;
    opacity: 0.8;
    display: inline-block;
    vertical-align: middle;
    font-weight: normal;
}

/* Label Pills */
.label-pill {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
    padding-right: 20px !important; /* Extra space for sort indicator */
}

/* Hover state - slightly darker blue */
.sortable:hover {
    background-color: #0056b3 !important;
}

/* Sort indicators - always present but normally invisible */
.sort-indicator {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Show subtle arrows on hover for unsorted columns */
.sortable:hover .sort-indicator {
    opacity: 0.7;
}

.sortable:hover .sort-indicator::after {
    content: "▲▼";
    font-size: 9px;
    letter-spacing: -1px;
}

/* Active sorted state - darker blue with visible arrow */
.sortable.sort-asc,
.sortable.sort-desc {
    background-color: #004085 !important;
    font-weight: bold;
}

.sortable.sort-asc .sort-indicator,
.sortable.sort-desc .sort-indicator {
    opacity: 1;
}

/* Specific sort direction indicators */
.sortable.sort-asc .sort-indicator::after {
    content: "▲";
}

.sortable.sort-desc .sort-indicator::after {
    content: "▼";
}

/* ServiceNow CI ID Links */
.servicenow-link {
    color: #005177;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.servicenow-link:hover {
    text-decoration: underline;
    color: #003d5a;
}

.servicenow-link .external-link-icon {
    font-size: 0.8em;
    opacity: 0.7;
}

.servicenow-link:hover .external-link-icon {
    opacity: 1;
}

/* Ensure proper spacing in table cells */
.tier4-id-column .servicenow-link {
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .team-card {
        min-height: auto;
    }
}

/* ============================================================================
   Shared Team Views Styles
   ============================================================================ */

/* Tier 4 header controls container */
.tier4-view-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Show Inactive Roles checkbox */
.show-inactive-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

/* Shared views selector */
.shared-views-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shared-views-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.shared-views-selector select {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.shared-views-selector select:hover {
    border-color: #007bff;
}

.shared-views-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal content */
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

/* Clickable role count styling */
.role-count.clickable-count {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.role-count.clickable-count:hover {
    background-color: #e3f2fd;
    color: #0056b3;
    transform: scale(1.1);
}

.role-count.clickable-count:active {
    background-color: #bbdefb;
    transform: scale(1.05);
}

/* Member details modal specific styling */
.member-modal-content {
    max-width: 1200px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.member-modal-content .modal-header {
    margin-bottom: 16px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 12px;
}

.member-modal-content .modal-header h3 {
    margin: 0 0 4px 0;
    color: #005177;
}

.member-modal-content .member-count {
    margin: 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Member table container with scrolling */
.member-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 16px;
    max-height: calc(90vh - 200px);
}

/* Member details table column widths */
.member-details-table .tier4-name-column {
    min-width: 150px;
}

.member-details-table .tier4-email-column {
    min-width: 200px;
}

.member-details-table .tier4-role-column {
    min-width: 150px;
}

.member-details-table .tier4-title-column {
    min-width: 120px;
}

.member-details-table .tier4-team-column {
    min-width: 180px;
}

.member-details-table .tier4-active-column,
.member-details-table .tier4-contractor-column {
    min-width: 80px;
    text-align: center;
}

/* Email links in table */
.email-link {
    color: #007bff;
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

/* Contractor badge in title column */
.contractor-badge {
    display: inline-block;
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    font-style: italic;
}

/* Modal actions button row */
.member-modal-content .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* Form group */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

/* Modal actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Shared view save button */
.shared-view-save-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    z-index: 1000;
    transition: all 0.2s ease;
    animation: slideInUp 0.3s ease;
}

.shared-view-save-btn:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.5);
    transform: translateY(-2px);
}

.shared-view-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Annotation Toolbar Styles
   =================================== */

/* Annotation toolbar container */
.annotation-toolbar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 12px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 60px;
}

/* Toolbar header */
.annotation-toolbar-header {
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #007bff;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
}

/* Tool button */
.annotation-tool-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.annotation-tool-btn:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: scale(1.05);
}

.annotation-tool-btn.active {
    background: #007bff;
    border-color: #0056b3;
    color: white;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

.annotation-tool-btn:active {
    transform: scale(0.95);
}

/* Tool button icons using unicode/symbols */
.annotation-tool-btn[data-tool="text"]::after {
    content: "T";
    font-weight: bold;
    font-size: 24px;
}

.annotation-tool-btn[data-tool="rectangle"]::after {
    content: "□";
    font-size: 28px;
}

.annotation-tool-btn[data-tool="circle"]::after {
    content: "○";
    font-size: 28px;
}

.annotation-tool-btn[data-tool="line"]::after {
    content: "/";
    font-size: 28px;
    font-weight: bold;
}

/* Hide toolbar when not in concise view */
.annotation-toolbar.hidden {
    display: none;
}

/* ===================================
   Annotation Rendering Styles
   =================================== */

/* Base annotation style */
.annotation {
    position: absolute;
    cursor: move;
    box-sizing: border-box;
}

/* Selected annotation visual feedback */
.annotation.selected {
    outline: 2px dashed #007bff;
    outline-offset: 2px;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid #007bff;
    box-sizing: border-box;
    z-index: 10001; /* Above annotations */
}

/* Corner handles */
.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

/* Edge handles */
.resize-handle.n { top: -4px; left: 50%; margin-left: -4px; cursor: n-resize; }
.resize-handle.s { bottom: -4px; left: 50%; margin-left: -4px; cursor: s-resize; }
.resize-handle.w { top: 50%; left: -4px; margin-top: -4px; cursor: w-resize; }
.resize-handle.e { top: 50%; right: -4px; margin-top: -4px; cursor: e-resize; }

/* Line endpoint handles (for lines only) */
.resize-handle.line-start,
.resize-handle.line-end {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #007bff;
    border: 2px solid white;
    cursor: move;
}

/* Text annotation */
.annotation-text {
    padding: 4px 8px;
    overflow: hidden;
    word-wrap: break-word;
    user-select: none;
    cursor: move;
}

.annotation-text[contenteditable="true"] {
    user-select: text;
    cursor: text;
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* Placeholder styling for empty text boxes */
.annotation-text:empty:not([contenteditable="true"])::before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

/* Shape annotations (rectangle, circle) */
.annotation-rectangle,
.annotation-circle {
    box-sizing: border-box;
}

.annotation-circle {
    border-radius: 50%;
}

/* Line annotation */
.annotation-line {
    pointer-events: none; /* Let clicks pass through the container */
}

.annotation-line svg {
    pointer-events: auto; /* But capture clicks on the SVG itself */
    cursor: move;
}

/* Allow pointer events on line resize handles */
.annotation-line .resize-handle {
    pointer-events: auto;
}

/* Drawing preview (rubber band effect) */
.annotation-preview {
    position: absolute;
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    z-index: 10000;
}

/* Line drawing preview */
.annotation-preview-line {
    position: absolute;
    pointer-events: none;
    z-index: 10000;
}

/* Annotation Properties Palette */
.annotation-properties-palette {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 200px;
    font-size: 12px;
    display: none;
}

.annotation-properties-palette.visible {
    display: block;
}

.annotation-properties-palette .property-group {
    margin-bottom: 8px;
}

.annotation-properties-palette .property-group:last-child {
    margin-bottom: 0;
}

.annotation-properties-palette .property-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
}

.annotation-properties-palette input[type="color"],
.annotation-properties-palette input[type="number"],
.annotation-properties-palette select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.annotation-properties-palette input[type="color"] {
    height: 30px;
    cursor: pointer;
}

.annotation-properties-palette input[type="number"] {
    width: 60px;
}

.annotation-properties-palette .property-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.annotation-properties-palette .property-row label {
    flex: 1;
}

.annotation-properties-palette .layer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.annotation-properties-palette .layer-btn {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
}

.annotation-properties-palette .layer-btn:hover {
    background: #f0f0f0;
}

.annotation-properties-palette .layer-btn:active {
    background: #e0e0e0;
}
/* Webapp Navigation Styles */
.webapp-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.webapp-nav-brand {
    color: white;
    text-decoration: none;
}

.webapp-nav-logo {
    display: inline-block;
    position: relative;
    top: 2px;
}

.webapp-nav-title {
    display: inline-block;
    position: relative;
    left: 4px;
    top: -2px;
}

/* Template Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.inline-block {
    display: inline-block;
}

/* Landing Page Styles */
.loading-indicator {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.recent-searches {
    margin: 1rem auto 3rem auto;
    display: none;
}

.flex-wrap-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.centered-section {
    margin: 2rem 0;
    text-align: center;
}

.subtitle-text {
    margin-bottom: 1.5rem;
    color: #666;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.team-preview-card {
    text-align: center;
    max-width: 300px;
}

.preview-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.preview-title {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.preview-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.clickable {
    cursor: pointer;
}

/* Error Page Styles */
.error-container {
    margin-top: 2rem;
}

.error-details {
    margin-top: 2rem;
    color: #666;
}

.error-list {
    text-align: left;
    display: inline-block;
}

/* Authentication Page Styles */
.btn-microsoft {
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    border: 1px solid #0066cc;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-microsoft:hover {
    background: linear-gradient(135deg, #106ebe 0%, #005a9e 100%);
    border-color: #005a9e;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.3);
}

.btn-microsoft:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.2);
}

.btn-microsoft:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.25);
}

.btn-microsoft svg {
    margin-right: 8px;
    vertical-align: middle;
}

.btn-clear-data {
    background: #f3f2f1;
    border: 1px solid #8a8886;
    color: #323130;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 12px;
}

.btn-clear-data:hover {
    background: #e1dfdd;
    border-color: #605e5c;
    color: #201f1e;
}

.btn-clear-data:active {
    background: #d2d0ce;
}

.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
    margin-top: 5rem;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-title {
    color: #323130;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-subtitle {
    color: #605e5c;
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* Webapp Navigation (from base.html) */
.webapp-nav {
    background: #2c3e50;
    padding: 1rem;
    color: white;
    margin-bottom: 2rem;
}

.webapp-nav h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

/* Search Container and Results */
.search-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.search-box {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.search-results {
    margin-top: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-result {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-result.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.search-result:last-child {
    border-bottom: none;
}

.team-number {
    font-weight: bold;
    color: #2c3e50;
}

.team-tier {
    background: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.team-description {
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
}

.member-match {
    color: #27ae60;
    font-size: 0.9rem;
    margin-top: 4px;
    font-weight: 500;
}

.match-type {
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: bold;
}

.team-match-indicator {
    background: #3498db;
    color: white;
}

.member-match-indicator {
    background: #27ae60;
    color: white;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

/* Quick Search Buttons (from index.html) */
.quick-search-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.quick-search-btn:hover {
    background: #2980b9;
}

.recent-search-btn {
    background: #27ae60;
}

.recent-search-btn:hover {
    background: #219a52;
}

.clear-recent-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.clear-recent-btn:hover {
    background: #c0392b;
}

#recent-searches {
    margin-top: 2rem;
}

/* Team Preview Image Effects */
.team-preview-card {
    position: relative;
    overflow: visible;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.preview-image:hover {
    transform: scale(2.5);
    z-index: 1000;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

/* Modal overlay for full-size image view */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    cursor: pointer;
}

.image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.image-modal .close-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 5px;
}
