/* Import base.css variables - Nature Theme */
:root {
    --primary-color: var(--primary, #2d5016);
    --primary-hover: var(--primary-hover, #1f3b0d);
    --background-color: var(--background, #f5f3f0);
    --card-background: var(--surface, #fefdfb);
    --text-color: var(--text-primary, #2b2520);
    --border-color: var(--border, #e8dcc8);
    --success-color: var(--success, #7ab55c);
    --warning-color: var(--warning, #c87533);
    --danger-color: var(--danger, #8b5a3c);
    --info-color: var(--info, #4a90a4);
    --forest-green: #2d5016;
    --earth-brown: #6b4423;
    --sky-blue: #4a90a4;
    --leaf-green: #7ab55c;
    --sand-light: #e8dcc8;
}

/* Disable pinch zoom on mobile but allow touch drags */
html, body {
    touch-action: manipulation;  /* Allow touch drags/swipes but disable pinch zoom */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
}

/* Disable pull-to-refresh on both Gantt and Todo views */
#gantt_here, #todo_here {
    overscroll-behavior: none;
}

/* Enable touch interactions on calendar and interactive containers */
#calendar_here {
    touch-action: auto;  /* Allow all touch gestures for calendar dragging */
    -webkit-user-select: none;
    user-select: none;
}

/* Ensure calendar events are touchable on iOS */
#calendar_here * {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Specifically enable pointer events for calendar event elements */
.dhx_event,
[class*="dhx"],
[class*="calendar"] {
    pointer-events: auto !important;
    -webkit-user-select: none;
    user-select: none;
}

/* Calendar event resizer - make bigger on mobile for easier touch targeting */
.wx-event-calendar-resizer {
    width: 20px !important;
    height: 20px !important;
}

@media (max-width: 768px) {
    .wx-event-calendar-resizer {
        width: 32px !important;
        height: 32px !important;
        bottom: -16px !important;  /* Extend below event for easier access */
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    --header-height: auto;
}

/* Status color indicators - Nature Theme */
.gantt_task_new {
    background:  #f5a623;
}
.gantt_task_in_progress {
    background:  #4a90e2 ;
}
.gantt_task_done {
    background:  #5fa319 ;
}
.gantt_task_on_hold {
    background: linear-gradient(90deg, #b0b0b0 0%, #808080 100%);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
}
.status-badge.new { background: #fef3e0; color: #c87533; }
.status-badge.in_progress { background: #e0f2f7; color: #3a7a8a; }
.status-badge.done { background: #e8f5e1; color: #2d5016; }
.status-badge.on_hold { background: #f5f5f5; color: #616161; }

.task-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 4px;
}
.task-type-badge.project { background: #d4a5ff; color: #5a1a99; }
.task-type-badge.milestone { background: #ffd700; color: #8b7500; }
.task-type-badge.story { background: #87ceeb; color: #003366; }
.task-type-badge.task { background: #e0e0e0; color: #333; }

.members-display {
    font-size: 0.85em;
    color: #666;
}

/* Marker Styles */
.gantt_marker {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 2px solid #ff0000;
}

/* ========================================
   VIEW CONTAINERS (Gantt, Todo, Calendar)
   ======================================== */
.view-container {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}


/* Gantt Container - Dynamic Height */
#gantt_here, #todo_here,
#calendar_here {
    font-family: var(--font-family);
    width: 100%;
    flex: 1;
    background: white;
    position: relative;
    z-index: 1;
    transition: margin-left 0.3s ease;
  
}

#todo_here,
#calendar_here {
    display: none;

 
}

#todo_here.active,
#calendar_here.active,
#gantt_here.active {
    display: block;
}

/* ========================================
   VIEW SWITCHER BUTTONS
   ======================================== */
.view-switcher {
    display: flex;
    gap: 4px;
    padding: 2px;
}

.view-switcher .btn {
    border: none;
    background: transparent;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.view-switcher .btn:hover {
    background: var(--background-color);
}

.view-switcher .btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   PROJECT FILTER SECTION
   ======================================== */
.filter-projects-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

.project-filter-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
    background: var(--card-background);
}

.project-filter-item:hover {
    background: var(--background-color);
}

.project-filter-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.project-filter-label {
    flex: 1;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

.project-filter-count {
    font-size: 0.8em;
    color: var(--text-secondary, #666);
    background: var(--background-color);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.gantt_marker.today {
    background: rgba(255, 0, 0, 0.15);
    border-left: 3px solid #ff0000;
}

.gantt_marker .gantt_marker_content {
    color: #8b5a3c;
    font-weight: 600;
    font-size: 11px;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Project and milestone bars - Original Colors */
.gantt_task_project {
   
       background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}
.gantt_task_milestone {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}
.gantt_task_story {
    background: linear-gradient(90deg, #9b59b6 0%, #844c9a 100%);
}

/* Side Menu Styles - Dynamic Height */
.side-menu {
    position: fixed;
    right: -300px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding-top: auto;
}

.side-menu.open {
    right: 0;
}

/* LEFT SIDE MENU STYLES - Dynamic Height */
.left-side-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: auto;
}

.left-side-menu.open {
    transform: translateX(0);
}

/* Header toggle button for left menu */


#leftMenuToggleBtn:hover {

    transform: scale(1.05);
}

#leftMenuToggleBtn:active {
    transform: scale(0.98);
}

.left-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-menu-section {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.left-menu-section:last-child {
    border-bottom: none;
}

.left-menu-section h5 {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
}

.filter-buttons-container .filter-btn {
    padding: 6px 10px;
    font-size: 12px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.filter-buttons-container .filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tool-btn {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
    background: #f5f5f7;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tool-btn:hover {
    background: #e8e8eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

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

.tool-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(45, 80, 22, 0.3);
}

.tool-btn i {
    margin-right: 4px;
}

.side-menu-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-menu-section {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

/* Collapsible Section Styles */
.collapsible-section {
    border-bottom: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: var(--space-md) var(--space-sm);
    margin: calc(-1 * var(--space-md));
    margin-bottom: 0;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.section-header:hover {
    background: var(--primary-light);
}

.section-header h4 {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    -webkit-user-select: none;
    user-select: none;
}

.collapse-arrow {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    transition: transform var(--transition-slow);
    -webkit-user-select: none;
    user-select: none;
}

.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

.section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height var(--transition-slow), opacity var(--transition-slow), padding var(--transition-slow);
    opacity: 1;
    padding-top: var(--space-md);
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Subsection Styles */
.subsection {
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--background);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-light);
}

.subsection-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: var(--space-sm);
}


/* Header Controls Styling - Dynamic Height with 2 Rows - Nature Theme */
header {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.95) 0%, rgba(90, 125, 66, 0.95) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 998;
    height: auto;
}

/* Header Row 1: Left Menu, User Name, Right Menu */
.header-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    gap: var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-row-1 .header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

.header-row-1 .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 0 0 auto;
}

/* Header Row 2: Tools Grid */
.header-row-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-md);
}

.header-tools-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.header-tools-center {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.header-tools-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.header-tools-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-tools-group .btn {
    padding: 6px 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-base);
}

.header-tools-group .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.header-tools-group .btn:active:not(:disabled) {
    transform: translateY(0);
}

.header-tools-group .btn.active {
    background: rgba(52, 199, 89, 0.8);
    border-color: rgba(52, 199, 89, 0.9);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.header-left-controls {
    display: flex;
    gap: var(--space-sm);
}

/* Header buttons override for light appearance on gradient background */


header .btn:hover:not(:disabled) {

    transform: translateY(-1px);

}

header .btn:active:not(:disabled) {
    transform: translateY(0);
}

header .btn-primary {
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
}

header .btn.active {
    background: var(--warning);
    color: var(--text-inverse);
}

header h1 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-inverse);
    letter-spacing: -0.5px;
}

.header-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

#filterAssignedButtons {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

#filterAssignedButtons .filter-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}







/* Quick Action Buttons - Use base.css styling */
.header-quick-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.user-controls {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* Button base styling - Use base.css .btn classes */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button active state for column toggle */
button.active {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

button.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

/* Legacy button support - map to base.css classes */
button.secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

button.secondary:hover:not(:disabled) {
    background: var(--border-light);
}

/* Additional button utilities */
.btn-block {
    width: 100%;
    display: block;
}

.mb-3 {
    margin-bottom: var(--space-lg);
}

#zoomControls button {
    padding: 6px 12px;
    font-size: 12px;
}



.gantt_tree_content {
    font-family: var(--font-family);
        font-size: 16px;
    font-weight: 300;
    color:var(--text-primary) ;
}

.gantt_scale_cell {
    color: var(--text-primary)  !important;
    font-weight: 300;
    font-size: 11px;
    font-family: var(--font-family);
}

.gantt_grid_head_cell{
    font-family: var(--font-family);
      color: var(--text-primary)  !important;
      font-size: 12px;
}

.gantt_grid_head_text {
      font-size: 14px;
       font-family: var(--font-family);
}

.gantt_task_content {
font-size: 16px;
    font-weight: 600;
     font-family: var(--font-family);
}



.gantt_cal_light {
 font-family: var(--font-family);
    width: 100vw !important;
    max-width: 900px;
    min-width: 150px;
    /* height: 100vh; */
    padding-bottom: 60px;
    margin-top: 113px;
}
.gantt_cal_lsection {
   display: none;
}
.gantt_cal_lsection label {

    gap: 4px;

    font-size: 10px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--background-color);
}

.login-card {
    background: var(--card-background);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.google-btn {
    background-color: #4285F4;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Modal - Extended from base.css */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

/* CSV Import Modal specific styles */
.csv-import-modal {
    max-width: 600px;
    width: 90%;
}

.csv-paste-area {
    width: 100%;
    height: 200px;
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: var(--font-size-sm);
    box-sizing: border-box;
    resize: vertical;
}

.csv-paste-area:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.csv-preview {
    background: var(--background);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    max-height: 150px;
    overflow: auto;
    font-size: var(--font-size-xs);
    border: 1px solid var(--border);
    font-family: monospace;
    margin: 0;
}

/* Form styling - Extended from base.css */
.form-group {
    margin-bottom: var(--space-lg);
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--background);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* DHTMLX Overrides for iOS feel */
.gantt_task_line {
    border-radius: 6px;
}

.gantt_grid_scale, .gantt_task_scale {
    background-color: #f9f9f9;
    color: #8e8e93;
}

.gantt_grid_data .gantt_cell {
    color: var(--text-color);
}

/* Status Colors */
.status_high { background-color: var(--danger-color); }
.status_normal { background-color: var(--primary-color); }
.status_low { background-color: var(--success-color); }

/* Utility Classes - Use base.css variables */
.hidden { display: none; }
.flex-end { display: flex; gap: var(--space-md); justify-content: flex-end; }
.text-muted { color: var(--text-muted); margin-bottom: var(--space-2xl); }
.text-error { color: var(--danger); margin-top: var(--space-lg); display: none; }
.text-error.visible { display: block; }
.login-section { margin-bottom: 20px; }
.login-divider-label { font-size: 12px; color: #999; text-align: center; margin-bottom: 10px; }
.login-divider { text-align: center; margin: 20px 0; color: #999; position: relative; }
.login-divider-line { border-top: 1px solid #e0e0e0; }
.login-divider-text { background: white; padding: 0 10px; position: relative; top: -10px; }
.login-form-section { margin-top: 20px; }


/* Mobile Tweaks */
@media (max-width: 768px) {
    /* Mobile Tweaks */
    .gantt_task {
        width: 100% !important;
    }
    
    /* Mobile left menu adjustments */
    .left-side-menu {
        z-index: 1001;
        width: 280px;
    }
    
    /* ==========================================
       PHONE MODE - MODERN MOBILE UI DESIGN
       ==========================================
       Design Principles:
       - Undo/Redo always visible (important actions)
       - Buttons sized at min 44px height (iOS HIG)
       - Toggle button on left (Material Design)
       - Menu button on right
       - Clear visual hierarchy
       - Minimal text labels, emoji only
    ========================================== */
    

    
    /* Always show quick actions (undo/redo) */
    .header-quick-actions {
        display: flex !important;
        order: 2;
    }
    
    .header-quick-btn {
        padding: 8px 12px !important;
        font-size: 16px !important;
        min-height: 30px;
        display: flex;
        align-items: center;
    }
    
    /* Hide header controls by default on phones */
    .header-controls {
        display: none !important;
        pointer-events: none;
    }
    
    /* Show header controls when toggled on phones - better sizing */
    .header-controls.visible {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-start;
        position: fixed !important;
        top: 54px !important;
        left: 0 !important;
        right: 0 !important;
        gap: 8px;
        padding: 12px 12px;
        background: linear-gradient(135deg, rgba(45, 80, 22, 0.95) 0%, rgba(90, 125, 66, 0.95) 100%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 1050;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        max-height: fit-content;
        overflow-y: auto;
        margin-top: 0 !important;
        width: 100% !important;
        pointer-events: auto;
    }
    
    /* Style buttons inside visible header controls - match desktop styling */
    .header-controls.visible button {
        background: rgba(255, 255, 255, 0.95) !important;
        color: #333 !important;
        padding: 7px 14px !important;
        font-size: 13px !important;
        border: none !important;
        border-radius: 14px !important;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        font-weight: 500;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
    }
    
    .header-controls.visible button:hover {
        background: white !important;
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .header-controls.visible button:active {
        transform: translateY(0);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Show filter buttons in mobile view inside header-controls */
    #filterAssignedButtons {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    
    .header-left h1 {
        font-size: 16px !important;
        font-weight: 600;
    }

    /* Collapse side menu width on mobile */
    .side-menu {
        width: 250px !important;
    }
    
   
    

    
    .activity-stream-section h4 {
        font-size: 13px !important;
    }
    
    .activity-search-input {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }
    
    .activity-item {
        font-size: 0.8em !important;
        padding: 8px !important;
    }
    
    .activity-stream-list {
        max-height: 200px !important;
        overflow-y: auto;
    }

    /* Mobile Lightbox - Fill screen */
    .gantt_cal_tab {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
    }

    /* Lightbox header */
    .gantt_cal_tab_header {
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
    }

    /* Lightbox content area */
    .gantt_cal_tab_content {
        height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
    }

    /* Lightbox buttons */
    .gantt_cal_tab_btns {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 10000 !important;
        background: white !important;
        border-top: 1px solid #ddd !important;
    }

    .gantt_cal_tab_btns button {
        flex: 1 !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
}

/* Large phones/tablets (769px - 1023px) - Hybrid mode */
@media (min-width: 769px) and (max-width: 1023px) {
    /* Show most buttons but make them more compact */
    .header-controls {
        display: flex !important;
        gap: 6px !important;
    }
    
    .header-controls button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    /* Hide toggle button on tablets */
    .header-toggle-btn {
        display: none !important;
    }
    
    /* Show quick actions on tablets */
    .header-quick-actions {
        display: flex !important;
    }
}

/* Desktop (1024px and above) - Full display */
@media (min-width: 1024px) {
    /* Show all controls with full spacing */
    .header-controls {
        display: flex !important;
        gap: 8px !important;
    }
    
    .header-controls button {
        padding: 7px 14px !important;
        font-size: 13px !important;
    }
    
    /* Hide toggle button on desktop */
    .header-toggle-btn {
        display: none !important;
    }
    
    /* Show quick actions on desktop */
    .header-quick-actions {
        display: flex !important;
    }
}

/* Gantt Inline Editing */
.gantt_grid_edit_cell {
    background-color: #f0f8ff;
    border: 2px solid #0d6efd;
}

.gantt_grid_edit_cell input,
.gantt_grid_edit_cell select {
    width: 100%;
    padding: 6px;
    border: 1px solid #0d6efd;
    border-radius: 4px;
    font-size: 13px;
}

.gantt_grid_edit_cell input[type="text"],
.gantt_grid_edit_cell input[type="number"],
.gantt_grid_edit_cell input[type="date"] {
    box-sizing: border-box;
}

/* Gantt Tooltip */
.gantt-tooltip {
    background-color: #1c1c1e;
    color: #f5f5f7;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 300px;
    line-height: 1.4;
}

.gantt-tooltip strong {
    color: #fff;
    display: block;
    margin-top: 6px;
}

.gantt-tooltip strong:first-child {
    margin-top: 0;
}

.gantt-tooltip em {
    color: #a1a1a6;
    font-style: italic;
}

.gantt-tooltip br {
    margin: 4px 0;
}

/* Lightbox Compact Styling - Hide section labels */
.gantt_section_text .gantt_cal_ltext_fixed_width,
.gantt_section_task_type .gantt_cal_ltext_fixed_width,
.gantt_section_assigned_members .gantt_cal_ltext_fixed_width,
.gantt_section_priority .gantt_cal_ltext_fixed_width {
    display: none;
}

.gantt_section_text,
.gantt_section_task_type,
.gantt_section_assigned_members,
.gantt_section_priority {
    margin-top: -8px !important;
}

/* Side Menu & Filter Styles */
.side-menu-top {
    border-bottom: 1px solid #ddd;
    padding-bottom: 18px;
    text-align: right;
}

.user-name-display {
    font-weight: 600;
    color: white;
    padding: 0px 10px;
}


.filter-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0;
    row-gap: 4px;
}

.clear-filters-btn {
    margin-top: 8px;
}

.admin-section {
    display: none;
}

.admin-delete-btn {
    background-color: #ffe0e0;
    border-color: #dc3545;
    color: #dc3545;
}

.import-help-text {
    color: #666;
    font-size: 0.9em;
}

/* Quick Info Popup Styles */
.gantt_quick_info {
    min-width: 400px !important;
    width: 700px !important;
    max-width: 700px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    overflow: visible !important;
}

.gantt_quick_info_content {
    padding: 16px 20px !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.6 !important;
    color: #333 !important;
    font-size: 14px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    width: 100% !important;
    display: block !important;
}

.gantt_cal_qi_content {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.quick-info-container {
    padding: 10px;
}

.quick-info-row {
    margin-bottom: 10px;
}

.quick-info-label {
    margin-top: 5px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.quick-info-section {
    margin-bottom: 10px;
}

.quick-info-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.quick-info-footer {
    margin-top: 10px;
}

/* Form Block Styles */
.form-block-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    margin-bottom: 8px;
}

.assigned-members-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    min-height: 40px;
    background: #fafafa;
    border-radius: 3px;
}

/* Members Display Styling */
.members-display {
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 22px;
    font-size: 0.85em;
    color: #1976d2;
    font-weight: 500 !important;
}

/* Activity Stream Styles */
.activity-stream-section {
    display: flex;
    flex-direction: column;
    padding: 12px !important;
    border-bottom: 2px solid #e8e8eb !important;
    background: rgba(245, 245, 247, 0.5);
    border-radius: 8px;
    margin-bottom: 8px;
}

.activity-stream-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.activity-search-container {
    margin-bottom: 10px;
}

.activity-search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    background: white;
    color: var(--text-color);
}

.activity-search-input::placeholder {
    color: #999;
}

.activity-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 4px rgba(0, 122, 255, 0.2);
}

.activity-stream-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

/* Custom scrollbar for activity stream */
.activity-stream-list::-webkit-scrollbar {
    width: 6px;
}

.activity-stream-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.activity-stream-list::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.activity-stream-list::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.activity-item {
    padding: 10px;
    background: #f9f9fb;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
}

.activity-item:hover {
    background: #eff5ff;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.1);
}

.activity-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.activity-item-action {
    font-weight: 600;
    color: var(--text-color);
}

.activity-item-action.create {
    color: #7ab55c;
}

.activity-item-action.update {
    color: #c87533;
}

.activity-item-action.delete {
    color: #8b5a3c;
}

.activity-item-time {
    font-size: 0.8em;
    color: #999;
}

.activity-item-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
    word-break: break-word;
}

.activity-item-changes {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 4px;
    padding: 4px 0;
    line-height: 1.4;
}

.change-item {
    display: inline-block;
    margin-right: 8px;
}

.change-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

.change-tag.create {
    background: #d4f4d4;
    color: #27663a;
}

.change-tag.update {
    background: #fff3cd;
    color: #856404;
}

.change-tag.delete {
    background: #f8d7da;
    color: #721c24;
}

.old-value {
    text-decoration: line-through;
    color: #ff3b30;
    font-weight: 500;
}

.new-value {
    color: #7ab55c;
    font-weight: 500;
}

.member-badge {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    background: var(--primary-color);
    color: white;
    white-space: nowrap;
}

.member-badge.old {
    background: #8b5a3c;
    opacity: 0.7;
}

.member-badge.new {
    background: #7ab55c;
}

.activity-item-user {
    font-size: 0.75em;
    color: #666;
}

.activity-loading {
    text-align: center;
    padding: 20px 10px;
    color: #666;
    font-size: 0.9em;
}

.activity-loading.hidden {
    display: none !important;
}

/* WebSocket Real-time Activity Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.activity-item {
    animation: slideIn 0.3s ease-out;
}

.activity-stream-section.live-update {
    animation: pulse 0.5s ease-in-out;
}

/* Admin Section Styles */
.admin-section {
    display: none;
}

.admin-dashboard-btn {
    background: linear-gradient(135deg, #2d5016 0%, #5a7d42 100%) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.3) !important;
}

.admin-dashboard-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.4) !important;
}

.admin-action-btn {
    background: #e8f5e1 !important;
    color: #2d5016 !important;
    font-weight: 500;
}

.admin-action-btn:hover {
    background: #d1e7dd !important;
}

.admin-delete-btn {
    background: #ffebee !important;
    color: #c62828 !important;
    font-weight: 600;
}

.admin-delete-btn:hover {
    background: #ffcdd2 !important;
    color: #b71c1c !important;
}

.admin-section-divider {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* ========================================
   AI CSV GENERATOR STYLES
   ======================================== */

.ai-csv-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.ai-hidden {
    display: none !important;
}

.ai-textarea {
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}

.ai-retry-counter {
    font-size: 0.85rem;
    align-items: center;
    gap: var(--space-md);
}

.ai-response-area {
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-height: 100px;
}

.ai-response-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ai-response-header h4 {
    margin: 0;
    color: var(--success);
}

.ai-response-stats {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: rgba(52, 199, 89, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.ai-response-stats span {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ai-response-preview {
    margin: var(--space-md) 0;
}

.ai-response-preview summary {
    cursor: pointer;
    padding: var(--space-sm);
    background: var(--primary-light, rgba(0, 122, 255, 0.1));
    border-radius: var(--radius-sm);
    font-weight: 500;
    -webkit-user-select: none;
    user-select: none;
    transition: all var(--transition-base);
}

.ai-response-preview summary:hover {
    background: var(--primary-light, rgba(0, 122, 255, 0.15));
}

.ai-response-preview pre {
    margin: var(--space-sm) 0 0 0;
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 300px;
    overflow-y: auto;
}

.ai-response-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.ai-response-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* AI Reasoning Display */
.ai-reasoning-container {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.ai-reasoning-block {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.ai-reasoning-summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--primary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.ai-reasoning-summary:hover {
    background: rgba(102, 126, 234, 0.1);
}

.ai-reasoning-content {
    padding: var(--space-md) var(--space-md) 0 var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-top: var(--space-sm);
}

.reasoning-line {
    padding: var(--space-xs) 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.ai-provider-help {
    display: block;
    margin-top: var(--space-sm);
}

/* Status colors for alerts */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    background: var(--surface);
}

.alert-error {
    border-left-color: var(--danger);
    background: rgba(255, 59, 48, 0.05);
    color: var(--danger);
}

.alert-warning {
    border-left-color: var(--warning);
    background: rgba(255, 204, 0, 0.05);
    color: #856404;
}

.alert-info {
    border-left-color: var(--primary);
    background: var(--primary-light, rgba(0, 122, 255, 0.05));
    color: var(--primary);
}

.alert-success {
    border-left-color: var(--success);
    background: rgba(52, 199, 89, 0.05);
    color: var(--success);
}

/* Modal refinements */
.modal-content.ai-csv-modal .form-group {
    margin-bottom: var(--space-lg);
}

.modal-content.ai-csv-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Status text in AI modal */
#aiStatusText {
    display: block;
}

/* Responsive AI modal */
@media (max-width: 768px) {
    .ai-csv-modal {
        max-width: 95vw;
        max-height: 95vh;
    }

    .ai-response-stats {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .ai-response-actions {
        flex-direction: column;
    }

    .ai-response-actions .btn {
        width: 100%;
    }
}

/* ========================================
   WEEKEND HIGHLIGHTING
   ======================================== */

.weekend {
    background: #f4f7f4 !important;
}

/* ========================================
   TASK FILTER INPUT
   ======================================== */

#task-filter {
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#task-filter:focus {
    box-shadow: 0 0 0 3px var(--primary-light) !important;
    border-color: var(--primary) !important;
}

#task-filter::placeholder {
    color: var(--text-muted);
}

/* ========================================
   LOGIN PAGE LOGO
   ======================================== */

.card-header h1 {
    margin: 0;
    padding: var(--space-md) 0;
}

.card-header h1 img {
    max-width: 66%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ========================================
   AVATAR STYLING - CONSISTENT ACROSS ALL VIEWS
   ======================================== */

.assigned-avatar-grid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background-color: #007AFF;
    color: white;
    font-weight: 600;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    flex-shrink: 0;
    margin-right: 6px;
    text-transform: uppercase;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assigned-avatar-grid:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ========================================
   CALENDAR TIMELINE SECTION STYLING
   ======================================== */

.template-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 9px 7px;
    width: 100%;
    gap: 8px;
}

.template-wrapper .assigned-avatar-grid {
    margin-right: 0;
    flex-shrink: 0;
}

.section-label {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    justify-content: start;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #2b2520);
    white-space: nowrap;
}

/* ========================================
   TODO WIDGET USER AVATARS - AGGRESSIVE OVERRIDE
   ======================================== */

/* Hide ALL broken image tags in Todo widget sections - CRITICAL */
.wx-section-img {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: hidden !important;
}

img[src="#007AFF"],
img[src*="#"] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

/* Style Todo sections to properly display avatars */
.wx-todo_timeline_section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wx-todo_timeline_section .assigned-avatar-grid {
    margin-right: 8px;
}

/* Ensure avatar divs are visible */
.todo-avatar {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 8px;
    text-transform: uppercase;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}



.wx-todo_user-menu__avatar {
    transform: scale(1.1);
}
.wx-event-calendar-calendar-week {
    min-height: 100px !important;
}