/* Maintenance-specific styles */

/* Form row for two columns */
.maintenance-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.maintenance-form .form-group {
    margin-bottom: 0;
}

.maintenance-form .form-group.full-width {
    grid-column: 1 / -1;
}

/* Calendar View */
.calendar-view {
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    margin: 0;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.calendar-day-header {
    background: #f0b05d;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-radius: 4px;
}

.calendar-day {
    border: 1px solid #dee2e6;
    padding: 10px;
    min-height: 80px;
    border-radius: 4px;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #999;
}

.calendar-day.today {
    border: 2px solid #007bff;
    background: #e3f2fd;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 5px;
}

.calendar-event {
    font-size: 11px;
    padding: 2px 4px;
    margin: 2px 0;
    border-radius: 3px;
    background: #007bff;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.preventive {
    background: #28a745;
}

.calendar-event.corrective {
    background: #dc3545;
}

.calendar-event.routine {
    background: #ffc107;
    color: #333;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.legend-preventive {
    background: #28a745;
}

.legend-corrective {
    background: #dc3545;
}

.legend-routine {
    background: #ffc107;
}

/* Check List Styles */
.checklist-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.checklist-items {
    max-height: 500px;
    overflow-y: auto;
}

.checklist-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checklist-item input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.checklist-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.checklist-item button:hover {
    background: #c82333;
}

.checklist-item.checked input[type="text"] {
    text-decoration: line-through;
    color: #999;
}

/* Priority badges */
.priority-low {
    color: #28a745;
    font-weight: 600;
}

.priority-medium {
    color: #ffc107;
    font-weight: 600;
}

.priority-high {
    color: #fd7e14;
    font-weight: 600;
}

.priority-critical {
    color: #dc3545;
    font-weight: 600;
}

/* Folder path display for maintenance form */
.folder-path {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #f0b05d;
}

.folder-path label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.folder-path span {
    color: #007bff;
    font-weight: 500;
}

/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
    color: #495057;
    user-select: none;
}

/* Date range specific styling */
#dateRangeContainer input,
#singleDateContainer input[type="date"] {
    width: 100%;
}

/* Enhanced calendar controls */
.calendar-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-controls select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.calendar-controls select:hover {
    border-color: #f0b05d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-controls select:focus {
    outline: none;
    border-color: #f0b05d;
    box-shadow: 0 0 0 3px rgba(240, 176, 93, 0.2);
}

/* Improved calendar day styling */
.calendar-day {
    border: 1px solid #e0e0e0;
    padding: 8px;
    min-height: 100px;
    border-radius: 8px;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.calendar-day:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.calendar-day.today {
    border: 2px solid #f0b05d;
    background: #fff8e1;
    box-shadow: 0 2px 8px rgba(240, 176, 93, 0.3);
}

.calendar-day-number {
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.calendar-day.other-month .calendar-day-number {
    color: #bbb;
}

/* Enhanced calendar events */
.calendar-event {
    font-size: 10px;
    padding: 3px 6px;
    margin: 3px 0;
    border-radius: 4px;
    background: #007bff;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.calendar-event:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Improved Previous/Next buttons */
.calendar-header .btn-secondary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.calendar-header .btn-secondary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.calendar-header .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}


/************ master plan **********/
/************ Master Plan - Gantt Chart Style **********/
/************ Master Plan - Gantt Chart Style **********/

.master-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    padding-left: 10px;        /* ✅ ADDED: Some left padding */
    padding-right: 10px;       /* ✅ ADDED: Some right padding */
    border-bottom: 3px solid #E64833;
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding-top: 10px;
    width: 100%;               /* ✅ ADDED: Fits parent width */
    max-width: 100%;           /* ✅ ADDED: Never exceeds parent */
    box-sizing: border-box;    /* ✅ ADDED: Includes padding in width */
}

.master-plan-header h2 {
    margin: 0;
    color: #244855; /* ✅ Dark teal */
    font-size: 24px;
}

.master-plan-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.master-plan-controls select {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.master-plan-controls select:hover {
    border-color: #f0b05d;
}

.master-plan-controls .btn-secondary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #244855 0%, #2d5a68 100%); /* ✅ Dark teal gradient */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.master-plan-controls .btn-secondary:hover {
    background: linear-gradient(135deg, #E64833 0%, #d63820 100%); /* ✅ Coral on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

/* Gantt Container */
.gantt-container {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;      /* ✅ Horizontal scroll inside gantt */
    overflow-y: auto;      /* ✅ Vertical scroll inside gantt */
    max-height: 700px;
    min-height: 400px;
    position: relative;
    width: 100%;           /* ✅ IMPORTANT: Fits parent */
    max-width: 100%;       /* ✅ IMPORTANT: Never exceeds parent */
    box-sizing: border-box; /* ✅ IMPORTANT: Includes padding in width */
}

/* Timeline (top section) */
/* Timeline (top section) */
.gantt-timeline {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #244855 0%, #2d5a68 100%);
    border-bottom: 3px solid #E64833;
    display: flex;
    flex-direction: column;
    width: auto;
    min-width: 3600px;
}

/* ✅ Equipment header label above task names */
.gantt-equipment-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 45px;  /* Covers both month and day rows */
    background: linear-gradient(135deg, #244855 0%, #2d5a68 100%);
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 3px solid #E64833;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    z-index: 20;  /* Above everything else in timeline */
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 3px 0 8px rgba(36, 72, 85, 0.3);
}

.gantt-equipment-header:hover {
    background: linear-gradient(135deg, #2d5a68 0%, #244855 100%);
}

/* ✅ Make sure months and days rows stretch full width */
.gantt-months-row,
.gantt-days-row {
    display: flex;
    padding-left: 200px;
    width: auto;
    box-sizing: border-box;
    min-width: 3600px;
    background: #F5F8F9;
    position: relative;
}

/* ✅ Prevent timeline content from showing in task column area */
/* ✅ Prevent timeline content from showing in task column area */
.gantt-months-row::before,
.gantt-days-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 200px;
    height: 100%;
    background: #F5F8F9;      /* ✅ FIXED: Solid background matching timeline */
    pointer-events: none;
    z-index: 11;              /* ✅ FIXED: Higher than timeline (10) but lower than task info (15) */
}

/* ✅ Task label column header (aligns with task names) */
.gantt-task-label-header {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    flex-shrink: 0;
    padding: 10px;
    background: #244855;
    color: white;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    border-right: 3px solid #E64833;
    box-sizing: border-box;
}

.gantt-month-cell {
    text-align: center;
    padding: 8px 2px;
    font-weight: 700;
    font-size: 12px;
    color: #244855; /* ✅ Dark teal for text */
    border-right: 1px solid rgba(36, 72, 85, 0.15);
    flex-shrink: 0;
    box-sizing: border-box;
    transition: background 0.2s;
}

.gantt-months-row {
    background: linear-gradient(to bottom, #ffffff, #F5F8F9); /* ✅ Subtle gradient */
}

/* Days row */
.gantt-day-cell {
    text-align: center;
    padding: 4px 1px; /* ✅ CHANGED from 6px 2px */
    font-size: 8px; /* ✅ CHANGED from 9px */
    color: #999;
    border-right: 1px solid #e9ecef;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gantt-day-cell.month-start {
    border-left: 2px solid #f0b05d;
    font-weight: 700;
    color: #333;
}

/* Tasks section */
.gantt-tasks {
    flex: 1;
}

.gantt-task-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    min-height: 50px;     /* ✅ REDUCED: from 60px to 50px */
    min-width: 3600px;    /* ✅ REDUCED: from 4400px to 3600px */
    transition: background 0.2s;
}

.gantt-task-row:hover {
    background: #f8f9fa;
}

/* Task info (left column) */
.gantt-task-info {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    flex-shrink: 0;
    padding: 6px 8px;
    border-right: 3px solid #244855;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    position: sticky;
    left: 0;
    background: #ffffff !important;  /* Force solid white background */
    z-index: 15;              /* ✅ CHANGED: from 5 to 15 (higher than timeline's 10) */
    box-shadow: 3px 0 8px rgba(36, 72, 85, 0.15);
}

.gantt-task-info:hover {
    background: #ffffff;  /* ✅ Solid white - nothing can show through */
    box-shadow: 3px 0 12px rgba(36, 72, 85, 0.25);
}

/* ✅ NEW: Ensure master plan container doesn't overflow the page */
#masterPlanContainer {
    width: 100%;
    max-width: 100%;
    overflow: hidden;      /* ✅ CHANGED: Hide overflow, don't let children push width */
    box-sizing: border-box;
}
/* ✅ Ensure content cards fit within their container */
.content-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;  /* ✅ ADD THIS if missing */
}

.task-name {
    font-weight: 600;
    font-size: 12px;      /* ✅ REDUCED: from 13px to 12px */
    color: #244855;
    margin-bottom: 2px;   /* ✅ REDUCED: from 3px to 2px */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-type {
    font-size: 9px;       /* ✅ REDUCED: from 10px to 9px */
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.task-type.preventive {
    background: rgba(144, 174, 173, 0.2);
    color: #244855;
    border: 1px solid #90AEAD;
}

.task-type.corrective {
    background: rgba(230, 72, 51, 0.15);
    color: #874F41;
    border: 1px solid #E64833;
}

.task-type.predictive {
    background: rgba(36, 72, 85, 0.1);
    color: #244855;
    border: 1px solid #244855;
}

.task-type.routine {
    background: rgba(251, 233, 208, 0.6);
    color: #874F41;
    border: 1px solid #874F41;
}

/* ✅ FIXED: Task timeline with proper flex */
/* ✅ SIMPLER: Task timeline with WEEKLY grid lines only */
/* ✅ UPDATED: Task timeline with elegant color palette */
.gantt-task-timeline {
    flex: 1;
    position: relative;
    min-height: 50px;
    min-width: 3400px;  /* ✅ FIXED: matches timeline (3600px - 200px padding) */
    display: flex;
    
    /* ✅ Elegant quarter background colors inspired by the palette */
    background: 
        /* Quarter 1 - Soft Blue Gray */
        linear-gradient(to right, #D4E4E7 0%, #D4E4E7 25%, transparent 25%),
        /* Quarter 2 - Light Coral */
        linear-gradient(to right, transparent 25%, #F5D5D0 25%, #F5D5D0 50%, transparent 50%),
        /* Quarter 3 - Warm Cream */
        linear-gradient(to right, transparent 50%, #FBE9D0 50%, #FBE9D0 75%, transparent 75%),
        /* Quarter 4 - Soft Teal */
        linear-gradient(to right, transparent 75%, #D9E8EA 75%, #D9E8EA 100%);
    
    /* ✅ Weekly grid lines with refined color */
    background-image: 
        repeating-linear-gradient(
            to right,
            rgba(36, 72, 85, 0.12) 0px,
            rgba(36, 72, 85, 0.12) 1px,
            transparent 1px,
            transparent calc(100% / 52)
        );
    
    background-size: 100% 100%;
    background-position: 0 0;
}

/* Gantt bars (for date ranges) */
.gantt-bar {
    position: absolute;
    height: 28px; /* ✅ CHANGED from 24px for better visibility */
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    opacity: 0.9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gantt-bar:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 5;
}

/* ✅ UPDATED: Gantt bars with palette colors */
.gantt-bar.preventive {
    background: linear-gradient(135deg, #90AEAD 0%, #6b9a9e 100%); /* Soft blue-gray */
    border: 2px solid #244855;
}

.gantt-bar.corrective {
    background: linear-gradient(135deg, #E64833 0%, #d63820 100%); /* Vibrant coral */
    border: 2px solid #874F41;
}

.gantt-bar.predictive {
    background: linear-gradient(135deg, #244855 0%, #1a3640 100%); /* Dark teal */
    border: 2px solid #90AEAD;
}

.gantt-bar.routine {
    background: linear-gradient(135deg, #FBE9D0 0%, #f5dab8 100%); /* Warm cream */
    border: 2px solid #874F41;
    color: #874F41; /* Dark text for light background */
}

/* ✅ UPDATED: Gantt markers with palette colors */
.gantt-marker.preventive {
    background: #90AEAD;
    border: 3px solid #244855;
}

.gantt-marker.corrective {
    background: #E64833;
    border: 3px solid #874F41;
}

.gantt-marker.predictive {
    background: #244855;
    border: 3px solid #90AEAD;
}

.gantt-marker.routine {
    background: #FBE9D0;
    border: 3px solid #874F41;
}

.recurring-indicator {
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Gantt markers (for single dates) */
.gantt-marker {
    position: absolute;
    width: 12px; /* ✅ CHANGED from 10px */
    height: 12px; /* ✅ CHANGED from 10px */
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gantt-marker:hover {
    transform: translate(-50%, -50%) scale(1.8);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 5;
}

.gantt-marker.preventive {
    background: #28a745;
    border: 2px solid #1e7e34;
}

.gantt-marker.corrective {
    background: #dc3545;
    border: 2px solid #bd2130;
}

.gantt-marker.predictive {
    background: #17a2b8;
    border: 2px solid #117a8b;
}

.gantt-marker.routine {
    background: #ffc107;
    border: 2px solid #e0a800;
}

/* Scrollbar styling */
.gantt-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.gantt-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.gantt-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.gantt-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gantt-task-info {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }
    
    .gantt-months-row,
    .gantt-days-row {
        padding-left: 200px;
    }
    
    .task-name {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .master-plan-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .gantt-task-info {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }
    
    .gantt-months-row,
    .gantt-days-row {
        padding-left: 150px;
    }
}

/*---------- Checklist List View------------- */
.checklists-list {
    margin-top: 20px;
}

.checklist-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.checklist-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.checklist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.checklist-card-header h3 {
    margin: 0;
    color: #333;
}

.checklist-card-actions {
    display: flex;
    gap: 10px;
}

.checklist-card-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.checklist-item-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.checklist-item-row input,
.checklist-item-row select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.checklist-item-row label {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    display: block;
}


/*-------- Add view mode for check list ---------*/
/* Checklist View Mode */
.checklist-view-item {
    display: grid;
    grid-template-columns: 50px 2fr 2fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.checklist-view-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.checklist-view-item .item-number {
    font-weight: 700;
    font-size: 18px;
    color: #007bff;
    text-align: center;
}

.checklist-view-item .item-content {
    display: flex;
    flex-direction: column;
}

.checklist-view-item .item-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.checklist-view-item .item-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.checklist-view-item .item-value.empty {
    color: #999;
    font-style: italic;
}

.checklist-view-item .status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.na {
    background: #e2e3e5;
    color: #383d41;
}

/*************************************************/
/* ============================================
   FIX 4: REPLACE CSS for View Mode
   LOCATION: In maintenance.css
   FIND: .checklist-view-item-extended styles
   ACTION: REPLACE with this new style
   ============================================ */

/* ✅ REPLACE the old .checklist-view-item-extended with this */
/* New view mode layout - 5 columns (removed Input Type column) */
.checklist-view-item-new {
    display: grid;
    grid-template-columns: 50px 2fr 1.5fr 1.5fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.checklist-view-item-new:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.checklist-view-item-new .item-number {
    font-weight: 700;
    font-size: 18px;
    color: #007bff;
    text-align: center;
}

.checklist-view-item-new .item-content {
    display: flex;
    flex-direction: column;
}

.checklist-view-item-new .item-content-input {
    display: flex;
    flex-direction: column;
}

.checklist-view-item-new .item-content-status {
    display: flex;
    flex-direction: column;
}

.checklist-view-item-new .item-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.checklist-view-item-new .item-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.checklist-view-item-new .item-value.empty {
    color: #999;
    font-style: italic;
}

/* ✅ ADD these new styles for view mode inputs */
/* Styling for view mode input fields */
.view-input-text {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background: #f8f9fa;
    color: #495057;
}

.view-input-checkbox {
    width: 20px;
    height: 20px;
    cursor: not-allowed;
}

.view-input-status {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
}

/* Active status dropdown in view mode */
.status-select-view {
    padding: 8px 12px;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.status-select-view:hover {
    border-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.status-select-view:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Status option colors */
.status-select-view option[value="Pending"] {
    color: #856404;
}

.status-select-view option[value="Completed"] {
    color: #155724;
}

.status-select-view option[value="N/A"] {
    color: #383d41;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .checklist-view-item-new {
        grid-template-columns: 50px 1fr 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .checklist-view-item-new {
        grid-template-columns: 1fr;
    }
    
    .checklist-view-item-new .item-number {
        display: none;
    }
}
/* ✅ ADD THIS NEW CLASS - Extended checklist item row for EDIT MODE */
/* ============================================
   FIX: Update CSS for 6 Columns in Edit Mode
   LOCATION: In maintenance.css
   FIND: .checklist-item-row-extended
   ACTION: REPLACE the grid-template-columns line
   ============================================ */

/* ✅ UPDATED: Changed from 7 columns to 6 columns (removed Input Value) */
.checklist-item-row-extended {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.2fr 1fr 1fr auto;  /* ✅ CHANGED: Removed one column */
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.checklist-item-row-extended input,
.checklist-item-row-extended select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.checklist-item-row-extended label {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .checklist-item-row-extended {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .checklist-item-row-extended {
        grid-template-columns: 1fr;
    }
}

/**********************************************/
/****** Add pop up to schedule maintenance ****/
/* ✅ NEW: Modal Popup Styles for Checklist Selector */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
}

/* Checklist selector item styles */
.checklist-selector-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checklist-selector-item:hover {
    border-color: #4a90e2;
    background-color: #f8f9fa;
}

.checklist-selector-item.selected {
    border-color: #4a90e2;
    background-color: #e8f4fd;
}

.checklist-selector-item input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.checklist-info {
    flex: 1;
}

.checklist-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
}

.checklist-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* Selected checklists display */
.selected-checklist-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin: 5px;
    background: #4a90e2;
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

.selected-checklist-tag button {
    background: none;
    border: none;
    color: white;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
}

.selected-checklist-tag button:hover {
    color: #ff4444;
}
/********* end of add check list pop up ********/

/************************************************/
/******** All maintenance ***********************/
/* ✅ NEW: Type badges for maintenance types */
.type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-preventive {
    background-color: #e3f2fd;
    color: #1976d2;
}

.type-corrective {
    background-color: #fff3e0;
    color: #f57c00;
}

.type-predictive {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.type-routine {
    background-color: #e8f5e9;
    color: #388e3c;
}

/* ✅ NEW: Priority badges */
.priority-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.priority-critical {
    background-color: #ffebee;
    color: #c62828;
}

.priority-high {
    background-color: #fff3e0;
    color: #ef6c00;
}

.priority-medium {
    background-color: #fff9c4;
    color: #f57f17;
}

.priority-low {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* ✅ NEW: Status badges for maintenance */
.status-scheduled {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-in-progress {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-completed {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-overdue {
    background-color: #ffebee;
    color: #c62828;
}

.status-cancelled {
    background-color: #f5f5f5;
    color: #757575;
}

/********* end of all maintenance ***************/

/***********************************************/
/********* Display maintenance details *********/
/* ✅ ADD THESE STYLES AT THE END OF maintenance.css: */

/* Maintenance Details Modal Specific Styles */
#maintenanceDetailsModal .modal-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Details grid styling */
#maintenanceDetailsModal label {
    font-size: 14px;
}

#maintenanceDetailsModal .type-badge,
#maintenanceDetailsModal .priority-badge,
#maintenanceDetailsModal .status-badge {
    display: inline-block;
}

/* Checklist table inside modal */
#maintenanceDetailsModal .data-table {
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#maintenanceDetailsModal .data-table th {
    background: #4a90e2;
    color: white;
    font-weight: 600;
    padding: 12px 10px;
}

#maintenanceDetailsModal .data-table td {
    padding: 10px;
    vertical-align: top;
}

#maintenanceDetailsModal .data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Scrollbar styling for modal */
#maintenanceDetailsModal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#maintenanceDetailsModal .modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#maintenanceDetailsModal .modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#maintenanceDetailsModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    #maintenanceDetailsModal .modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    #maintenanceDetailsModal .modal-content > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}
/* ✅ VERIFY OR ADD THESE STATUS BADGE STYLES: */

/* Status badges for checklist items */
.status-badge.status-pending {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-badge.status-completed {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-badge.status-in-progress {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-badge.status-not-started {
    background-color: #f5f5f5;
    color: #757575;
}

/* Checklist table styling in details view */
#viewDetailsContainer .data-table {
    box-shadow: none;
    border: none;
}

#viewDetailsContainer .data-table thead th {
    background: #4a90e2;
    color: white;
    font-weight: 600;
    padding: 12px 10px;
    border: none;
}

#viewDetailsContainer .data-table tbody td {
    padding: 8px 6px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

#viewDetailsContainer .data-table thead th {
    padding: 10px 6px;
    font-size: 14px;
}

/* Make table more compact */
#viewDetailsContainer .data-table {
    font-size: 14px;
}

#viewDetailsContainer .data-table tbody tr:last-child td {
    border-bottom: none;
}

#viewDetailsContainer .data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ✅ ADD THESE STYLES FOR CHECKLIST INPUTS: */

/* Checklist input fields styling */
.checklist-input,
.checklist-status-input {
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checklist-input:focus,
.checklist-status-input:focus {
    outline: none;
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Checkbox inputs in value column */
.checklist-input[type="checkbox"] {
    cursor: pointer;
    margin: 0 auto;
    display: block;
}

/* Input field hover effect */
.checklist-input:hover,
.checklist-status-input:hover {
    border-color: #4a90e2;
}

/* Placeholder styling */
.checklist-input::placeholder,
.checklist-status-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Number input arrows */
.checklist-input[type="number"]::-webkit-inner-spin-button,
.checklist-input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}
/************** end of the display maintenance details********/

/************************************************/
/************************************************/
/******** Maintenance Filter Form ***************/
/* Filter form container styling */
.maintenance-filter-form {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid #4a90e2;
    width: 100%; /* Match parent width */
}

/* Make the heading smaller to fit */
.maintenance-filter-form h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 12px;
}

/* Filter checkbox labels */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.filter-checkbox-label:hover {
    background: #e9ecef;
    border-color: #4a90e2;
}

.filter-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a90e2;
    flex-shrink: 0;
}

.filter-checkbox-label span {
    font-weight: 500;
    color: #495057;
    user-select: none;
    font-size: 13px;
    line-height: 1.2;
}

/* Checked state styling */
/* ✅ NEW: Color-code filter checkboxes to match maintenance type badges */

/* Preventive Maintenance - Blue */
#filterPreventive:checked + span,
.filter-checkbox-label:has(#filterPreventive:checked) {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    border-color: #1976d2 !important;
}

.filter-checkbox-label:has(#filterPreventive:checked) span {
    color: #1976d2 !important;
}

/* Corrective Maintenance - Orange */
#filterCorrective:checked + span,
.filter-checkbox-label:has(#filterCorrective:checked) {
    background-color: #fff3e0 !important;
    color: #f57c00 !important;
    border-color: #f57c00 !important;
}

.filter-checkbox-label:has(#filterCorrective:checked) span {
    color: #f57c00 !important;
}

/* Predictive Maintenance - Purple */
#filterPredictive:checked + span,
.filter-checkbox-label:has(#filterPredictive:checked) {
    background-color: #f3e5f5 !important;
    color: #7b1fa2 !important;
    border-color: #7b1fa2 !important;
}

.filter-checkbox-label:has(#filterPredictive:checked) span {
    color: #7b1fa2 !important;
}

/* Routine Maintenance - Green */
#filterRoutine:checked + span,
.filter-checkbox-label:has(#filterRoutine:checked) {
    background-color: #e8f5e9 !important;
    color: #388e3c !important;
    border-color: #388e3c !important;
}

.filter-checkbox-label:has(#filterRoutine:checked) span {
    color: #388e3c !important;
}

/* Update checkbox accent colors to match */
#filterPreventive {
    accent-color: #1976d2;
}

#filterCorrective {
    accent-color: #f57c00;
}

#filterPredictive {
    accent-color: #7b1fa2;
}

#filterRoutine {
    accent-color: #388e3c;
}

/* Date input styling - IMPROVED FOR NARROW LAYOUT */
.maintenance-filter-form input[type="date"] {
    font-family: inherit;
    font-size: 12px;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
}

.maintenance-filter-form input[type="date"]:focus {
    outline: none;
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Adjust date range grid for narrow layout */
.maintenance-filter-form > div:nth-child(3) > div {
    display: grid;
    grid-template-columns: 1fr; /* Stack date inputs vertically instead of side-by-side */
    gap: 10px;
}

/* Make labels smaller */
.maintenance-filter-form label {
    font-size: 13px;
}

.maintenance-filter-form > div > label {
    margin-bottom: 8px;
}

/* Adjust button styling for narrow width */
.maintenance-filter-form button {
    font-size: 13px;
    padding: 8px 12px;
}

/* Filter summary box */
#filterSummary {
    animation: fadeIn 0.3s ease;
    font-size: 12px;
    line-height: 1.4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make filter form more compact on smaller screens */
@media (max-width: 768px) {
    .maintenance-filter-form {
        padding: 12px;
    }
    
    .maintenance-filter-form input[type="date"] {
        font-size: 11px;
        padding: 5px;
    }
}
/******** End of Filter Form Styles *************/

/************************************************/
/******** Corrected Layout CSS ******************/

/* Main wrapper: displays children side-by-side */
.assets-content-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}


/* Left sidebar: stacks folder tree and filter vertically */
.left-sidebar-wrapper {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

/* Right content area: takes remaining space */
.assets-table-container {
    flex: 1;
    min-width: 0;          /* ✅ IMPORTANT: Allows flex item to shrink */
    max-width: 100%;       /* ✅ IMPORTANT: Never exceeds available space */
    overflow-x: hidden;    /* ✅ Hide horizontal overflow at this level */
    box-sizing: border-box;
}

/* Ensure folder tree and filter have consistent styling */
.left-sidebar-wrapper .assets-folder-container,
.left-sidebar-wrapper .maintenance-filter-form {
    width: 100%;
    box-sizing: border-box;
}

/******** End of Layout CSS *********************/

/* ========================================
   ICON-ONLY ACTION BUTTONS (NO COLORED BACKGROUNDS)
   ======================================== */

/* Icon-only button - transparent background */
.btn-icon-action {
    background: transparent;      /* No background color */
    border: none;                 /* No border */
    padding: 4px;                 /* Minimal padding */
    margin: 0 4px;                /* Space between buttons */
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hover effect - slight scale and opacity change */
.btn-icon-action:hover {
    transform: scale(1.15);       /* Enlarge on hover */
    opacity: 0.8;                 /* Slight transparency */
}

/* Active/click effect */
.btn-icon-action:active {
    transform: scale(0.95);       /* Slightly smaller on click */
}

/* SVG icon styling */
.action-icon {
    width: 24px;                  /* Icon size */
    height: 24px;                 /* Icon size */
    display: block;               /* Remove inline spacing */
    pointer-events: none;         /* Clicks pass through to button */
}

/* Remove any filters - use original SVG colors */
.btn-icon-action .action-icon {
    filter: none;                 /* Keep original icon colors */
}

/************************************************/
/********* complete maintenance *****************/
/* Complete Maintenance Button - Green */
.btn-complete {
    background: transparent;
    border: none;
    padding: 4px;
    margin: 0 4px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-complete:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.btn-complete .action-icon {
    width: 24px;
    height: 24px;
    display: block;
    pointer-events: none;
}

/* Role Badge Styles */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.role-admin {
    background: #e74c3c;
    color: white;
}

.role-manager {
    background: #3498db;
    color: white;
}

.role-technician {
    background: #27ae60;
    color: white;
}


/***************************************************************/
/* ================================================================================
   MAINTENANCE CHECKLIST COMPLETION MODAL
   ================================================================================ */


/* Checklist header table styling */
#checklistHeaderSection table {
    font-size: 14px;
}

#checklistHeaderSection table td {
    vertical-align: middle;
}

/* Checklist item table styling */
#maintenanceChecklistsContent table {
    font-size: 14px;
}

#maintenanceChecklistsContent table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

#maintenanceChecklistsContent table td {
    vertical-align: middle;
}

/* Checkbox styling */
#maintenanceChecklistsContent input[type="checkbox"] {
    accent-color: #27ae60;
    transform: scale(1.2);
}

#maintenanceChecklistsContent input[type="checkbox"]:hover {
    cursor: pointer;
    transform: scale(1.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #maintenanceChecklistModal .modal-content {
        max-width: 95%;
        padding: 15px;
    }
    
    #checklistHeaderSection table {
        font-size: 12px;
    }
    
    #maintenanceChecklistsContent table {
        font-size: 12px;
    }
}

/* Signature Footer Styling */
.signature-footer {
    margin-top: 0;
    border-top: 2px solid #dee2e6;
}

.signature-footer table {
    width: 100%;
    margin: 0;
}

.signature-footer thead tr {
    background: linear-gradient(135deg, #f0b05d 0%, #f39c12 100%);
}

.signature-footer th {
    color: white;
    padding: 12px;
    font-weight: 600;
    text-align: center;
}

.signature-footer td {
    text-align: center;
    padding: 40px 10px;
    vertical-align: bottom;
}

.signature-line {
    border-bottom: 2px solid #333;
    width: 80%;
    margin: 0 auto 10px auto;
}

.signature-label {
    font-size: 12px;
    color: #666;
}

/**************** end of check list completion ****************/

/* ================================================================================
   MOBILE RESPONSIVE STYLES - ENHANCED
   Added: [Current Date]
   ================================================================================ */

/* ===== TABLET BREAKPOINT (768px - 1024px) ===== */
@media (max-width: 1024px) {
    /* Adjust main content padding */
    main {
        padding: 15px;
    }
    
    /* Make buttons stack better */
    .btn, .btn-secondary {
        font-size: 13px;
        padding: 10px 15px;
    }
    
    /* Adjust sidebar width */
    .left-sidebar-wrapper {
        width: 250px;
    }
}

/* ===== MOBILE BREAKPOINT (max-width: 768px) ===== */
@media (max-width: 768px) {
    
    /* === PAGE TITLE === */
    .page-title {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .page-subtitle {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    /* === ACTION BUTTONS - MAKE THEM STACK === */
    main > div:first-of-type {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 1rem;
    }
    
    main > div:first-of-type .btn,
    main > div:first-of-type .btn-secondary {
        width: 100%;
        margin: 0 !important;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* === HIDE FOLDER SIDEBAR ON MOBILE === */
    .assets-content-wrapper {
        display: block !important;
    }
    
    .left-sidebar-wrapper {
        display: none !important;
    }
    
    /* === MAKE MAIN CONTENT FULL WIDTH === */
    .main-content-area {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* === FORM - STACK COLUMNS === */
    .maintenance-form .form-row {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    /* === CALENDAR - REDUCE TO 7 DAYS (COMPACT) === */
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
        font-size: 12px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    .calendar-event {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    .calendar-header h3 {
        font-size: 18px;
    }
    
    .calendar-header button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* === MODALS - MAKE MOBILE FRIENDLY === */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 5% auto !important;
        padding: 15px !important;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content h3 {
        font-size: 16px;
    }
    
    /* === TABLES - MAKE SCROLLABLE === */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    /* === MASTER PLAN TABLE === */
    #maintenanceMasterPlanTable {
        font-size: 11px;
    }
    
    #maintenanceMasterPlanTable th,
    #maintenanceMasterPlanTable td {
        padding: 6px 4px;
    }
    
    /* === CHECKLISTS === */
    .checklist-grid {
        grid-template-columns: 1fr !important;
    }
    
    .checklist-card {
        margin-bottom: 15px;
    }
    
    /* === FILTER BUTTONS === */
    .filter-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-buttons button {
        width: 100%;
    }
    
    /* === SIGNATURE CANVAS === */
    #signatureCanvas {
        max-width: 100%;
        height: 150px;
    }
}

/* ===== SMALL MOBILE BREAKPOINT (max-width: 480px) ===== */
@media (max-width: 480px) {
    
    /* === EVEN SMALLER TEXT === */
    .page-title {
        font-size: 20px;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    /* === BUTTONS - SMALLER PADDING === */
    .btn, .btn-secondary {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* === CALENDAR - ULTRA COMPACT === */
    .calendar-day {
        min-height: 50px;
        padding: 3px;
        font-size: 10px;
    }
    
    .calendar-day-number {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .calendar-event {
        font-size: 8px;
        padding: 1px;
        margin: 1px 0;
    }
    
    .calendar-day-header {
        padding: 5px;
        font-size: 11px;
    }
    
    /* === HIDE SOME CALENDAR EVENTS IF TOO MANY === */
    .calendar-day .calendar-event:nth-child(n+4) {
        display: none;
    }
    
    /* === TABLES - EVEN MORE COMPACT === */
    .data-table {
        font-size: 10px;
    }
    
    .data-table th,
    .data-table td {
        padding: 5px 3px;
    }
    
    /* === MODAL - FULL SCREEN === */
    .modal-content {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    /* === FORM INPUTS - LARGER TAP TARGETS === */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* === CHECKBOXES - LARGER === */
    input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
    }
}

/* ===== LANDSCAPE MOBILE (max-height: 500px) ===== */
@media (max-height: 500px) and (orientation: landscape) {
    
    /* Reduce header height */
    header {
        padding: 10px 15px;
    }
    
    .page-title {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .page-subtitle {
        display: none;
    }
    
    /* Compact buttons */
    .btn, .btn-secondary {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Modal takes less vertical space */
    .modal-content {
        max-height: 95vh;
        padding: 10px;
    }
}

/* ===== TOUCH-FRIENDLY ENHANCEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger tap targets for all interactive elements */
    button,
    .btn,
    .btn-secondary,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .calendar-day:hover {
        background: white;
    }
    
    .btn:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* ===== PRINT STYLES (BONUS) ===== */
@media print {
    /* Hide navigation and buttons when printing */
    .sidebar,
    .sidebar-overlay,
    header,
    .menu-toggle,
    .btn,
    .btn-secondary,
    .left-sidebar-wrapper,
    .notifications-panel {
        display: none !important;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
    
    .main-content-area {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Expand tables for printing */
    .data-table {
        font-size: 10px;
    }
}

/* Mobile filter toggle button */
.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: block !important;
    }
}

/* ===== END OF MOBILE RESPONSIVE STYLES ===== */

/* ========================================
   MASTER PLAN SPECIFIC SPACING - REDUCED GAP
   ======================================== */

/* When Master Plan is active, use a smaller gap */
.assets-content-wrapper.master-plan-active {
    gap: 20px !important; /* Reduced from 40px to 20px for Master Plan */
}