:root {
    --bg-color: #F8FAFC;
    --text-main: #111827;
    --text-muted: #64748b;
    --border-color: #E5E7EB;
    --primary: #2563EB;
    --success: #22C55E;
    --danger: #ef4444;
    --warning: #f59e0b;
    --white: #ffffff;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --row-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

/* Modal & Form Redesign Helpers */
.modal-section {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.modal-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group-full {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--white);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .form-group-full {
        grid-column: span 1;
    }
}

/* Sidebar Styles */
.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-right: 1px solid var(--border-color);
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar-toggle {
    min-width: 24px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    opacity: 0.7;
}

.sidebar-toggle:hover {
    opacity: 1;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-brand {
    margin-left: 12px;
    font-weight: 800;
    font-size: 18px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
    margin: 0;
}

.sidebar-nav {
    padding: 24px 12px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    overflow: hidden;
    font-weight: 500;
}

.nav-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-item.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.logout-nav-item:hover {
    background: #fee2e2;
    color: var(--danger);
}

.logout-nav-item:hover .nav-icon {
    color: var(--danger);
}

.nav-icon {
    min-width: 24px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    margin-left: 12px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    margin: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    margin-left: 8px;
    margin-right: 8px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

.user-identity {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====================== 
    LAYOUT & WRAPPERS
   ====================== */ 

.main-wrapper { 
    flex-grow: 1; 
    margin-left: 240px; 
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    padding: 32px; 
    min-height: 100vh;
} 

.sidebar.collapsed + .main-wrapper { 
    margin-left: 72px; 
} 

.dashboard-container { 
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto;
}

/* ====================== 
    TABLES & LISTS
   ====================== */ 

/* Table Layout Fixes */
.table-container { 
    background: var(--white); 
    border-radius: var(--radius); 
    box-shadow: var(--card-shadow); 
    overflow-x: auto; 
    margin-bottom: 24px; 
    border: 1px solid var(--border-color);
    width: 100%;
    -webkit-overflow-scrolling: touch;
} 

table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    table-layout: auto;
} 

th, td {
    white-space: nowrap;
}

td.task-title-cell, td.project-plan-cell {
    white-space: normal;
} 

th { 
    text-align: left; 
    padding: 14px 24px; 
    color: var(--text-muted); 
    font-size: 11px; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color); 
    background: #f8fafc;
} 

td { 
    padding: 16px 24px; 
    border-bottom: 1px solid var(--border-color); 
    vertical-align: middle; 
    font-size: 14px;
    color: var(--text-main);
} 

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

tr:hover td { 
    background: #f8fafc; 
} 

/* Project Badge in Task Row */
.project-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f5f9;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* ====================== 
    ROW EXPANSION 
    ====================== */ 

.task-row { cursor: pointer; } 

/* ====================== 
    TASK COLUMN FIX 
    ====================== */ 

.task-title-cell { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    padding: 12px 16px; 
    font-weight: 600; 
    color: var(--text-main); 
} 

.title-row-container { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%; 
} 

.title-and-badge-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex: 1; 
    min-width: 0; /* Allows ellipsis to work */ 
} 

.task-title-text { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: block; 
    width: 100%; 
} 

.timer-display { 
    font-family: monospace; 
    font-weight: 700; 
    color: var(--primary); 
    font-size: 12px; 
    background: #eef2ff; 
    padding: 4px 8px; 
    border-radius: 4px; 
    display: inline-block; 
    width: fit-content; 
} 

/* Placeholder Views */
.placeholder-view {
    display: none;
    text-align: center;
    padding: 32px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    width: 100%;
    border: 1px solid var(--border-color);
}

.placeholder-view h2 {
    font-size: 24px;
    color: var(--text-muted);
}


/* Header & Filters */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.header-left { display: flex; align-items: center; gap: 24px; }
.header-title { 
    font-size: 26px; 
    font-weight: 800; 
    color: var(--text-main); 
    letter-spacing: -0.02em;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.global-top-actions {
    display: flex;
    justify-content: flex-end;
    position: relative;
    margin-bottom: 16px;
}

.notification-bell {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-icon {
    font-size: 18px;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
    display: none;
    z-index: 1500;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 700;
}

.notification-clear-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.notification-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    width: 100%;
    border: none;
    background: var(--white);
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.notification-item.unread {
    background: #eff6ff;
}

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

.notification-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.notification-item-message {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.5;
}

.notification-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.notification-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.filter-select { 
    padding: 10px 16px; 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    background: var(--white); 
    font-size: 14px; 
    color: var(--text-main);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-select:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Compact Date Filter Wrap */
#taskCustomMonthWrap, #reportCustomMonthWrap {
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

#taskApplyCustom, #reportApplyCustom {
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 8px;
}

/* Add Task Button Styling */
.add-task-trigger {
    padding: 8px 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.add-task-trigger:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Add Task Form (Inline) */
.add-task-form-container {
    display: none;
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}
.add-task-form { display: flex; flex-direction: column; gap: 12px; }
.add-task-form-row { display: flex; gap: 12px; }
.add-task-form input, .add-task-form textarea { 
    width: 100%; 
    padding: 10px 16px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    outline: none; 
    font-size: 14px;
    font-family: inherit;
}
.add-task-form textarea {
    resize: vertical;
    min-height: 80px;
}
.btn-save { 
    align-self: flex-end;
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 14px;
}

.task-description {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
}

/* Table & Row Card Styles */
.section-title { 
    font-size: 14px; 
    font-weight: 700; 
    color: var(--text-muted); 
    margin: 40px 0 16px 0; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
}

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-high { background-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1); }
.dot-medium { background-color: var(--warning); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }
.dot-low { background-color: var(--success); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); }
.dot-hold { background-color: var(--warning); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }
.dot-cancelled { background-color: var(--text-muted); box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.1); }

/* Modern Pastel Badges */
.badge { 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 12px; 
    font-weight: 600; 
    white-space: nowrap; 
}
.status-not-started { background: #f3f4f6; color: #374151; }
.status-in-progress { background: #e0e7ff; color: #4338ca; }
.status-hold { background: #fef3c7; color: #92400e; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-completed { background: #d1fae5; color: #065f46; }

.priority-tag-low { background: #ecfdf5; color: #047857; }
.priority-tag-medium { background: #fffbeb; color: #b45309; }
.priority-tag-high { background: #fef2f2; color: #b91c1c; }
.priority-tag-critical { background: #450a0a; color: #fecaca; }

/* Progress Bar */
.progress-container { display: flex; align-items: center; gap: 12px; width: 140px; }
.progress-bar-bg { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; }
.progress-text { font-size: 12px; color: var(--text-muted); font-weight: 700; min-width: 35px; }

/* Modern Action Buttons & Dropdown */
.actions-cell { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; 
    position: relative;
}

.dropdown-container {
    position: relative;
}

.btn-dots {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-dots:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

.btn-dots svg {
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-dots:hover svg {
    color: var(--text-main);
}

.action-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    z-index: 1001;
    min-width: 160px;
    padding: 6px 0;
    display: none; /* Hidden by default */
    margin-top: 4px;
}

.action-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.danger {
    color: var(--danger);
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 10px;
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}

.btn-action {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
}

th:last-child, td:last-child { text-align: right; padding-right: 24px; }
th:first-child, td:first-child { 
    width: auto; 
    max-width: 400px; 
    white-space: normal;
    word-break: break-word;
}
.project-cell { width: auto; min-width: 120px; }
.time-log-cell { width: auto; min-width: 100px; }
.badge-cell { width: auto; min-width: 100px; }
.actions-cell { width: auto; min-width: 60px; }

.btn-action:hover { background: #f9fafb; border-color: #d1d5db; color: var(--text-main); }
.btn-action.primary { color: var(--primary); border-color: #c7d2fe; background: #f5f3ff; }
.btn-action.primary:hover { background: #e0e7ff; }
.btn-action.success { color: var(--success); border-color: #a7f3d0; background: #ecfdf5; }
.btn-action.success:hover { background: #d1fae5; }
.btn-action.danger { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.btn-action.danger:hover { background: #fee2e2; }

/* Time Log Column Styling */
.time-log-cell {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 500;
}
.time-log-start { color: var(--text-main); font-weight: 600; }
.time-log-end { color: var(--text-muted); }
.time-log-hours { color: var(--primary); font-weight: 700; margin-top: 2px; }

.section-separator {
    height: 1px;
    background: var(--border-color);
    margin: 40px 0;
}

/* Completed Date Filter Overhaul Styles */
.completed-filter-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.filter-date-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    color: var(--text-main);
    font-family: inherit;
    background: var(--white);
}

.btn-filter-clear {
    padding: 6px 16px;
    background: var(--white);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-clear:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

/* Analytics Module Styles */
.analytics-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

#analyticsOverviewGrid {
    grid-template-columns: repeat(5, 1fr);
}

#projectStatusGrid {
    grid-template-columns: repeat(3, 1fr);
}

.overview-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0; /* Allow cards to shrink */
}

.overview-card-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-card-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

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

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.insight-item:hover {
    border-color: var(--primary);
}

.insight-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.insight-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.analytics-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.analytics-project-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--row-shadow);
}

.analytics-project-header {
    margin-bottom: 20px;
}

.analytics-project-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.analytics-project-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--row-shadow);
}

.timeline-time {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
    font-size: 12px;
    min-width: 100px;
}

.timeline-content {
    flex: 1;
}

.timeline-task-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.timeline-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* Project Performance Table Styles */
.analytics-table-container {
    max-height: 600px;
    overflow-y: auto;
}

#analyticsProjectsTable th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

#analyticsProjectsTable th.sortable:after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.3;
}

#analyticsProjectsTable th.sortable.asc:after { content: '↑'; opacity: 1; }
#analyticsProjectsTable th.sortable.desc:after { content: '↓'; opacity: 1; }

#analyticsProjectsTable tbody tr {
    transition: background 0.2s;
    cursor: pointer;
}

#analyticsProjectsTable tbody tr:hover {
    background: #f8fafc !important;
}

#analyticsProjectsTable tbody tr:nth-child(even) {
    background: #fcfcfc;
}

/* Side Panel Styles */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
    backdrop-filter: blur(2px);
}

.side-panel {
    width: 100%;
    max-width: 650px;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.side-panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-panel-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.side-panel-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-stat-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.detail-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.assignment-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 54px;
}

.assignment-checklist-disabled {
    opacity: 0.8;
}

.assignment-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.assignment-empty-state {
    font-size: 13px;
    color: var(--text-muted);
}

.assignment-summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assignment-summary-item {
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.assignment-summary-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.assignment-summary-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Project Table Customizations */
#projectsTable td {
    padding: 12px 24px;
}

.project-row-item:hover td {
    background: #f8fafc;
}

/* Modal and Utility Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
    padding: 20px; /* Space for mobile */
}

.modal-card, .modal-content {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    max-height: 85vh; /* Slightly reduced for better breathing room */
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
    margin: auto; /* Center on mobile */
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Slightly reduced gap */
    overflow-y: auto; /* Scroll body if content exceeds height */
    flex-grow: 1;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

.modal-header, .modal-footer {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    justify-content: flex-end;
    gap: 12px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close-x {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close-x:hover {
    color: var(--danger);
}

/* Spinner for Loading States */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ====================== 
    RESPONSIVENESS
   ====================== */ 

@media (max-width: 1200px) {
    #analyticsOverviewGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar { width: 72px; }
    .sidebar .nav-label, .sidebar .sidebar-brand { display: none; }
    .main-wrapper { margin-left: 72px; padding: 24px; }
    .sidebar.collapsed { width: 0; transform: translateX(-100%); }
    .sidebar.collapsed + .main-wrapper { margin-left: 0; }
    
    #analyticsOverviewGrid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #projectStatusGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .header-right { width: 100%; justify-content: space-between; }
    .header-left { flex-direction: column; align-items: flex-start; gap: 16px; }
    .analytics-overview-grid, #analyticsOverviewGrid, #projectStatusGrid { grid-template-columns: 1fr; }
    .detail-stats-grid { grid-template-columns: 1fr; }
    .side-panel { max-width: 100%; }
    .add-task-form-row { flex-direction: column; }
    
    /* Better table handling for mobile */
    .table-container {
        margin-left: -24px;
        margin-right: -24px;
        width: calc(100% + 48px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .main-wrapper {
        padding: 16px;
    }
}

/* ====================== 
    FINAL POLISH
   ====================== */ 

.section-title { 
    font-size: 12px; 
    font-weight: 700; 
    color: var(--text-muted); 
    margin: 40px 0 16px 0; 
    text-transform: uppercase; 
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.btn-save { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-save:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn-save:active {
    transform: translateY(0);
}

/* Smart Lunch Break Workflow Styles */
.resume-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 16px;
    display: none; /* Hidden by default */
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
    border-left: 4px solid var(--primary);
}

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

.resume-popup-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.resume-popup-icon {
    font-size: 24px;
    background: #eff6ff;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.resume-popup-text {
    flex: 1;
}

.resume-popup-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.resume-popup-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

#btnResumeLunchTasks {
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

#lunchBreakModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
