/* ==========================================================================
   DESIGN TOKENS & VARIABLES
   ========================================================================== */
   :root[data-theme="light"], :root {
    /* Color Palette - Premium & Vibrant */
    --primary: #4F46E5;      /* Indigo 600 */
    --primary-light: #EEF2FF;/* Indigo 50 */
    --primary-dark: #3730A3; /* Indigo 800 */
    
    --success: #10B981;      /* Emerald 500 */
    --warning: #F59E0B;      /* Amber 500 */
    --danger: #EF4444;       /* Red 500 */
    
    /* Neutral / Text colors */
    --text-main: #111827;    /* Gray 900 */
    --text-muted: #6B7280;   /* Gray 500 */
    --text-light: #9CA3AF;   /* Gray 400 */
    
    /* Backgrounds */
    --bg-main: #F9FAFB;      /* App background */
    --bg-surface: #FFFFFF;   /* Cards, panels */
    --bg-hover: #F3F4F6;
    
    /* Borders */
    --border-light: #E5E7EB;
    --border-focus: #C7D2FE;
    
    /* Layout Dimensions */
    --sidebar-width: 260px;
    --task-pane-width: 600px;
    --topbar-height: 60px;
    
    /* Shadows - Soft and elevated */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-slide: -5px 0 25px rgba(0, 0, 0, 0.08);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

:root[data-theme="dark"] {
    /* Dark Theme Colors */
    --primary: #818CF8;      /* Indigo 400 */
    --primary-light: #312E81;/* Indigo 900 */
    --primary-dark: #A5B4FC; /* Indigo 300 */
    
    --success: #34D399;      /* Emerald 400 */
    --warning: #FBBF24;      /* Amber 400 */
    --danger: #F87171;       /* Red 400 */
    
    /* Neutral / Text colors */
    --text-main: #F9FAFB;    /* Gray 50 */
    --text-muted: #9CA3AF;   /* Gray 400 */
    --text-light: #6B7280;   /* Gray 500 */
    
    /* Backgrounds */
    --bg-main: #111827;      /* Gray 900 */
    --bg-surface: #1F2937;   /* Gray 800 */
    --bg-hover: #374151;     /* Gray 700 */
    
    /* Borders */
    --border-light: #374151;
    --border-focus: #6366F1;
    
    /* Variables kept the same */
    --sidebar-width: 260px;
    --task-pane-width: 600px;
    --topbar-height: 60px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-slide: -5px 0 25px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   GLOBAL RESETS & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.5;
    overflow: hidden; /* Prevent body scroll, manage scroll inside panes */
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 0.5rem; }

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.btn-create {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-create:hover { background-color: var(--primary-dark); transform: translateY(-1px); }

.btn-group {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    overflow: hidden;
}
.btn-group .btn-create {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}
.btn-group .btn-create:first-child {
    box-shadow: none;
}
.btn-group .btn-create:last-child {
    border-left: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem 8px;
}

.add-task-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    width: 220px;
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
}
.add-task-dropdown.open { display: block; }
.filter-popover.open { display: flex !important; }

/* Form Elements */
.add-task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.875rem;
}
.add-task-item:hover { background: var(--bg-hover); }
.add-task-item.disabled { color: var(--text-muted); pointer-events: none; }

.btn-destructive {
    background-color: var(--danger);
    color: white;
}

/* CONTENTEDITABLE PLACEHOLDERS */
[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-weight: normal;
    pointer-events: none;
    display: block;
}

.pane-main {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-complete {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    transition: var(--transition-fast);
    cursor: pointer;
}
.btn-complete:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}
.btn-complete.completed {
    background-color: #d1fae5; /* Very light green */
    color: #059669; /* emerald-600 */
    border-color: #a7f3d0;
}
.btn-complete.completed i {
    color: #059669;
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover { background-color: var(--bg-hover); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: var(--transition-fast);
}
.icon-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}
.icon-btn.small { width: 28px; height: 28px; font-size: 1rem; }

/* Status / Color Dots */
.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* User Avatar */
.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}
.user-avatar.small img { width: 24px; height: 24px; border: 1px solid white; }
.user-avatar.x-small { width: 16px; height: 16px; min-width: 16px; display: inline-flex; align-items: center; justify-content: center; }
.user-avatar.x-small img { width: 16px; height: 16px; border: none; }

/* Glassmorphism effects */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .glass-panel {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   LAYOUT GRID
   ========================================================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 1. Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 10;
}
.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    opacity: 0;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid transparent; /* Keeps alignment */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}
.logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.nav-item:hover {
    background-color: var(--bg-hover);
}
.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}
.nav-item i {
    font-size: 1.25rem;
    color: var(--text-muted);
}
.nav-item.active i {
    color: var(--primary);
}

.section-title {
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-add {
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.nav-section:hover .section-add {
    opacity: 1;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important for flex child truncation */
    position: relative;
}

/* 2. Top Bar */
.top-bar {
    height: var(--topbar-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 5;
}

:root[data-theme="dark"] .top-bar {
    background-color: rgba(31, 41, 55, 0.95);
    border-bottom: 1px solid var(--border-light);
}

.top-left, .top-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.global-search {
    position: relative;
    width: 300px;
}
.global-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.global-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-hover);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}
.global-search input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px var(--border-focus);
}

/* 3. View Header */
.view-header {
    background-color: var(--bg-surface);
    padding: 1.5rem 2rem 0;
    border-bottom: 1px solid var(--border-light);
}

.project-title-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.project-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.view-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: -1px; /* Overlap border */
}

.tab {
    padding: 0.75rem 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}
.tab:hover {
    color: var(--text-main);
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.view-actions {
    position: absolute;
    right: 2rem;
    bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

/* 4. Main Pane */
.pane-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1.5rem 2rem;
    position: relative;
    /* Custom scrollbar */
}
.pane-main::-webkit-scrollbar { width: 8px; height: 8px; }
.pane-main::-webkit-scrollbar-track { background: transparent; }
.pane-main::-webkit-scrollbar-thumb { background-color: var(--border-light); border-radius: 4px; }
.pane-main::-webkit-scrollbar-thumb:hover { background-color: var(--text-light); }

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: var(--text-muted);
    font-size: 1rem;
}

/* 5. Task Details Pane (Slide-in) */
.task-details-pane {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--task-pane-width);
    height: 100%;
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-slide);
    z-index: 20;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    visibility: hidden; /* Prevent focus when closed */
}

.task-details-pane.open {
    transform: translateX(0);
    visibility: visible;
}

#task-pane-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.pane-header {
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.btn-complete {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.btn-complete:hover { background: var(--bg-hover); color: var(--success); }

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.task-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    outline: none;
    padding: 0.25rem;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: var(--transition-fast);
}
.task-title:hover { border-color: var(--border-light); }
.task-title:focus { border-color: var(--primary); background: var(--bg-main); }

.custom-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.field-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 1rem;
}
.field-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.field-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.field-value:hover {
    background-color: var(--bg-hover);
}

.status-tag {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-block;
    width: fit-content;
}

.task-description { margin-bottom: 2rem; }
.desc-editor {
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: var(--transition-fast);
}
.desc-editor:hover { border-color: var(--border-light); }
.desc-editor:focus { outline: none; border-color: var(--primary); background: var(--bg-main); }
.desc-editor:empty:before {
    content: attr(placeholder);
    color: var(--text-light);
}

.subtasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-input-area {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.comment-input {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==========================================================================
   ANIMATIONS & UTILITIES
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ==========================================================================
   ASANA CLONE SPECIFIC STYLES
   ========================================================================== */

.square-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.top-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.top-center .global-search {
    width: 50% !important; /* Center focus */
}

/* Update logo icon to match Asana's Coral color */
.asana-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #F06A6A;
    letter-spacing: -0.05em;
}

/* Widgets Base Shape */
.widget-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CALENDAR VIEW STYLES
   ========================================================================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    background-color: var(--bg-surface);
}

.calendar-header-cell {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
}

.calendar-cell {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.calendar-cell:hover {
    background-color: var(--bg-hover);
}

.calendar-date {
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.calendar-task-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-task-pill:hover {
    border-color: var(--border-focus);
}

/* ==========================================================================
   TEMPLATE LIBRARY (PROJECT CREATION) STYLES
   ========================================================================== */
.template-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.template-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.template-library-container {
    background-color: var(--bg-main);
    width: 90vw;
    max-width: 1000px;
    height: 85vh;
    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;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.template-modal-overlay.open .template-library-container {
    transform: translateY(0);
}

.template-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.template-card {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-surface);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.template-card-img {
    height: 140px;
    background-color: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
}

.template-card-content {
    padding: 1.5rem;
    flex: 1;
}

/* ==========================================================================
   BROWSE PROJECTS STYLES
   ========================================================================== */
.browse-projects-container {
    padding: 2rem 3rem;
    max-width: 1200px;
}

.browse-search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.browse-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.browse-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.browse-filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.browse-filter-btn:hover {
    background-color: var(--bg-hover);
}

.browse-table-header {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.browse-table-row {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.browse-table-row:hover {
    background-color: var(--bg-hover);
}

.project-icon-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
   .dashboard-container {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-surface);
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.dashboard-card-title {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 500;
}

.dashboard-card-value {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 1rem;
}

.dashboard-card-footer {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dashboard-chart-box {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    min-height: 380px;
}

.dashboard-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-top: 1rem;
}

.donut-chart {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: conic-gradient(
        #d1fae5 0deg 45deg,
        #a7f3d0 45deg 105deg,
        #6ee7b7 105deg 165deg,
        #34d399 165deg 260deg,
        #5b8e7d 260deg 360deg
    );
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Donut hole */
.donut-chart::before {
    content: '';
    position: absolute;
    width: 65%;
    height: 65%;
    background: white;
    border-radius: 50%;
}

.donut-value {
    position: absolute;
    font-size: 2.5rem;
    font-weight: 400;
    color: #111827;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* Lollipop Bar Chart */
.lollipop-chart-container {
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 1rem;
    position: relative;
    margin-top: 2rem;
    border-bottom: 1px solid transparent;
}

.lollipop-y-axis {
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.lollipop-y-label { position: absolute; left: -25px; bottom: 50%; transform: rotate(-90deg) translateY(-20px); font-size: 0.75rem; color: var(--text-muted); }

.lollipop-grid-lines {
    position: absolute;
    left: 20px;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 0;
}

.lollipop-grid-line {
    border-bottom: 1px solid var(--border-light);
    width: 100%;
}

.lollipop-bar {
    width: 6px;
    background: #E0E7FF;
    border-radius: 3px 3px 0 0;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.lollipop-dot {
    position: absolute;
    top: -6px;
    width: 16px;
    height: 16px;
    background: #8B5CF6;
    border-radius: 50%;
}

.lollipop-x-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
    padding-left: 20px;
}

.lollipop-x-label {
    font-size: 0.75rem;
    color: var(--text-main);
    transform: rotate(-45deg);
    transform-origin: top left;
    width: 60px;
    text-align: right;
    white-space: nowrap;
}

/* ==========================================================================
   WORKLOAD STYLES
   ========================================================================== */
.workload-header-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}

.workload-header-cell {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-right: 1px solid var(--border-light);
    text-align: center;
    line-height: 1.2;
}

.workload-user-col {
    width: 220px;
    min-width: 220px;
    text-align: left;
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

.workload-date-col {
    flex: 1;
    min-width: 60px;
}

.workload-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s;
}
.workload-row:hover {
    background-color: var(--bg-hover);
}

.workload-cell {
    flex: 1;
    min-width: 60px;
    border-right: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
}

.capacity-pill {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.capacity-pill:hover {
    transform: scale(1.1);
}

.capacity-ok {
    background-color: #d1fae5;
    color: #059669;
}

.capacity-overload {
    background-color: #fee2e2;
    color: #dc2626;
}

.capacity-empty {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
}

/* ==========================================================================
   TIMELINE STYLES
   ========================================================================== */
.timeline-container {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.timeline-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.timeline-left-pane {
    width: 250px;
    min-width: 250px;
    border-right: 1px solid var(--border-light);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.02);
    z-index: 10;
}

.timeline-left-section-header {
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.timeline-left-section-row {
    height: 80px;
    border-bottom: 1px solid var(--border-light);
}

.timeline-grid-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
}

.timeline-header-grid {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 5;
}

.timeline-header-cell {
    min-width: 50px;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-right: 1px solid #f3f4f6;
}

.timeline-body-grid {
    display: flex;
    flex: 1;
    position: relative;
}

.timeline-col {
    min-width: 50px;
    border-right: 1px solid #f3f4f6;
    height: 100%;
}

.timeline-horizontal-row {
    height: 80px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    width: 100%;
}

.timeline-task-bar {
    position: absolute;
    height: 32px;
    top: 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s, box-shadow 0.1s;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.timeline-task-bar:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.timeline-task-bar.bar-green { background-color: #A7F3D0; }
.timeline-task-bar.bar-red { background-color: #FECACA; }
.timeline-task-bar.bar-blue { background-color: #BFDBFE; }
.timeline-task-bar.bar-yellow { background-color: #FDE047; }
.timeline-task-bar.bar-purple { background-color: #E9D5FF; }

/* ==========================================================================
   DATE PICKER POPOVER
   ========================================================================== */
.date-picker-popover {
    position: absolute;
    top: 30px;
    left: 140px;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 320px;
    z-index: 100;
    display: none;
    flex-direction: column;
}

.date-picker-popover.open {
    display: flex;
}

.dp-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.dp-input-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.875rem;
    cursor: text;
    border: 1px solid transparent;
}

.dp-input-box.active {
    border: 2px solid #2563EB;
}

.dp-calendar {
    padding: 1rem;
}

.dp-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    margin-bottom: 1rem;
}

.dp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 8px;
    text-align: center;
}

.dp-day-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.dp-day-cell {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-main);
}
.dp-day-cell:hover {
    background: var(--bg-hover);
}
.dp-day-cell.muted {
    color: var(--text-muted);
}
.dp-day-cell.selected {
    border: 1px solid #2563EB;
    font-weight: 600;
    color: #2563EB;
}

.dp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
}

