/**
 * Projects Tab Specific Styling for AMD Construction Pro
 * Modern UI Design - Clean and Intuitive
 * Three Section Layout: Projects List | Project Details + Calendar | Files + Financials
 */

/* =============================
   PROJECTS TAB SPECIFIC STYLES
   ============================= */

/* Old conflicting styles removed - headers now handled by headers.css */

/* ========================================
   MAIN LAYOUT STRUCTURE
   ======================================== */

#projects-tab {
    height: 100%;
    width: 100%;
    max-width: 100vw; /* Ensure it doesn't exceed viewport width */
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden !important;
}

#projects-tab .projects-column,
#projects-tab .projects-middle-column,
#projects-tab .projects-right-column {
    min-height: 0;
}

#projects-tab .projects-main-layout {
    display: grid;
    grid-template-columns: minmax(200px, 0.7fr) minmax(300px, 1.5fr) minmax(250px, 0.8fr); /* Reduced minimums and ratios */
    gap: 6px; /* Reduced from 8px */
    padding: 4px; /* Reduced from 6px */
    height: 100%;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden; /* Prevent main layout scroll */
    box-sizing: border-box;
}

@media (max-width: 1400px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1.4fr) minmax(220px, 0.8fr);
        gap: 4px;
        padding: 4px;
    }
}

@media (max-width: 1200px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(160px, 0.6fr) minmax(250px, 1.3fr) minmax(200px, 0.8fr);
        gap: 4px;
        padding: 4px;
    }
}

@media (max-width: 1000px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(150px, 0.6fr) minmax(220px, 1.2fr) minmax(180px, 0.8fr);
        gap: 3px;
        padding: 3px;
    }
}

@media (max-width: 900px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 4px;
    }
    
    /* Stack columns vertically on smaller screens */
    #projects-tab .projects-right-column {
        gap: 8px;
    }
}

@media (max-width: 800px) {
    #projects-tab .projects-main-layout {
        display: flex;
        flex-direction: column;
        height: 100%;
        gap: 3px;
        padding: 3px;
    }
    
    #projects-tab .projects-column,
    #projects-tab .projects-middle-column,
    #projects-tab .projects-right-column {
        min-height: 200px;
        flex-shrink: 0;
    }
}

/* ========================================
   PROJECTS TAB SPECIFIC STYLES
   ======================================== */

/* ----------------------------------------
   COMMON STYLES
   ---------------------------------------- */

#projects-tab {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --primary-active: #1f6391;
    --secondary-color: #95a5a6;
    --secondary-hover: #7f8c8d;
    --background-color: #f8f9fa;
    --card-background: #fff;
    --text-color: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------
   PROJECT LIST STYLES
   ---------------------------------------- */

#projects-tab .projects-column {
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0; /* Allow columns to shrink */
    max-width: 100%; /* Prevent overflow */
}

/* Headers unified in headers.css */

/* Project Filters */
#projects-tab .projects-filters {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#projects-tab .projects-filters input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

#projects-tab .projects-filters input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#projects-tab .projects-filters select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#projects-tab .projects-filters select:focus {
    outline: none;
    border-color: #3498db;
}

/* Project Actions */
#projects-tab .projects-actions {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    display: flex;
    gap: 10px;
}

#projects-tab .projects-actions .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    text-align: center;
}

#projects-tab .projects-actions .btn.primary {
    background: #3498db;
    color: white;
}

#projects-tab .projects-actions .btn.primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-1px);
}

#projects-tab .projects-actions .btn.secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
}

#projects-tab .projects-actions .btn.secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%);
    transform: translateY(-1px);
}

/* Project List */
#projects-tab .project-list {
    flex: 1 1 auto;
    overflow-y: scroll;
    padding: 2px !important;
}

#projects-tab .project-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 4px;
    padding: 2px 4px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#projects-tab .project-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

#projects-tab .project-item.selected,
#projects-tab .project-item.active {
    background: #e3f2fd;
    border-color: #3498db;
}

#projects-tab .project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

#projects-tab .project-name {
    font-weight: 600;
    font-size: 9px;
    color: #2c3e50;
}

#projects-tab .project-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#projects-tab .status-active {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: #fff;
}

#projects-tab .status-planning {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: #fff;
}

#projects-tab .status-bidding {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: #fff;
}

#projects-tab .status-completed {
    background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
    color: #fff;
}

#projects-tab .status-on-hold {
    background: linear-gradient(135deg, #607d8b 0%, #78909c 100%);
    color: #fff;
}

#projects-tab .project-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

#projects-tab .project-address {
    font-size: 10px;
    color: #6c757d;
    flex: 1;
}

#projects-tab .project-value {
    font-size: 11px;
    font-weight: 600;
    color: #27ae60;
}

#projects-tab .project-timeline {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #6c757d;
}

#projects-tab .start-date,
#projects-tab .end-date {
    padding: 1px 4px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* ========================================
   MIDDLE COLUMN - PROJECT DETAILS & CALENDAR
   ======================================== */

#projects-tab .projects-middle-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    min-width: 0; /* Allow column to shrink */
    max-width: 100%; /* Prevent overflow */
    overflow: hidden;
    box-sizing: border-box;
}

/* Project Details Section */
#projects-tab .project-details-section {
    flex: 0 1 40%; 
    min-height: 220px;
    max-height: 48vh;
    height: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,62,80,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;    box-sizing: border-box;
    margin-bottom: 0;
}

#projects-tab .project-details-scrollable {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 0 0 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    margin-top: 0; /* Ensure no top margin */
    gap: 0;
}

#projects-tab .project-header-info {
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

#projects-tab .project-name-address .project-name {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

#projects-tab .project-name-address .project-address {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

#projects-tab .project-name-address .project-type {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
}

#projects-tab .customer-information,
#projects-tab .project-manager {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 16px 0px 16px; 
    display: flex;
    font-size: 12px;
}

#projects-tab .customer-information h4,
#projects-tab .project-manager h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#projects-tab .project-actions {
    padding: 6px 8px; 
    gap: 2px;
    background: #f8f9fa;
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    margin-top: 0; /* Ensure no top margin to eliminate gap */
    border-top: none; /* Remove border to eliminate visual gap */
}

#projects-tab .project-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex: 1;
    min-width: 120px;
}

#projects-tab .project-actions .btn.primary {
    background: #3498db;
    color: white;
}

#projects-tab .project-actions .btn.primary:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#projects-tab .project-actions .btn.secondary {
    background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
    color: #34495e;
    border: 1px solid #bdc3c7;
}

#projects-tab .project-actions .btn.secondary:hover {
    background: linear-gradient(135deg, #d5dbdb 0%, #aeb6bf 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(189, 195, 199, 0.3);
}

/* Project Calendar Section */
#projects-tab .project-calendar-section {
    flex: 1 1 60%; /* 2/3 of the column height */
    min-height: 200px; /* Increased slightly for better usability */
    max-height: none;
    height: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,62,80,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* Ensure calendar wrapper fills available space efficiently */
#projects-tab .project-calendar-section .calendar-container table {
    height: 100%;
    min-height: 200px;
}

/* Calendar tbody to fill remaining space after header */
#project-calendar-table tbody {
    height: 100%;
    vertical-align: top;
}

/* Calendar Filters - FULL WIDTH WITH VIEW CONTROLS ON RIGHT */
#projects-tab .calendar-filters {
    padding: 0px; 
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 2px; 
    align-items: center;
    justify-content: left; 
    min-height: 18px; 
    width: 100%; 
    margin: 0; 
    border-top: none; 
}

/* Calendar Navigation - COMPACT WITH LARGER TEXT */
#projects-tab .calendar-navigation {
    padding: 0px; /* Removed all padding to eliminate gaps */
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: center; /* Center only the month navigation */
    align-items: center;
    min-height: 18px; /* Further reduced from 20px */
    margin: 0; /* Ensure no margin gaps */
    border-top: none; /* Remove any top border that might create visual gap */
}

#projects-tab .view-controls {
    display: flex;
    gap: 1px; /* Slightly increased from 1px for better spacing with larger buttons */
    flex-wrap: nowrap; /* Keep view controls in one line */
    align-items: center;
    margin-left: auto; /* Push to the right side of filters */
}

#projects-tab .view-btn {
    padding: 6px 16px; /* Made wider - increased from 5px 10px */
    border: 1px solid #d1d7dc;
    background: #fff;
    border-radius: 4px; /* Slightly increased for better appearance */
    font-size: 10px;
    font-weight: 500; /* Added font weight for better readability */
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 55px; /* Increased minimum width for wider buttons */
}

#projects-tab .view-btn.active,
#projects-tab .view-btn:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

#projects-tab .month-navigation {
    display: flex;
    align-items: center;
    gap: 4px; /* Reduced from 8px for more compact layout */
    flex-shrink: 0;
    margin: 0; /* Ensure no margin gaps */
    padding: 0; /* Remove any internal padding */
}

#projects-tab .nav-btn {
    padding: 2px 5px; /* Further reduced height - shorter buttons */
    border: 1px solid #d1d7dc;
    background: #fff;
    border-radius: 2px; /* Further reduced from 3px */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px; /* Increased from 10px for larger text */
    font-weight: 600; /* Added bold for better visibility */
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px; /* Compact width */
    height: 20px; /* Fixed shorter height */
}

#projects-tab .nav-btn:hover {
    background: #f8f9fa;
    border-color: #95a5a6;
}

#projects-tab .current-month {
    font-weight: 700; /* Increased from 600 for more prominence */
    font-size: 14px; /* Increased from 11px for larger text */
    color: #2c3e50;
    min-width: 90px; /* Increased from 70px to accommodate larger text */
    text-align: center;
    white-space: nowrap;
    margin: 0 6px; /* Added margin for better spacing */
}

/* Calendar Container - OPTIMIZED FOR SPACE FILLING */
#projects-tab .calendar-container {
    flex: 1;
    padding: 4px 6px; /* Reduced from 6px 8px */
    overflow: scroll;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Project Calendar Table Styles - SCALED DOWN */
#projects-tab .project-calendar-section .calendar-container {
    width: 100%;
    height: 100%;
    min-height: 150px; /* Reduced from 200px */
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 0;
}

#project-calendar-table.calendar-table {
    width: 100%;
    height: 100%;
    border-collapse: separate;
    border-spacing: 1px;
    table-layout: fixed;
    background: transparent;
    flex: 1;
}

#project-calendar-table th {
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    font-size: 12px; /* Reduced from 15px */
    border-radius: 4px 4px 0 0;
    height: 28px; /* Reduced from 36px */
    vertical-align: middle;
    padding: 0;
}

#project-calendar-table td.calendar-day {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 3px; /* Reduced from 4px */
    vertical-align: top;
    position: relative;
    transition: background 0.2s, border 0.2s;
    cursor: pointer;
    height: calc((100vh - 450px) / 6); /* Adjusted calculation */
    min-height: 45px; /* Reduced from 60px */
    max-height: 90px; /* Reduced from 120px */
    padding: 2px; /* Added minimal padding */
}

#project-calendar-table .calendar-day-number {
    font-size: 13px; /* Reduced from 16px */
    font-weight: 600;
    margin: 2px 0 1px 3px; /* Reduced margins */
    text-align: left;
}

#project-calendar-table .calendar-events {
    margin-top: 1px; /* Reduced from 2px */
    display: flex;
    flex-direction: column;
    gap: 1px; /* Reduced from 2px */
    padding: 0 2px; /* Added horizontal padding */
}

#project-calendar-table .calendar-event {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 2px; /* Reduced from 3px */
    padding: 1px 3px; /* Reduced from 2px 4px */
    font-size: 10px; /* Reduced from 12px */
    margin: 1px 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2; /* Tighter line height */
}

#project-calendar-table .calendar-more-events {
    font-size: 9px; /* Reduced from 10px */
    color: #666;
    font-style: italic;
    padding: 1px 3px; /* Reduced padding */
    text-align: center;
}

/* Enhanced Gantt View - IMPROVED PROPORTIONS AND PANNING */
#project-calendar-table.gantt-view {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden; /* Hide table overflow, use container scroll */
}

/* Gantt container with panning support */
.gantt-scroll-container {
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scrolling for panning */
    position: relative;
}

#project-calendar-table .gantt-month {
    background: #2c3e50;
    color: white;
    font-size: 11px; /* Reduced from 12px */
    font-weight: 600;
    padding: 6px 2px; /* Reduced padding */
    text-align: center;
    border-right: 1px solid #34495e;
    position: sticky;
    top: 0;
    z-index: 10;
}

#project-calendar-table .gantt-day {
    background: #f8f9fa;
    font-size: 9px; /* Reduced from 10px */
    padding: 3px 1px; /* Reduced padding */
    text-align: center;
    border-right: 1px solid #e9ecef;
    min-width: 20px; /* Reduced from 25px */
    position: sticky;
    top: 28px; /* Position below month header */
    z-index: 9;
}

#project-calendar-table .gantt-row {
    border-bottom: 1px solid #e9ecef;
    display: flex; /* Use flexbox for proper width control */
}

#project-calendar-table .gantt-task-info {
    width: 15%; /* Fixed 15% width for task list */
    min-width: 120px; /* Minimum width for readability */
    max-width: 200px; /* Maximum width to prevent too wide */
    background: #fff;
    padding: 6px 8px; /* Reduced padding */
    border-right: 2px solid #e9ecef;
    vertical-align: middle;
    position: sticky;
    left: 0;
    z-index: 8;
    flex-shrink: 0;
}

#project-calendar-table .task-name {
    font-size: 11px; /* Reduced from 13px */
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1px; /* Reduced margin */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#project-calendar-table .task-dates {
    font-size: 9px; /* Reduced from 10px */
    color: #666;
    white-space: nowrap;
}

#project-calendar-table .gantt-timeline {
    width: 85%; /* Fixed 85% width for timeline */
    position: relative;
    padding: 0;
    flex-grow: 1;
    min-width: 0; /* Allow shrinking */
}

#project-calendar-table .gantt-bar-container {
    position: relative;
    height: 28px; /* Reduced from 32px */
    margin: 6px 0; /* Reduced margins */
    width: 100%;
    min-width: max-content; /* Ensure full timeline is rendered */
}

#project-calendar-table .gantt-bar {
    position: absolute;
    height: 100%;
    border-radius: 3px; /* Reduced from 4px */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Lighter shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    cursor: pointer;
    min-width: 30px; /* Minimum width for visibility */
}

#project-calendar-table .gantt-bar-text {
    color: white;
    font-size: 10px; /* Reduced from 11px */
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 2;
    position: relative;
    padding: 0 4px; /* Added padding for text */
}

/* Week View - Scaled Down */
#project-calendar-table .time-cell {
    font-size: 10px; /* Reduced from 11px */
    padding: 3px 6px; /* Reduced padding */
}

#project-calendar-table .hour-cell {
    min-height: 30px; /* Reduced from 40px */
    padding: 2px; /* Reduced padding */
}

#project-calendar-table .week-event {
    font-size: 9px; /* Reduced from 10px */
    padding: 1px 3px; /* Reduced padding */
}

/* Day View - Scaled Down */
#project-calendar-table .day-view-header {
    font-size: 16px; /* Reduced from 18px */
    padding: 8px; /* Reduced from 12px */
}

#project-calendar-table .day-view-cell {
    min-height: 45px; /* Reduced from 60px */
    padding: 6px; /* Reduced from 8px */
}

#project-calendar-table .day-event {
    padding: 6px; /* Reduced from 8px */
    margin-bottom: 3px; /* Reduced margin */
}

#project-calendar-table .event-time {
    font-size: 10px; /* Reduced from 11px */
}

#project-calendar-table .event-title {
    font-size: 11px; /* Reduced from 13px */
}

/* Year View - Scaled Down */
#project-calendar-table .year-view-header {
    font-size: 20px; /* Reduced from 24px */
    padding: 12px; /* Reduced from 16px */
}

#project-calendar-table .month-cell {
    padding: 8px; /* Reduced from 12px */
    border-radius: 6px; /* Reduced from 8px */
}

#project-calendar-table .month-header h4 {
    font-size: 14px; /* Reduced from 16px */
}

#project-calendar-table .event-count {
    font-size: 10px; /* Reduced from 12px */
    padding: 1px 6px; /* Reduced padding */
}

#project-calendar-table .status-stat {
    font-size: 10px; /* Reduced from 11px */
}

#project-calendar-table .preview-event {
    font-size: 10px; /* Reduced from 11px */
    padding: 1px 3px; /* Reduced padding */
}

#projects-tab .calendar-week-row td {
    vertical-align: top;
}

#projects-tab .calendar-week-cell,
#projects-tab .calendar-day-detail,
#projects-tab .calendar-year-cell {
    background: #f8fafc;
    border-radius: 10px;
}

#projects-tab .calendar-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#projects-tab .calendar-week-events,
#projects-tab .day-view-events {
    display: grid;
    gap: 8px;
}

#projects-tab .calendar-pill-event {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 6px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

#projects-tab .calendar-day-empty {
    color: #64748b;
    font-style: italic;
    font-size: 11px;
    padding: 8px 4px;
}

#projects-tab .calendar-day-detail {
    padding: 12px !important;
}

#projects-tab .day-view-header {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

#projects-tab .day-event {
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
}

#projects-tab .day-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    color: #64748b;
}

#projects-tab .calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

#projects-tab .calendar-year-month {
    width: 100%;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#projects-tab .calendar-year-month:hover,
#projects-tab .calendar-year-month.selected {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

#projects-tab .month-preview {
    display: grid;
    gap: 6px;
}

#projects-tab .preview-event {
    display: flex;
    align-items: center;
    gap: 8px;
}

#projects-tab .preview-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 8px;
}

#projects-tab .project-calendar-event-details {
    display: grid;
    gap: 8px;
    min-width: min(420px, 100%);
}

/* ========================================
   RIGHT COLUMN - FILES & FINANCIALS
   ======================================== */

#projects-tab .projects-right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Allow column to shrink */
    max-width: 100%; /* Prevent overflow */
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Project Files Section */
#projects-tab .project-files-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;    min-height: 0;
}

/* Enhanced Files Header with Controls */
#projects-tab .files-header {
    padding: 6px 10px !important;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#projects-tab .files-header h3 {
    margin: 0 !important;
    flex-shrink: 0;
}

#projects-tab .files-header .search-container {
    position: relative;
    min-width: 100px;
    max-width: 120px;
    margin-top: 15px;
    flex-shrink: 0;
}

#projects-tab .files-header .header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

#projects-tab .files-header .search-input {
    width: 100%;
    padding: 0 10px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    transition: all 0.2s ease;
    height: 28px;
    box-sizing: border-box;
    line-height: 26px;
    vertical-align: middle;
}

#projects-tab .files-header .search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#projects-tab .files-header .search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

#projects-tab .files-header .search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

#projects-tab .files-header .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
}

#projects-tab .files-header .btn.btn-upload {
    padding: 6px 10px;
    gap: 4px;
}

#projects-tab .files-header .btn.btn-delete {
    padding: 6px 8px;
}

#projects-tab .files-header .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

#projects-tab .files-header .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#projects-tab .files-header .btn-primary {
    background: rgba(52, 152, 219, 0.8);
    border-color: rgba(52, 152, 219, 0.9);
}

#projects-tab .files-header .btn-primary:hover {
    background: rgba(52, 152, 219, 1);
}

#projects-tab .files-header .btn-danger {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.9);
}

#projects-tab .files-header .btn-danger:hover {
    background: rgba(231, 76, 60, 1);
}

#projects-tab .files-header .view-toggle {
    display: flex;
    gap: 1px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

#projects-tab .files-header .btn-view {
    padding: 4px 6px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

#projects-tab .files-header .btn-view.active {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Active Project Display */
#projects-tab .active-project-display {
    padding: 6px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #495057;
    flex-shrink: 0;
}

#projects-tab .active-project-display .project-name-label {
    font-weight: 500;
    color: #6c757d;
}

#projects-tab .active-project-display .active-project-name {
    font-weight: 600;
    color: #2c3e50;
}

/* File Explorer Container */
#projects-tab .file-explorer-container {
    flex: 1;
    display: flex;
    min-height: 0;
    background: #fff;
    min-width: 0;
}

/* File Tree Panel */
#projects-tab .file-tree-panel {
    width: clamp(190px, 28%, 280px);
    min-width: 180px;
    max-width: 320px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    resize: horizontal;
    overflow: hidden;
}

#projects-tab .tree-header {
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#projects-tab .tree-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

#projects-tab .btn-collapse-all {
    padding: 3px 5px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 2px;
    color: #6c757d;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#projects-tab .btn-collapse-all:hover {
    background: #e9ecef;
    color: #495057;
}

#projects-tab .folder-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* Folder Items */
#projects-tab .folder-item {
    margin: 0;
    border: none;
    border-radius: 0;
}

#projects-tab .folder-header {
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 3px solid transparent;
}

#projects-tab .folder-header:hover {
    background: #e9ecef;
}

#projects-tab .folder-header.folder-header-display-only {
    cursor: default;
}

#projects-tab .folder-header.folder-header-display-only:hover {
    background: transparent;
}

#projects-tab .folder-header.folder-header-display-only .folder-toggle {
    visibility: hidden;
}

#projects-tab .folder-header.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
    color: #1976d2;
}

#projects-tab .folder-toggle {
    width: 10px;
    font-size: 9px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

#projects-tab .folder-item.open .folder-toggle {
    transform: rotate(90deg);
}

#projects-tab .folder-icon {
    font-size: 12px;
    color: #ffc107;
}

#projects-tab .folder-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

#projects-tab .folder-count {
    font-size: 9px;
    color: #6c757d;
    background: #dee2e6;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

#projects-tab .folder-count.folder-count-empty {
    visibility: hidden;
}

#projects-tab .folder-contents {
    padding-left: 20px;
    display: none;
}

#projects-tab .folder-item.open .folder-contents {
    display: block;
}

#projects-tab .subfolder-item {
    padding: 4px 12px 4px 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6c757d;
}

#projects-tab .subfolder-item:hover {
    background: #f0f0f0;
}

#projects-tab .subfolder-item.active {
    background: #e8f4fd;
    color: #1976d2;
}

/* File List Panel */
#projects-tab .file-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}

/* Breadcrumb Navigation */
#projects-tab .breadcrumb-nav {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    flex-shrink: 0;
}

#projects-tab .breadcrumb-item {
    padding: 2px 6px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 2px;
    color: #6c757d;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
}

#projects-tab .breadcrumb-item:hover {
    background: #e9ecef;
    color: #495057;
}

#projects-tab .breadcrumb-item.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    cursor: default;
}

#projects-tab .breadcrumb-item::after {
    content: '>';
    margin-left: 8px;
    color: #adb5bd;
}

#projects-tab .breadcrumb-item:last-child::after {
    display: none;
}

/* File Content Area */
#projects-tab .file-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
    min-width: 0;
}

/* List View Styles */
#projects-tab .files-list-view {
    width: 100%;
}

#projects-tab .files-list-header {
    display: grid;
    grid-template-columns: 28px minmax(180px, 1fr) 90px 80px 120px 126px;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px 3px 0 0;
    font-size: 10px;
    font-weight: 600;
    color: #495057;
}

#projects-tab .file-list-item {
    display: grid;
    grid-template-columns: 28px minmax(180px, 1fr) 90px 80px 120px 126px;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-top: none;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
}

#projects-tab .file-list-item:hover {
    background: #f8f9fa;
}

#projects-tab .file-list-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

#projects-tab .file-list-item:last-child {
    border-radius: 0 0 3px 3px;
}

#projects-tab .file-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

#projects-tab .file-icon-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

#projects-tab .file-icon {
    font-size: 16px;
    flex-shrink: 0;
}

#projects-tab .file-name {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#projects-tab .file-size {
    font-size: 10px;
    color: #6c757d;
    text-align: right;
}

#projects-tab .file-type {
    font-size: 9px;
    color: #6c757d;
    text-transform: uppercase;
    text-align: center;
}

#projects-tab .file-date {
    font-size: 10px;
    color: #6c757d;
}

#projects-tab .file-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    justify-content: flex-end;
}

#projects-tab .file-list-item:hover .file-actions {
    opacity: 1;
}

#projects-tab .file-action-btn {
    padding: 2px 4px;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 2px;
    color: #6c757d;
    cursor: pointer;
    font-size: 9px;
    transition: all 0.2s ease;
}

#projects-tab .file-action-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Grid View Styles */
#projects-tab .files-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 6px;
}

#projects-tab .file-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

#projects-tab .file-grid-item:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

#projects-tab .file-grid-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

#projects-tab .file-grid-item .file-checkbox {
    position: absolute;
    top: 4px;
    left: 4px;
}

#projects-tab .file-grid-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

#projects-tab .file-grid-name {
    font-size: 9px;
    font-weight: 500;
    color: #495057;
    text-align: center;
    word-break: break-word;
    line-height: 1.1;
    max-height: 2.2em;
    overflow: hidden;
}

/* Empty State */
#projects-tab .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: #6c757d;
    text-align: center;
}

#projects-tab .empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    color: #adb5bd;
}

#projects-tab .empty-state p {
    margin: 6px 0 12px;
    font-size: 12px;
}

/* Drag & Drop Overlay */
#projects-tab .drag-drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

#projects-tab .drag-drop-content {
    text-align: center;
    color: #fff;
}

#projects-tab .drag-drop-content i {
    font-size: 64px;
    margin-bottom: 16px;
}

#projects-tab .drag-drop-content h3 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
}

#projects-tab .drag-drop-content p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Calendar View Buttons */
.calendar-view-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--surface-color);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.calendar-view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.calendar-view-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.calendar-view-btn.active {
    background: var(--primary-color);
    color: white;
}

.calendar-view-btn i {
    font-size: 1rem;
}

/* Calendar responsive adjustments */
@media (max-width: 768px) {
    .calendar-view-buttons {
        flex-wrap: wrap;
    }
    
    .calendar-view-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .calendar-view-btn span {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #projects-tab .file-tree-panel {
        width: 160px;
        min-width: 120px;
    }
    
    #projects-tab .files-header {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center !important;
    }
    
    #projects-tab .files-header h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 8px !important;
    }
    
    #projects-tab .files-header .search-container {
        min-width: 120px;
        max-width: 140px;
    }
    
    #projects-tab .files-header .header-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    #projects-tab .files-header .search-container {
        min-width: 120px;
        max-width: 140px;
    }
    
    #projects-tab .files-list-header,
    #projects-tab .file-list-item {
        grid-template-columns: 24px 1fr 60px 50px;
    }
    
    #projects-tab .file-date,
    #projects-tab .file-actions {
        display: none;
    }
    
    #projects-tab .files-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}

/* Project Financials Section */
#projects-tab .project-financials-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children to shrink */
}

#projects-tab .financials-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

#projects-tab .financial-metric-card,
#projects-tab .project-labor-summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

#projects-tab .financial-metric-label,
#projects-tab .project-labor-summary-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#projects-tab .financial-metric-value,
#projects-tab .project-labor-summary-value {
    font-size: 15px;
    color: #0f172a;
}

#projects-tab .financials-section {
    padding: 8px 8px 14px;
}

#projects-tab .project-labor-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

#projects-tab .project-labor-summary-card-note {
    grid-column: 1 / -1;
}

#projects-tab .financial-metric-value.is-positive,
#projects-tab .project-cash-flow-card strong.is-positive,
#projects-tab .project-cash-flow-table .is-positive {
    color: #047857;
}

#projects-tab .financial-metric-value.is-negative,
#projects-tab .project-cash-flow-card strong.is-negative,
#projects-tab .project-cash-flow-table .is-negative {
    color: #b91c1c;
}

#projects-tab .project-cash-flow-forecast {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#projects-tab .project-cash-flow-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

#projects-tab .project-cash-flow-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

#projects-tab .project-cash-flow-card span {
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#projects-tab .project-cash-flow-card strong {
    color: #0f172a;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

#projects-tab .project-cash-flow-card small,
#projects-tab .project-cash-flow-note {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

#projects-tab .project-cash-flow-tables {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 12px;
}

#projects-tab .project-cash-flow-table-card {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    overflow: auto;
}

#projects-tab .project-cash-flow-table-card h5 {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e3a5f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#projects-tab .project-cash-flow-table {
    margin: 0;
}

#projects-tab .project-cash-flow-table td,
#projects-tab .project-cash-flow-table th {
    white-space: nowrap;
}

#projects-tab .project-cash-flow-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

@media (max-width: 980px) {
    #projects-tab .project-cash-flow-tables {
        grid-template-columns: 1fr;
    }
}

#projects-tab .project-labor-summary-note {
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
}

#projects-tab .tasks-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

#projects-tab .tasks-summary-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
}

#projects-tab .project-task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

#projects-tab .tasks-header-copy h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

#projects-tab .tasks-header-copy p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    max-width: 680px;
}

#projects-tab .tasks-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#projects-tab .project-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#projects-tab .project-task-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
}

#projects-tab .project-task-row.is-complete {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

#projects-tab .project-task-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
}

#projects-tab .project-task-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#projects-tab .project-task-checkbox-ui {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

#projects-tab .project-task-checkbox input:checked + .project-task-checkbox-ui {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

#projects-tab .project-task-checkbox input:checked + .project-task-checkbox-ui::after {
    content: "";
    width: 8px;
    height: 4px;
    border: 2px solid #fff;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) translate(0, -1px);
}

#projects-tab .project-task-main {
    min-width: 0;
}

#projects-tab .project-task-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

#projects-tab .project-task-title-group {
    min-width: 0;
}

#projects-tab .project-task-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

#projects-tab .project-task-description {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

#projects-tab .project-task-chip-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

#projects-tab .project-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

#projects-tab .project-task-chip.tone-success {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}

#projects-tab .project-task-chip.tone-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

#projects-tab .project-task-chip.tone-warning {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

#projects-tab .project-task-chip.tone-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

#projects-tab .project-task-chip.tone-neutral,
#projects-tab .project-task-chip.due {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

#projects-tab .project-task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

#projects-tab .project-task-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

#projects-tab .project-task-meta-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#projects-tab .project-task-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

#projects-tab .project-task-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#projects-tab .project-task-actions .btn-icon {
    min-width: 74px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

#projects-tab .project-task-actions .btn-icon:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

#projects-tab .project-task-actions .btn-icon.btn-icon-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

#projects-tab .project-task-empty {
    padding: 28px 20px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 1024px) {
    #projects-tab .project-task-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    #projects-tab .project-task-actions {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    #projects-tab .project-task-header,
    #projects-tab .project-task-title-row {
        flex-direction: column;
    }

    #projects-tab .project-task-chip-row {
        justify-content: flex-start;
    }

    #projects-tab .project-task-actions {
        justify-content: flex-start;
    }
}

#projects-tab .member-metrics {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* Project financials header now uses unified headers.css styles */

#projects-tab .project-financials-section .section-header .active-project-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Financial Summary - Static section that stays visible */
#projects-tab .financial-summary {
    display: table-column-group;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 4px 10px; 
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0; 
}

#projects-tab .financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px; 
    padding: 0px 0; 
    font-size: 10px; 
}

#projects-tab .financial-item:last-child {
    margin-bottom: 0;
    border: 2px solid #3498db;
    padding-top: 2px; 
    font-weight: 600;
}

#projects-tab .financial-item label {
    font-size: 10px; 
    color: #495057;
    font-weight: 500;
}

#projects-tab .financial-item span {
    font-size: 10px; 
    font-weight: 600;
    color: #2c3e50;
}

/* Scrollable container for invoices and change orders - FIXED */
#projects-tab .financials-scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    height: 0; 
    min-height: 0;
}

/* Invoices and Change Orders - Now scrollable */
#projects-tab .invoices-section{
    margin-top: 0px; 
}
#projects-tab .change-orders-section {
    margin-top: 0px; 
    padding: 8px 8px;
}

#projects-tab .invoices-section h4,
#projects-tab .change-orders-section h4 {
    margin: 0 0 0px 0;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#projects-tab .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    font-size: 10px;
}

#projects-tab .data-table th {
    background: #f8f9fa;
    padding: 4px 4px;
    font-size: 9px;
    font-weight: 600;
    color: #495057;
    border: 1px solid #e9ecef;
    text-align: left;
}

#projects-tab .data-table td {
    padding: 4px 4px;
    font-size: 10px;
    color: #495057;
    border: 1px solid #e9ecef;
    vertical-align: middle;
}

#projects-tab .data-table tr:hover {
    background: #f8f9fa;
}

#projects-tab .invoices-total {
    margin-top: 6px;
    font-weight: 600;
    text-align: right;
    color: #2c3e50;
    font-size: 11px;
}

/* File Items */
#projects-tab .file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

#projects-tab .file-item:hover {
    background: #e9ecef;
    border-color: #3498db;
}

#projects-tab .file-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

#projects-tab .file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#projects-tab .file-name {
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
}

#projects-tab .file-size {
    font-size: 11px;
    color: #6c757d;
}

#projects-tab .file-actions {
    display: flex;
    gap: 6px;
}

#projects-tab .btn.tiny {
    padding: 2px 4px;
    font-size: 9px;
    min-width: auto;
}

/* Status Badges */
#projects-tab .status-badge {
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#projects-tab .status-badge.paid {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: #fff;
}

#projects-tab .status-badge.pending {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: #fff;
}

#projects-tab .status-badge.overdue {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: #fff;
}

/* ========================================
   GANTT CHART STYLING
   ======================================== */

#projects-tab .gantt-container {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    min-height: 300px;
}

#projects-tab .gantt-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 0;
}

#projects-tab .gantt-timeline {
    display: flex;
    flex-direction: column;
}

#projects-tab .timeline-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

#projects-tab .timeline-month {
    font-size: 14px;
    letter-spacing: 0.5px;
}

#projects-tab .timeline-days {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#projects-tab .day-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #495057;
    border-right: 1px solid #dee2e6;
}

#projects-tab .day-header:last-child {
    border-right: none;
}

#projects-tab .gantt-body {
    padding: 16px;
}

#projects-tab .gantt-task {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    min-height: 32px;
}

#projects-tab .task-label {
    width: 120px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    padding-right: 12px;
    flex-shrink: 0;
}

#projects-tab .task-bar {
    height: 24px;
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#projects-tab .task-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#projects-tab .task-duration {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* --- Projects Tab Responsive Grid Columns --- */
#projects-tab .projects-main-layout {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(400px, 2.5fr) minmax(220px, 1fr);
    gap: 16px;
    padding: 12px;
    height: 100%;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
}

@media (max-width: 1400px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(160px, 1fr);
        gap: 10px;
        padding: 8px;
    }
}
@media (max-width: 1200px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(140px, 0.8fr) minmax(220px, 1.6fr) minmax(120px, 0.8fr);
        gap: 6px;
        padding: 6px;
    }
}
@media (max-width: 1000px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 4px;
    }
}
@media (max-width: 800px) {
    #projects-tab .projects-main-layout {
        display: flex;
        flex-direction: column;
        height: 100%;
        gap: 2px;
        padding: 2px;
    }
}

/* ========================================
   SPECIFIC COMPONENT STYLES
   ======================================== */

/* Project Details Section - Responsive Adjustments */
#projects-tab .project-details-section {
    padding: 0 !important;
}

/* Project details header now uses unified headers.css styles */

#projects-tab .project-header-info {
    padding: 10px !important;
}

#projects-tab .project-name-address .project-name {
    font-size: 14px !important;
}

#projects-tab .project-name-address .project-address,
#projects-tab .project-name-address .project-type {
    font-size: 11px !important;
    padding: 2px 6px !important;
}

#projects-tab .customer-information h4,
#projects-tab .project-manager h4 {
    font-size: 11px !important;
    margin-bottom: 6px !important;
}

/* Calendar Filters and Navigation - Responsive Adjustments */
#projects-tab .calendar-filters,
#projects-tab .calendar-navigation {
    margin-top: 0;
    padding: 6px 8px !important;
    gap: 4px !important;
}

#projects-tab .calendar-filters .filter-group label,
#projects-tab .calendar-filters .filter-group select {
    font-size: 10px !important;
    padding: 2px 4px !important;
}

/* Calendar Table and Day Styles - Responsive Adjustments */
#projects-tab .calendar-table th,
#projects-tab .calendar-table td {
    font-size: 10px !important;
    padding: 4px !important;
}

#projects-tab .calendar-day {
    font-size: 10px !important;
}

#projects-tab .event {
    font-size: 9px !important;
    padding: 1px 2px !important;
}

/* Project files and financials headers now use unified headers.css styles */

#projects-tab .file-item {
    padding: 8px !important;
    font-size: 12px !important;
}

#projects-tab .file-name {
    font-size: 12px !important;
}

#projects-tab .file-size {
    font-size: 10px !important;
}

#projects-tab .financial-summary,
#projects-tab .invoices-section,
#projects-tab .change-orders-section {
    padding: 10px !important;
}

#projects-tab .financial-item,
#projects-tab .data-table th,
#projects-tab .data-table td {
    font-size: 11px !important;
    padding: 4px 6px !important;
}

/* Responsive: keep these changes at all breakpoints unless overridden */
@media (max-width: 1200px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(90px, 120px) 1fr minmax(180px, 2fr);
    }
}
@media (max-width: 1000px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Final grid columns: left (project list) widest, middle (details/calendar) wide, right (files/financials) narrowest --- */
#projects-tab .projects-main-layout {
    grid-template-columns: minmax(280px, 320px) 1.5fr minmax(120px, 0.7fr);
    /* left: widest | middle: wide | right: narrowest */
}

@media (max-width: 1400px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(240px, 280px) 1.2fr minmax(100px, 0.6fr);
    }
}
@media (max-width: 1200px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: minmax(200px, 240px) 1fr minmax(80px, 0.5fr);
    }
}
@media (max-width: 1000px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------
   PROJECT DETAILS INFO ROW
   ---------------------------------------- */
#projects-tab .project-details-info-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    margin-bottom: 0; /* Ensure no bottom margin */
    padding-bottom: 0; /* Ensure no bottom padding */
}

#projects-tab .customer-information {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 20px;
    box-sizing: border-box;
    text-align: left;
    align-items: flex-start;
    display: flex;
    flex-direction: column;
}

#projects-tab .project-manager {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 20px;
    box-sizing: border-box;
    text-align: right;
    align-items: flex-end;
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    #projects-tab .project-details-info-row {
        flex-direction: column;
        gap: 0;
    }
    #projects-tab .customer-information,
    #projects-tab .project-manager {
        padding: 10px 12px;
        text-align: left;
        align-items: flex-start;
    }
}

/*
 * --- PROJECTS TAB: ENHANCE CALENDAR INTERACTIVITY & FILTER BAR VISIBILITY --- *
 * 1. Make the calendar day cells selectable (highlight on click).
 * 2. Ensure view buttons (month/week/day/year/gantt) visually toggle and trigger view changes.
 * 3. Make the filters bar taller, with larger text and more spacing for visibility.
 */

#projects-tab .calendar-table td.calendar-day {
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 6px;
    position: relative;
}
#projects-tab .calendar-table td.calendar-day.selected,
#projects-tab .calendar-table td.calendar-day:active {
    background: #e7eb19bd !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(52,152,219,0.10);
}
#projects-tab .calendar-table td.calendar-day:hover {
    background: #e3f2fd;
}

#projects-tab .calendar-navigation .view-btn {
    font-size: 15px;
    padding: 8px 18px;
    border-radius: 6px;
    margin-right: 4px;
    font-weight: 600;
}
#projects-tab .calendar-navigation .view-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52,152,219,0.10);
}

/* ========================================
   FILE TREE STYLES
   ======================================== */

#projects-tab .file-tree {
    padding: 10px;
    max-height: calc(100% - 60px);
    overflow-y: auto;
}

#projects-tab .folder-item {
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#projects-tab .folder-item.open {
    background: #f8f9fa;
    border-color: #e9ecef;
}

#projects-tab .folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

#projects-tab .folder-header:hover {
    background: #f0f4f8;
}

#projects-tab .folder-toggle {
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.2s ease;
    width: 12px;
}

#projects-tab .folder-item.open .folder-toggle {
    transform: rotate(90deg);
}

#projects-tab .folder-icon {
    font-size: 16px;
}

#projects-tab .folder-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

#projects-tab .folder-count {
    font-size: 12px;
    color: #6c757d;
}

#projects-tab .folder-contents {
    padding-left: 32px;
    padding-bottom: 8px;
}

#projects-tab .file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
    cursor: pointer;
}

#projects-tab .file-item:hover {
    background: #e9ecef;
}

#projects-tab .file-icon {
    font-size: 14px;
}

#projects-tab .file-name {
    flex: 1;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#projects-tab .file-size {
    font-size: 11px;
    color: #6c757d;
}

#projects-tab .file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#projects-tab .file-item:hover .file-actions {
    opacity: 1;
}

#projects-tab .file-actions .btn-icon {
    background: none;
    border: none;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s ease;
}

#projects-tab .file-actions .btn-icon:hover {
    background: #dee2e6;
}

#projects-tab .empty-folder {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* ========================================
   CALENDAR FILTER STYLES
   ======================================== */

#projects-tab .calendar-filters select {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

#projects-tab .calendar-filters select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Keep project calendar filters visible and usable in the sub-panel layout */
#projects-tab .projects-panel[data-panel="calendar"] .calendar-filters {
    min-height: 42px;
    padding: 8px 10px !important;
    gap: 8px !important;
    flex-wrap: wrap;
    align-items: center;
}

#projects-tab .projects-panel[data-panel="calendar"] .calendar-filters .filter-group {
    flex: 1 1 160px;
    min-width: 150px;
    max-width: 220px;
}

#projects-tab .projects-panel[data-panel="calendar"] .view-controls {
    margin-left: auto;
    gap: 6px;
}

/* ----------------------------------------
   SUB-RIBBON MODE: HIDE REDUNDANT PANEL HEADERS
   ---------------------------------------- */
#projects-tab .projects-content-column .projects-panel .section-header:not(.files-header) {
    display: none !important;
}

/* Keep Files actions visible, but remove duplicate title text. */
#projects-tab .projects-content-column .projects-panel .files-header h3 {
    display: none !important;
}

#projects-tab .projects-content-column .projects-panel .files-header {
    padding: 8px 12px !important;
    min-height: 0 !important;
    gap: 8px;
}

#projects-tab .projects-content-column .projects-panel .files-header .search-container {
    margin-top: 0 !important;
}

/* Keep folder controls, remove redundant "Folders" label. */
#projects-tab .projects-content-column .projects-panel .tree-header h4 {
    display: none !important;
}

#projects-tab .projects-content-column .projects-panel .tree-header {
    justify-content: flex-end;
    min-height: 0 !important;
}

/* ----------------------------------------
   PROJECT DETAILS INFO ROW - ENHANCED STYLING
   ---------------------------------------- */
#projects-tab .project-details-info-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    background: linear-gradient(135deg, #f8fafb 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

#projects-tab .project-manager {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 16px 0px 16px; /* Removed bottom padding to eliminate gap */
    box-sizing: border-box;
    font-size: 12px;
}

#projects-tab .customer-information h4,
#projects-tab .project-manager h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 2px solid #3498db;
    position: relative;
}

#projects-tab .customer-information h4::after,
#projects-tab .project-manager h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}

#projects-tab .project-manager h4::after {
    right: 0;
    left: auto;
}

#projects-tab .customer-information div,
#projects-tab .project-manager div {
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 0;
}

#projects-tab .customer-information div:hover,
#projects-tab .project-manager div:hover {
    background-color: #f8fafb;
    border-radius: 3px;
    padding-left: 6px;
    padding-right: 6px;
    margin-left: -6px;
    margin-right: -6px;
}

#projects-tab .customer-information strong,
#projects-tab .project-manager strong {
    color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-size: 10px;
}

#projects-tab .project-details-meta-row {
    align-items: stretch;
}

#projects-tab .project-storage-summary-card,
#projects-tab .project-activity-feed-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 16px 12px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f8fafb 0%, #ffffff 100%);
}

#projects-tab .project-storage-summary-card h4,
#projects-tab .project-activity-feed-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 2px solid #3498db;
}

#projects-tab .project-storage-summary,
#projects-tab .project-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#projects-tab .project-storage-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.4;
}

#projects-tab .project-storage-summary-label {
    font-weight: 700;
    color: #475569;
}

#projects-tab .project-storage-summary-value {
    color: #0f172a;
    text-align: right;
    word-break: break-word;
}

#projects-tab .project-activity-feed-entry {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
}

#projects-tab .project-activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(52, 152, 219, 0.12);
    color: #2980b9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

#projects-tab .project-activity-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

#projects-tab .project-activity-summary {
    font-size: 12px;
    color: #334155;
    margin-top: 2px;
}

#projects-tab .project-activity-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}

#projects-tab .project-activity-feed-empty,
#projects-tab .project-storage-summary-empty {
    color: #64748b;
    font-style: italic;
    font-size: 12px;
}

#projects-tab .file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

#projects-tab .project-header-info {
    padding: 12px 20px;
       border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafb 0%, #ffffff 100%);
    position: relative;
}

#projects-tab .project-header-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e9ecef 50%, transparent 100%);
}

#projects-tab .project-name-address .project-name {
    font-weight: 600;
    font-size: 10px;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(44, 62, 80, 0.1);
}

#projects-tab .project-name-address .project-type {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e8f5e8  0%, #c8e6c9 100%);
    color: #2e7d32;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

#projects-tab .project-status-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#projects-tab .project-status-badge.status-active {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    border-color: rgba(76, 175, 80, 0.3);
}

#projects-tab .project-status-badge.status-completed {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    border-color: rgba(33, 150, 243, 0.3);
}

#projects-tab .project-status-badge.status-on-hold {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    border-color: rgba(255, 152, 0, 0.3);
}

#projects-tab .project-status-badge.status-cancelled {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    border-color: rgba(244, 67, 54, 0.3);
}

/* Project Item Content - Condensed for compact list */
#projects-tab .project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
    color: #6c757d;
}

#projects-tab .project-customer,
#projects-tab .project-dates {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
}

#projects-tab .project-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

#projects-tab .progress-bar {
    flex: 1;
    height: 6px;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
}

#projects-tab .progress-fill {
    height: 100%;
       background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
    transition: width 0.3s ease;
}

#projects-tab .progress-text {
    font-size: 9px;
    font-weight: 500;
    color: #495057;
    min-width: 24px;
    text-align: right;
}

#projects-tab .project-financials {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    margin-top: 2px;
}

#projects-tab .project-budget,
#projects-tab .project-spent {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
}

#projects-tab .project-budget {
    color: #2e7d32;
}

#projects-tab .project-spent {
    color: #d32f2f;
}

/* Calendar event tooltip */
.calendar-event-tooltip {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    font-size: 12px;
    line-height: 1.4;
}

.calendar-event-tooltip h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
}

.calendar-event-tooltip p {
    margin: 4px 0;
    color: #666;
}

.calendar-event-tooltip strong {
    color: #333;
}

/* Make calendar events more interactive */
#project-calendar-table .calendar-event:hover {
    opacity: 0.8;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ========================================
   PROJECT WORKSPACE (SUB-RIBBON LAYOUT)
   ======================================== */

#projects-tab .projects-main-layout {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 2.3fr) !important;
}

#projects-tab .projects-content-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: var(--card-background);
    box-shadow: 0 2px 8px var(--shadow-color);
}

#projects-tab .projects-sub-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    padding: 0 12px;
    border-bottom: 1px solid #1a252f;
    background: #1e3c72;
    min-height: 44px;
    align-items: center;
}

#projects-tab .projects-sub-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #b0c4de;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

#projects-tab .projects-sub-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

#projects-tab .projects-sub-tab.active {
    color: #ffffff;
    border-bottom-color: #66a3ff;
    font-weight: 700;
}

#projects-tab .projects-panel-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

#projects-tab .projects-panel {
    display: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

#projects-tab .projects-panel.active {
    display: flex;
    flex-direction: column;
}

#projects-tab .projects-panel .project-details-section,
#projects-tab .projects-panel .project-calendar-section,
#projects-tab .projects-panel .project-files-section,
#projects-tab .projects-panel .project-financials-section {
    flex: 1 1 auto !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#projects-tab .project-panel-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

#projects-tab .project-panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

@media (max-width: 1050px) {
    #projects-tab .projects-main-layout {
        grid-template-columns: 1fr !important;
    }
}
