    /* CSS VARIABLES - NAVY BLUE THEME (DARK) */
    :root {
        --bg-primary: #0a192f;
        --bg-secondary: #112240;
        --bg-card: #172a45;
        --text-primary: #ccd6f6;
        --text-secondary: #8892b0;
        --accent-color: #64ffda;
        --accent-hover: #45b298;
        --danger: #ff6b6b;
        --warning: #ffd166;
        --success: #06d6a0;
        --card-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
        --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        --border-radius: 8px;
        --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
    }

    /* LIGHT THEME - Premium Upgraded */
    body.light-theme {
        --bg-primary: #fbfdff;        
        --bg-secondary: #f1f5f9;      
        --bg-card: #ffffff;           
        --text-primary: #0f172a;      
        --text-secondary: #64748b;    
        --accent-color: #0ea5e9;      
        --accent-hover: #0284c7;      
        --danger: #ef4444;            
        --warning: #f59e0b;           
        --success: #10b981;           
        --card-shadow: 0 4px 20px rgba(15, 23, 42, 0.05); 
        --border-color: #e2e8f0;      
        --hover-bg: rgba(14, 165, 233, 0.1); 
    }

    .btn-theme-toggle {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid var(--accent-color);
        background: transparent;
        color: var(--accent-color);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        transition: var(--transition);
    }

    .btn-theme-toggle:hover {
        background: rgba(100, 255, 218, 0.1);
        transform: rotate(180deg);
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        font-family: var(--font-main);
        line-height: 1.6;
        height: 100vh;
        overflow: hidden;
    }

    /* LOGIN SCREEN */
    #login-screen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }

    #login-screen.hidden {
        display: none;
    }

    .login-box {
        background: var(--bg-secondary);
        padding: 40px;
        border-radius: 12px;
        width: 100%;
        max-width: 380px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    }

    .login-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 22px;
        color: var(--accent-color);
        font-weight: bold;
        margin-bottom: 20px;
        justify-content: center;
    }

    .login-box h2 {
        color: var(--text-primary);
        margin-bottom: 25px;
        text-align: center;
        font-size: 18px;
        font-weight: 500;
    }

    .auth-tabs {
        display: flex;
        margin-bottom: 20px;
        border-bottom: 2px solid rgba(136, 146, 176, 0.2);
    }

    .auth-tab {
        flex: 1;
        padding: 10px 15px;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
    }

    .auth-tab:hover {
        color: var(--accent-color);
    }

    .auth-tab.active {
        color: var(--accent-color);
        border-bottom-color: var(--accent-color);
    }

    .password-wrapper {
        position: relative;
    }

    .password-wrapper .form-input {
        padding-right: 40px;
    }

    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 14px;
        transition: var(--transition);
    }

    .password-toggle:hover {
        color: var(--accent-color);
    }

    .login-btn {
        width: 100%;
        padding: 12px;
        margin-top: 10px;
        font-size: 15px;
    }

    .login-error {
        color: var(--danger);
        font-size: 13px;
        padding: 8px 12px;
        background: rgba(255, 107, 107, 0.1);
        border-radius: 4px;
        margin-top: 10px;
        text-align: center;
    }

    .login-success {
        color: var(--success);
        font-size: 13px;
        padding: 8px 12px;
        background: rgba(6, 214, 160, 0.1);
        border-radius: 4px;
        margin-top: 10px;
        text-align: center;
    }

    .password-input-wrapper {
        position: relative;
    }

    .password-input-wrapper .form-input {
        padding-right: 40px;
    }

    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 14px;
        transition: var(--transition);
    }

    .password-toggle:hover {
        color: var(--accent-color);
    }

    /* UTILITIES */
    .flex {
        display: flex;
    }

    .flex-col {
        flex-direction: column;
    }

    .items-center {
        align-items: center;
    }

    .justify-between {
        justify-content: space-between;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    .gap-4 {
        gap: 1rem;
    }

    .hidden {
        display: none !important;
    }

    .btn {
        cursor: pointer;
        padding: 8px 16px;
        border-radius: var(--border-radius);
        border: 1px solid var(--accent-color);
        color: var(--accent-color);
        background: transparent;
        font-size: 14px;
        transition: var(--transition);
    }

    .btn:hover {
        background: rgba(100, 255, 218, 0.1);
    }

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

    .btn-primary:hover {
        background: var(--accent-hover);
    }

    .btn-danger {
        border-color: var(--danger);
        color: var(--danger);
    }

    .btn-danger:hover {
        background: rgba(255, 107, 107, 0.1);
    }

    .btn-icon {
        border: none;
        padding: 8px;
        color: var(--text-secondary);
        background: transparent;
        cursor: pointer;
    }

    .btn-icon:hover {
        color: var(--accent-color);
    }

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

    /* SIDEBAR COMPACT (ICON-ABOVE-TEXT) */
    #sidebar {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
        background-color: var(--bg-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px 4px;
        border-right: 1px solid rgba(136, 146, 176, 0.12);
        overflow-y: auto;
        overflow-x: hidden;
        user-select: none;
        flex-shrink: 0;
        z-index: 100;
        transition: width 0.2s ease;
    }

    #sidebar::-webkit-scrollbar {
        width: 2px;
    }

    .logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 20px;
        text-decoration: none;
        gap: 6px;
    }

    .logo-icon-box {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: linear-gradient(135deg, #0d9488, #059669);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 20px;
        box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
        overflow: hidden;
    }

    .logo-icon-box img {
        width: 28px;
        height: 28px;
        object-fit: contain;
        display: block;
        transition: transform 0.2s ease;
    }

    .logo:hover .logo-icon-box img {
        transform: scale(1.08);
    }

    .logo-title {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.2;
        text-align: center;
    }

    .nav-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 2px;
        color: var(--text-secondary);
        cursor: pointer;
        border-radius: 8px;
        margin-bottom: 4px;
        transition: var(--transition);
        gap: 4px;
        box-sizing: border-box;
    }

    .nav-item i {
        font-size: 17px;
        transition: transform 0.2s;
    }

    .nav-item span {
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1.1;
        white-space: nowrap;
    }

    .nav-item:hover {
        background: rgba(100, 255, 218, 0.08);
        color: var(--accent-color);
    }

    .nav-item.active {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
        border-left: 3px solid #10b981;
    }

    body.light-theme .nav-item.active {
        background: rgba(16, 185, 129, 0.12);
        color: #059669;
        border-left: 3px solid #059669;
    }

    .nav-divider {
        width: 80%;
        height: 1px;
        background: rgba(136, 146, 176, 0.15);
        margin: 10px auto;
    }

    /* Sidebar bottom user & actions */
    .sidebar-user-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 12px;
        gap: 4px;
    }

    .sidebar-user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #0284c7;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 14px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    }

    .sidebar-user-role {
        font-size: 10px;
        color: var(--text-secondary);
        font-weight: 500;
        line-height: 1.2;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .sidebar-action-circle-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(136, 146, 176, 0.1);
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 13px;
        transition: var(--transition);
    }

    .sidebar-action-circle-btn:hover {
        background: rgba(100, 255, 218, 0.15);
        color: var(--accent-color);
        transform: scale(1.08);
    }

    .sidebar-action-circle-btn.btn-logout {
        color: var(--danger);
        background: rgba(239, 68, 68, 0.1);
    }

    .sidebar-action-circle-btn.btn-logout:hover {
        background: rgba(239, 68, 68, 0.25);
        transform: scale(1.08);
    }

    /* MAIN CONTENT */
    #main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
        background-color: var(--bg-primary);
        transition: all 0.3s ease;
    }

    /* TOP BAR */
    #top-bar {
        height: 70px;
        min-height: 70px;
        flex-shrink: 0;
        padding: 0 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--bg-primary);
        border-bottom: 1px solid rgba(136, 146, 176, 0.1);
    }

    .search-bar {
        background: var(--bg-card);
        border: none;
        padding: 10px 20px;
        border-radius: 20px;
        color: var(--text-primary);
        width: 300px;
    }

    .search-bar:focus {
        outline: 1px solid var(--accent-color);
    }

    /* VIEW CONTROLS */
    #view-controls {
        padding: 15px 30px;
        min-height: 60px;
        flex-shrink: 0;
        display: flex;
        gap: 15px;
        align-items: center;
        background-color: var(--bg-primary);
    }

    #filter-wrapper {
        display: flex;
        gap: 15px;
        align-items: center;
    }

    .filter-select {
        background: var(--bg-secondary);
        color: var(--text-secondary);
        border: 1px solid rgba(136, 146, 176, 0.2);
        padding: 6px 12px;
        border-radius: 4px;
    }

    /* KANBAN BOARD */
    #board-view {
        flex: 1;
        display: flex;
        overflow-x: hidden;
        overflow-y: hidden;
        padding: 20px 30px;
        gap: 20px;
    }

    .kanban-column {
        flex: 1 1 0;
        min-width: 0;
        background-color: var(--bg-secondary);
        border-radius: var(--border-radius);
        padding: 15px;
        display: flex;
        flex-direction: column;
        max-height: 100%;
        transition: all 0.3s ease;
    }

    .column-header {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .column-count {
        background: var(--bg-card);
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 12px;
    }

    .btn-quick-add {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        border: 1px solid var(--accent-color);
        background: transparent;
        color: var(--accent-color);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: var(--transition);
    }

    .btn-quick-add:hover {
        background: var(--accent-color);
        color: var(--bg-primary);
    }

    .task-list {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-right: 4px;
    }

    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-primary);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--bg-card);
        border-radius: 4px;
    }

    /* TASK CARD */
    .task-card {
        background-color: var(--bg-card);
        padding: 15px;
        border-radius: var(--border-radius);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        cursor: grab;
        transition: var(--transition);
        border-left: 3px solid transparent;
    }

    .task-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--card-shadow);
    }

    .priority-high,
    .priority-critical {
        border-left-color: var(--danger);
    }

    .priority-medium {
        border-left-color: var(--warning);
    }

    .priority-low {
        border-left-color: var(--success);
    }

    .task-id {
        font-size: 10px;
        color: var(--text-secondary);
        margin-bottom: 4px;
    }

    .task-title {
        font-size: 15px;
        font-weight: 500;
        margin-bottom: 8px;
        color: var(--text-primary);
    }

    .task-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
    }

    .task-tags {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }

    .tag {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(100, 255, 218, 0.1);
        color: var(--accent-color);
    }

    /* Frequency Badge */
    .freq-badge {
        font-size: 9px;
        padding: 2px 6px;
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-weight: 600;
    }

    .freq-badge i {
        font-size: 8px;
    }

    .freq-daily {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
    }

    .freq-monthly {
        background: rgba(168, 85, 247, 0.15);
        color: #c084fc;
        border: 1px solid rgba(168, 85, 247, 0.3);
    }

    .light-theme .freq-daily {
        background: rgba(59, 130, 246, 0.1);
        color: #2563eb;
        border-color: rgba(59, 130, 246, 0.3);
    }

    .light-theme .freq-monthly {
        background: rgba(168, 85, 247, 0.1);
        color: #7c3aed;
        border-color: rgba(168, 85, 247, 0.3);
    }

    /* Category Badge in Kanban Card */
    .task-category-badge {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        max-width: 95px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 10px;
        font-weight: 500;
        color: #38bdf8;
        background: rgba(56, 189, 248, 0.1);
        border: 1px solid rgba(56, 189, 248, 0.25);
        padding: 1px 6px;
        border-radius: 4px;
        line-height: 1.3;
        flex-shrink: 1;
    }

    .task-category-badge i {
        font-size: 8.5px;
        flex-shrink: 0;
        opacity: 0.85;
    }

    .light-theme .task-category-badge {
        color: #0284c7;
        background: rgba(2, 132, 199, 0.08);
        border-color: rgba(2, 132, 199, 0.25);
    }

    .subtask-progress {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        color: var(--text-secondary);
        font-size: 11px;
    }

    .subtask-progress.all-done {
        color: var(--success);
    }

    .subtask-progress i {
        font-size: 10px;
    }

    /* Priority Badge */
    .priority-badge {
        font-size: 10px;
        font-weight: 500;
    }

    .priority-badge-critical {
        color: #ff6b6b;
    }

    .priority-badge-high {
        color: #ff9f43;
    }

    .priority-badge-medium {
        color: #ffd166;
    }

    .priority-badge-low {
        color: #06d6a0;
    }

    /* Light theme - darker colors */
    .light-theme .priority-badge-critical {
        color: #dc3545;
    }

    .light-theme .priority-badge-high {
        color: #e67e22;
    }

    .light-theme .priority-badge-medium {
        color: #d4a200;
    }

    .light-theme .priority-badge-low {
        color: #059669;
    }

    .user-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        color: #333;
        font-weight: bold;
    }

    .avatars-group {
        display: flex;
        flex-direction: row-reverse;
    }

    .avatars-group .user-avatar {
        margin-left: -8px;
        border: 2px solid var(--bg-card);
    }

    .avatars-group .user-avatar:last-child {
        margin-left: 0;
    }

    .avatar-more {
        background: var(--bg-secondary) !important;
        color: var(--text-secondary) !important;
        font-size: 9px;
    }

    /* LIST VIEW */
    #list-view {
        margin-top: 20px;
        padding: 0 30px 20px 30px;
        overflow-y: auto;
    }

    .list-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 20px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.2);
        padding-bottom: 10px;
    }

    .list-tab {
        background: transparent;
        border: 1px solid rgba(136, 146, 176, 0.3);
        color: var(--text-secondary);
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        transition: all 0.2s;
    }

    .list-tab:hover {
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .list-tab.active {
        background: var(--accent-color);
        color: var(--bg-primary);
        border-color: var(--accent-color);
        font-weight: 600;
    }

    .list-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 20px;
        padding: 15px 0;
    }

    .list-pagination button {
        background: var(--bg-card);
        border: 1px solid rgba(136, 146, 176, 0.3);
        color: var(--text-secondary);
        padding: 6px 12px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .list-pagination button:hover:not(:disabled) {
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .list-pagination button:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .list-pagination .page-info {
        color: var(--text-secondary);
        font-size: 13px;
    }

    .list-group {
        margin-bottom: 30px;
    }

    .list-group-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--bg-card);
        color: var(--accent-color);
        padding: 10px 15px;
        font-weight: bold;
        margin-top: 15px;
        border-radius: 4px;
        border-left: 3px solid var(--accent-color);
        margin-bottom: 5px;
    }

    .list-group-title {
        font-size: 18px;
        margin-bottom: 10px;
        padding-bottom: 5px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.2);
    }

    .list-row {
        display: grid;
        grid-template-columns: 80px 2.2fr 1.1fr 1fr 0.9fr 0.9fr 1.1fr 1.2fr 0.9fr 1fr 1fr;
        align-items: center;
        padding: 6px 10px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--bg-primary);
        transition: background 0.2s;
        font-size: 13px;
    }

    .list-row:hover {
        background: var(--bg-card);
    }

    #stats-table-container .list-row span,
    #stats-table-container .list-header span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #stats-table-container .list-row,
    #stats-table-container .list-header {
        min-width: 1180px;
        grid-template-columns: 80px 2fr 1.1fr 1fr 1.1fr 1.2fr 1.1fr 1.4fr 1.2fr 1fr 1fr;
        gap: 10px;
    }

    .list-header {
        font-weight: bold;
        color: var(--accent-color);
        padding: 10px;
        background: var(--bg-primary);
        position: sticky;
        top: 0;
    }

    /* DASHBOARD */
    #dashboard-view {
        padding: 30px;
        overflow-y: auto;
        height: 100%;
    }

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

    .stat-card {
        background: var(--bg-secondary);
        padding: 16px 20px;
        border-radius: var(--border-radius);
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }

    .stat-icon {
        font-size: 28px;
        color: var(--accent-color);
        opacity: 0.9;
    }

    .stat-content {
        display: flex;
        flex-direction: column;
    }

    .stat-number {
        font-size: 26px;
        font-weight: bold;
        color: var(--accent-color);
        line-height: 1;
    }

    .stat-label {
        color: var(--text-secondary);
        font-size: 12px;
        margin-top: 2px;
    }

    .charts-container {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    @media (max-width: 1200px) {
        .charts-container {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 768px) {
        .charts-container {
            grid-template-columns: 1fr;
        }
    }

    .chart-box {
        background: var(--bg-card);
        padding: 14px 16px;
        border-radius: var(--border-radius);
        border: 1px solid rgba(136, 146, 176, 0.12);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
        box-sizing: border-box;
        min-width: 0;
    }

    .chart-box canvas {
        width: 100% !important;
        height: 100% !important;
    }

    /* ANALYTICS VIEW */
    #analytics-view {
        padding: 24px 30px;
        height: 100%;
        overflow-y: auto;
    }

    .analytics-header {
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .analytics-title {
        color: var(--text-primary);
        font-size: 22px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .analytics-title i {
        color: var(--accent-color);
    }

    .analytics-subtitle {
        font-size: 13px;
        color: var(--text-secondary);
    }

    .analytics-status-tabs {
        justify-content: center !important;
        border-bottom: 1px solid rgba(136, 146, 176, 0.15);
        padding-bottom: 14px;
        margin-bottom: 22px;
        flex-wrap: wrap;
        display: flex;
        gap: 8px;
    }

    .analytics-charts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 14px;
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .analytics-charts-grid .analytics-card {
        min-width: 0;
    }

    .analytics-card {
        background: var(--bg-card);
        border: 1px solid rgba(136, 146, 176, 0.12);
        border-radius: 12px;
        padding: 12px 16px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
        margin-bottom: 14px;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .analytics-card:hover {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    }

    .analytics-card.chart-card {
        margin-bottom: 0;
    }

    .analytics-card-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 7px;
        margin-bottom: 8px;
    }

    /* Compact Donut Container */
    .analytics-donut-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        height: 165px;
        padding: 2px 4px;
    }

    .analytics-donut-canvas-wrap {
        position: relative;
        width: 150px;
        height: 150px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .analytics-donut-canvas-wrap canvas {
        width: 100% !important;
        height: 100% !important;
    }

    .analytics-donut-center {
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        text-align: center;
    }

    .analytics-donut-center-val {
        font-size: 20px;
        font-weight: 800;
        color: var(--text-primary);
        line-height: 1;
    }

    .analytics-donut-center-lbl {
        font-size: 9px;
        color: var(--text-secondary);
        margin-top: 3px;
        font-weight: 500;
    }

    .analytics-donut-legend {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-width: 0;
    }

    .donut-legend-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 11.5px;
        padding: 2px 0;
    }

    .donut-legend-left {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
    }

    .donut-legend-color {
        width: 8.5px;
        height: 8.5px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .donut-legend-label {
        color: var(--text-secondary);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 11.5px;
    }

    .donut-legend-val {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 11.5px;
        white-space: nowrap;
        text-align: right;
        margin-left: auto;
    }

    .analytics-tables-grid-2col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .analytics-tables-grid-2col .analytics-card {
        margin-bottom: 0;
        min-width: 0;
    }

    .analytics-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 8px;
    }

    .analytics-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 480px;
        font-size: 11.5px;
    }

    .analytics-table th {
        background: rgba(136, 146, 176, 0.08);
        color: var(--text-secondary);
        font-weight: 600;
        text-align: left;
        padding: 5px 7px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.15);
        white-space: nowrap;
        font-size: 11.5px;
    }

    .analytics-table td {
        padding: 4.5px 7px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.07);
        color: var(--text-primary);
        vertical-align: middle;
        font-size: 11.5px;
    }

    .analytics-table tbody tr:hover {
        background: rgba(100, 255, 218, 0.03);
    }

    .analytics-table tbody tr.clickable-row {
        cursor: pointer;
    }

    .analytics-user-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .analytics-user-name {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 12px;
    }

    .analytics-user-sub {
        font-size: 10.5px;
        color: var(--text-secondary);
    }

    /* Progress bar in table */
    .analytics-progress-bar-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 85px;
    }

    .analytics-progress-track {
        flex: 1;
        height: 6px;
        border-radius: 3px;
        background: rgba(148, 163, 184, 0.18);
        overflow: hidden;
    }

    .analytics-progress-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg, #2563eb, #38bdf8);
        transition: width 0.4s ease;
    }

    .analytics-progress-fill.green {
        background: linear-gradient(90deg, #059669, #10b981);
    }

    .analytics-progress-fill.amber {
        background: linear-gradient(90deg, #d97706, #fbbf24);
    }

    .analytics-progress-fill.red {
        background: linear-gradient(90deg, #dc2626, #f87171);
    }

    .analytics-progress-text {
        font-weight: 700;
        font-size: 11.5px;
        min-width: 36px;
        text-align: right;
        color: var(--text-primary);
    }

    /* HISTORY TABLE */
    .history-table {
        width: 100%;
        border-collapse: collapse;
        background: var(--bg-secondary);
        border-radius: var(--border-radius);
        overflow: hidden;
    }

    .history-table th,
    .history-table td {
        padding: 6px 12px;
        text-align: left;
        border-bottom: 1px solid rgba(136, 146, 176, 0.1);
    }

    .history-table th {
        background: rgba(17, 34, 64, 0.8);
        color: var(--accent-color);
        font-weight: 600;
        font-size: 12px;
    }

    .history-table td {
        color: var(--text-primary);
        font-size: 13px;
    }

    .history-table tr:hover {
        background: rgba(100, 255, 218, 0.03);
    }

    .history-action-add {
        color: var(--success);
    }

    .history-action-edit {
        color: var(--warning);
    }

    .history-action-del {
        color: var(--danger);
    }

    .history-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 15px 0;
    }

    /* MODALS */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(10, 25, 47, 0.85);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        backdrop-filter: blur(5px);
    }

    .modal-content {
        background: var(--bg-secondary);
        width: 720px;
        max-width: 92%;
        max-height: 90vh;
        padding: 30px;
        border-radius: var(--border-radius);
        box-shadow: var(--card-shadow);
        overflow-y: auto;
        position: relative;
        border: 1px solid var(--text-secondary);
    }

    .close-btn {
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 24px;
        cursor: pointer;
        color: var(--text-secondary);
    }

    .form-group {
        margin-bottom: 20px;
    }

    .modal-header-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
    }

    .btn-icon-delete {
        background: transparent;
        border: none;
        color: var(--danger);
        font-size: 18px;
        cursor: pointer;
        padding: 8px;
        border-radius: 4px;
        transition: background 0.2s;
    }

    .btn-icon-delete:hover {
        background: rgba(255, 107, 107, 0.2);
    }

    .form-label {
        display: block;
        margin-bottom: 8px;
        color: var(--accent-color);
        font-size: 14px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        width: 100%;
        padding: 10px;
        background: var(--bg-primary);
        border: 1px solid rgba(136, 146, 176, 0.2);
        border-radius: 4px;
        color: var(--text-primary);
    }

    .form-input:disabled,
    .form-select:disabled,
    .form-textarea:disabled {
        opacity: 0.65 !important;
        cursor: not-allowed !important;
        background-color: rgba(255, 255, 255, 0.03) !important;
        border-color: rgba(136, 146, 176, 0.2) !important;
    }

    /* Lock icon for disabled / locked fields */
    .is-locked > .form-label::after,
    .form-group.is-locked .form-label::after {
        content: ' \f023';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 11px;
        color: #ff9800;
        margin-left: 6px;
        opacity: 0.9;
        display: inline-block;
    }

    .subtask-item.is-locked textarea {
        opacity: 0.75 !important;
        cursor: not-allowed !important;
        background: transparent !important;
    }

    .form-textarea {
        height: 100px;
        resize: vertical;
    }

    /* Subtasks Checklist */
    #subtasks-container {
        max-height: 250px;
        overflow-y: auto;
        margin-bottom: 10px;
    }

    .subtasks-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 8px 6px 8px;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .subtask-item {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 6px 8px;
        background: var(--bg-primary);
        border: 1px solid rgba(136, 146, 176, 0.2);
        border-radius: 6px;
        margin-bottom: 6px;
        transition: border-color 0.2s;
    }

    .subtask-item:hover {
        border-color: rgba(136, 146, 176, 0.4);
    }

    .subtask-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--accent-color);
        flex-shrink: 0;
        margin-top: 6px;
        cursor: pointer;
    }

    .subtask-item textarea {
        background: var(--bg-secondary);
        border: 1px solid rgba(136, 146, 176, 0.2);
        border-radius: 4px;
        color: var(--text-primary);
        font-size: 13px;
        outline: none;
        resize: vertical;
        min-height: 32px;
        padding: 6px 8px;
        font-family: inherit;
        line-height: 1.4;
        transition: border-color 0.2s;
        box-sizing: border-box;
    }

    .subtask-item textarea:focus {
        border-color: var(--accent-color);
    }

    .subtask-item textarea::placeholder {
        color: var(--text-secondary);
        opacity: 0.7;
    }

    .subtask-item.completed textarea.subtask-title-input {
        text-decoration: line-through;
        opacity: 0.6;
    }

    .subtask-item.completed textarea.subtask-note-input {
        opacity: 0.6;
    }

    .subtask-item .btn-remove-subtask {
        background: transparent;
        border: none;
        color: var(--danger);
        cursor: pointer;
        padding: 6px 4px;
        opacity: 0.5;
        transition: opacity 0.2s;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .subtask-item:hover .btn-remove-subtask {
        opacity: 1;
    }

    .btn-add-subtask {
        background: transparent;
        border: 1px dashed rgba(136, 146, 176, 0.3);
        color: var(--text-secondary);
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        width: 100%;
        transition: all 0.2s;
    }

    .btn-add-subtask:hover {
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .subtask-note {
        padding: 10px;
        background: var(--bg-primary);
        border: 1px solid rgba(136, 146, 176, 0.2);
        border-radius: 4px;
        color: var(--text-primary);
        font-size: 14px;
        width: 100%;
        min-height: 60px;
        resize: vertical;
    }

    .confirm-popup {
        background: var(--bg-card);
        padding: 30px;
        border-radius: var(--border-radius);
        text-align: center;
        max-width: 400px;
        box-shadow: var(--card-shadow);
        border: 1px solid var(--accent-color);
    }

    .confirm-actions {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 25px;
    }

    /* LOADER */
    #loading-screen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-primary);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2000;
    }

    .loader {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(100, 255, 218, 0.3);
        border-radius: 50%;
        border-top-color: var(--accent-color);
        animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }


    @media (max-width: 1024px) {
        .analytics-tables-grid-2col {
            grid-template-columns: 1fr !important;
            gap: 16px !important;
        }
    }

    /* --- MOBILE RESPONSIVE ENHANCEMENTS --- */
    @media (max-width: 768px) {

        /* Main Layout */
        #app-container {
            flex-direction: column;
        }

        /* Bottom Navigation Bar */
        #sidebar {
            width: 100vw !important;
            max-width: 100vw !important;
            min-width: 100vw !important;
            height: 56px !important;
            flex-direction: row !important;
            justify-content: space-around !important;
            align-items: center !important;
            gap: 0 !important;
            padding: 0 4px !important;
            margin: 0 !important;
            position: fixed !important;
            bottom: 0 !important;
            left: 0 !important;
            right: 0 !important;
            z-index: 9999 !important;
            border-right: none !important;
            border-top: 1px solid rgba(136, 146, 176, 0.15) !important;
            background: var(--bg-secondary) !important;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
            box-sizing: border-box !important;
            scrollbar-width: none !important;
            -webkit-overflow-scrolling: touch !important;
        }

        #sidebar::-webkit-scrollbar {
            display: none !important;
        }

        /* Hide non-nav elements inside bottom bar */
        #sidebar .logo,
        #sidebar .nav-divider,
        #sidebar .sidebar-user-section,
        #sidebar .sidebar-actions,
        #sidebar>div[style*="flex:1"] {
            display: none !important;
        }

        /* Navigation items on Mobile */
        /* Navigation items on Mobile */
        #sidebar .nav-item {
            width: auto !important;
            margin: 0 !important;
            border-radius: 20px !important;
            border-left: none !important;
            border-top: none !important;
            transition: none !important;
            flex-shrink: 0 !important;
            -webkit-tap-highlight-color: transparent !important;
            outline: none !important;
            box-shadow: none !important;
        }

        /* Inactive Tab: ONLY ICON (Centered, No Hover Shadow) */
        #sidebar .nav-item:not(.active) {
            width: 40px !important;
            height: 40px !important;
            padding: 0 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            flex: 0 0 auto !important;
            background: transparent !important;
            color: var(--text-secondary) !important;
            border: none !important;
            box-shadow: none !important;
        }

        #sidebar .nav-item:not(.active):hover,
        #sidebar .nav-item:not(.active):focus,
        #sidebar .nav-item:not(.active):active {
            background: transparent !important;
            color: var(--text-secondary) !important;
            box-shadow: none !important;
            outline: none !important;
        }

        #sidebar .nav-item:not(.active) span {
            display: none !important;
        }

        #sidebar .nav-item:not(.active) i {
            font-size: 18px !important;
            margin: 0 !important;
            opacity: 0.75 !important;
            text-align: center !important;
        }

        /* Active Tab: ICON + TEXT PILL (Centered, Clean Flat Style without Blur/Glow) */
        #sidebar .nav-item.active {
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 5px !important;
            padding: 6px 12px !important;
            background: rgba(16, 185, 129, 0.2) !important;
            color: #10b981 !important;
            border-radius: 20px !important;
            border: none !important;
            flex: 0 0 auto !important;
            box-shadow: none !important;
        }

        #sidebar .nav-item.active:hover,
        #sidebar .nav-item.active:focus,
        #sidebar .nav-item.active:active {
            box-shadow: none !important;
            outline: none !important;
        }

        #sidebar .nav-item.active i {
            font-size: 15px !important;
            margin: 0 !important;
            opacity: 1 !important;
        }

        #sidebar .nav-item.active span {
            display: inline-block !important;
            font-size: 11px !important;
            font-weight: 600 !important;
            white-space: nowrap !important;
            line-height: 1 !important;
        }

        /* Unified Status Tabs on Mobile (Identical style across Danh sách, Lịch trình, Gantt) */
        .list-tabs,
        .calendar-status-tabs,
        .gantt-status-tabs {
            display: flex !important;
            overflow-x: auto !important;
            flex-wrap: nowrap !important;
            justify-content: flex-start !important;
            align-items: center !important;
            gap: 6px !important;
            padding: 2px 2px 6px 2px !important;
            margin: 0 0 10px 0 !important;
            width: 100% !important;
            scrollbar-width: none !important;
            -webkit-overflow-scrolling: touch !important;
        }

        .list-tabs::-webkit-scrollbar,
        .calendar-status-tabs::-webkit-scrollbar,
        .gantt-status-tabs::-webkit-scrollbar {
            display: none !important;
        }

        .list-tab {
            flex: 0 0 auto !important;
            flex-shrink: 0 !important;
            padding: 5px 11px !important;
            font-size: 11.5px !important;
            font-weight: 500 !important;
            white-space: nowrap !important;
            border-radius: 6px !important;
            height: 30px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            background: var(--bg-card) !important;
            border: 1px solid rgba(136, 146, 176, 0.2) !important;
            color: var(--text-secondary) !important;
            -webkit-tap-highlight-color: transparent !important;
            box-shadow: none !important;
            outline: none !important;
        }

        .list-tab:not(.active):hover,
        .list-tab:not(.active):focus,
        .list-tab:not(.active):active {
            background: var(--bg-card) !important;
            border-color: rgba(136, 146, 176, 0.3) !important;
            color: var(--text-secondary) !important;
            box-shadow: none !important;
        }

        .list-tab.active {
            background: var(--accent-color) !important;
            color: var(--bg-primary) !important;
            border-color: var(--accent-color) !important;
            font-weight: 600 !important;
            box-shadow: none !important;
        }

        /* Content Adjustment for Bottom Nav (Minimal Bottom Gap) */
        #main-content {
            padding-bottom: 58px !important;
            overflow-y: auto !important;
        }

        /* Top Bar */
        #top-bar {
            height: auto;
            padding: 10px 12px;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 8px;
            background: var(--bg-primary);
            z-index: 10;
        }

        .search-bar {
            flex: 1;
            font-size: 14px;
            padding: 8px 12px;
            width: auto;
            min-width: 160px;
        }

        /* Move Add Button to Floating Action Button (FAB) */
        #btn-add-task {
            position: fixed !important;
            bottom: 64px !important;
            right: 14px !important;
            width: 48px !important;
            height: 48px !important;
            border-radius: 50% !important;
            background: var(--accent-color) !important;
            color: var(--bg-primary) !important;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            font-size: 0 !important;
            z-index: 1000 !important;
            border: none !important;
        }

        #btn-add-task i {
            font-size: 22px !important;
            margin: 0 !important;
        }

        /* Filters - Tightly packed with Bộ phận right next to Tháng này */
        #view-controls {
            padding: 8px 10px !important;
            min-height: auto !important;
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 6px !important;
            border-bottom: 1px solid rgba(136, 146, 176, 0.15) !important;
            background: var(--bg-primary) !important;
        }

        #filter-wrapper {
            width: 100% !important;
            display: flex !important;
            flex-wrap: wrap !important;
            justify-content: flex-start !important;
            align-items: center !important;
            gap: 6px !important;
            padding-bottom: 0 !important;
        }

        .date-filter-container {
            width: auto !important;
            flex: 1 1 calc(33.33% - 6px) !important;
            max-width: calc(50% - 3px) !important;
            display: flex !important;
            align-items: center !important;
            gap: 4px !important;
        }

        #date-range-picker {
            width: auto !important;
            flex: 0 0 auto !important;
            min-width: auto !important;
        }

        .filter-select {
            font-size: 11px !important;
            padding: 4px 6px !important;
            height: 30px !important;
            min-width: 0 !important;
            flex: 1 1 calc(33.33% - 6px) !important;
            max-width: calc(50% - 3px) !important;
            border-radius: 6px !important;
            background: var(--bg-secondary) !important;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }

        /* View Display Control on Mobile (Minimal bottom padding) */
        #board-view:not(.hidden) {
            display: flex !important;
            padding: 8px 8px 8px 8px !important;
            scroll-snap-type: x mandatory !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
            gap: 8px !important;
            -webkit-overflow-scrolling: touch !important;
        }

        .kanban-column {
            min-width: 230px !important;
            max-width: 245px !important;
            width: 68vw !important;
            flex: 0 0 68vw !important;
            scroll-snap-align: start !important;
            margin-right: 4px !important;
            padding: 10px 8px !important;
            border-radius: 10px !important;
            height: 100% !important;
        }

        .column-header {
            font-size: 13px !important;
            margin-bottom: 8px !important;
        }

        .task-list {
            gap: 6px !important;
            padding-right: 2px !important;
        }

        .task-card {
            padding: 8px 10px !important;
            border-radius: 8px !important;
            margin-bottom: 6px !important;
        }

        .task-id {
            font-size: 9px !important;
            margin-bottom: 2px !important;
        }

        .task-title {
            font-size: 12.5px !important;
            margin-bottom: 5px !important;
            line-height: 1.3 !important;
        }

        .task-tags {
            margin-bottom: 5px !important;
            gap: 3px !important;
        }

        .task-tags .tag {
            font-size: 9px !important;
            padding: 1px 5px !important;
        }

        .task-meta {
            font-size: 10px !important;
            margin-top: 3px !important;
        }

        .task-category-badge {
            max-width: 70px !important;
            font-size: 9px !important;
            padding: 1px 4px !important;
        }

        .deadline-date {
            font-size: 9.5px !important;
            padding: 1px 5px !important;
        }

        /* List View - Fixed Horizontal Scroll Table with Compact Title */
        #list-view:not(.hidden) {
            display: block !important;
            padding: 10px 8px 8px 8px !important;
            overflow-x: hidden !important;
        }

        #list-content {
            overflow-x: auto !important;
            -webkit-overflow-scrolling: touch !important;
            width: 100% !important;
            padding-bottom: 4px !important;
        }

        .list-header,
        .list-row {
            min-width: 870px !important;
            width: max-content !important;
            grid-template-columns: 55px 150px 85px 80px 70px 70px 75px 85px 70px 65px 65px !important;
            gap: 6px !important;
            padding: 7px 8px !important;
            font-size: 11px !important;
            align-items: center !important;
        }

        #stats-table-container .list-header,
        #stats-table-container .list-row {
            min-width: 1050px !important;
            grid-template-columns: 60px 150px 90px 85px 90px 95px 90px 110px 95px 75px 75px !important;
            gap: 8px !important;
        }

        .list-row span {
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .list-row span:nth-child(2) {
            font-size: 11.5px !important;
            font-weight: 500 !important;
            color: var(--text-primary) !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .list-row span:nth-child(1) {
            font-size: 10px !important;
            color: var(--text-secondary) !important;
        }

        /* Dashboard - 2 Cards per row on Mobile */
        #dashboard-view:not(.hidden) {
            display: block !important;
            padding: 12px 10px 8px 10px !important;
            overflow-y: auto !important;
        }

        .stats-grid {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 10px !important;
            margin-bottom: 16px !important;
        }

        .stat-card {
            padding: 12px 10px !important;
            gap: 10px !important;
            border-radius: 8px !important;
        }

        .stat-card .stat-icon {
            font-size: 22px !important;
        }

        .stat-card .stat-number {
            font-size: 18px !important;
        }

        .stat-card .stat-label {
            font-size: 10.5px !important;
        }

        .charts-container {
            grid-template-columns: 1fr !important;
            gap: 12px !important;
        }

        /* Analytics View Mobile */
        #analytics-view:not(.hidden) {
            display: block !important;
            padding: 10px 8px 8px 8px !important;
            overflow-y: auto !important;
        }

        .analytics-charts-grid {
            grid-template-columns: 1fr !important;
            gap: 12px !important;
            margin-bottom: 14px !important;
        }

        .analytics-tables-grid-2col {
            grid-template-columns: 1fr !important;
            gap: 12px !important;
            margin-bottom: 12px !important;
        }

        .analytics-card {
            padding: 14px 12px !important;
            margin-bottom: 12px !important;
            border-radius: 10px !important;
        }

        .analytics-chart-wrap {
            height: 200px !important;
        }

        .analytics-table {
            font-size: 11.5px !important;
            min-width: 580px !important;
        }

        .analytics-table th,
        .analytics-table td {
            padding: 7px 8px !important;
        }

        /* Calendar View Mobile */
        #calendar-view:not(.hidden) {
            display: block !important;
            padding: 10px 8px 8px 8px !important;
            overflow-y: auto !important;
        }

        .calendar-header-row {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 8px !important;
        }

        /* Gantt View Mobile */
        #gantt-view:not(.hidden) {
            display: flex !important;
            flex-direction: column !important;
            padding: 10px 8px 8px 8px !important;
        }

        .gantt-header-row {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 8px !important;
        }

        .gantt-time-nav {
            justify-content: space-between !important;
            width: 100% !important;
            gap: 4px !important;
            flex-wrap: nowrap !important;
        }

        .gantt-time-nav .btn {
            padding: 5px 8px !important;
            font-size: 11px !important;
        }

        .gantt-time-nav span {
            font-size: 11px !important;
        }

        #gantt-start-date {
            width: 118px !important;
            padding: 4px 6px !important;
            font-size: 11px !important;
        }

        .gantt-left-panel {
            width: 150px !important;
            min-width: 130px !important;
        }

        .gantt-col-author,
        .gantt-col-time {
            display: none !important;
        }

        .gantt-col-task {
            flex: 1 !important;
            width: 100% !important;
            min-width: 0 !important;
        }

        .gantt-left-header, .gantt-row-meta {
            padding: 0 6px !important;
            font-size: 10.5px !important;
        }

        .gantt-day-col-header {
            min-width: 22px !important;
            font-size: 9px !important;
        }

        .gantt-grid-cell {
            min-width: 22px !important;
        }

        .gantt-task-bar {
            height: 20px !important;
            top: 8px !important;
            font-size: 10px !important;
            padding: 0 4px !important;
        }

        /* Users View Mobile */
        /* Users View Mobile */
        #users-view:not(.hidden) {
            display: block !important;
            padding: 10px 8px 8px 8px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }

        #users-view h2 {
            font-size: 15px !important;
            margin-bottom: 0 !important;
        }

        #btn-add-user {
            font-size: 11px !important;
            padding: 5px 9px !important;
        }

        #users-table-container,
        .permissions-card-wrapper {
            overflow-x: auto !important;
            -webkit-overflow-scrolling: touch !important;
            width: 100% !important;
            margin-bottom: 15px !important;
            padding-bottom: 2px !important;
        }

        .users-table {
            font-size: 11px !important;
        }

        .users-table th,
        .users-table td {
            padding: 5px 8px !important;
            white-space: nowrap !important;
            font-size: 11px !important;
            line-height: 1.2 !important;
        }

        .users-table th {
            font-size: 10.5px !important;
            font-weight: 600 !important;
            white-space: nowrap !important;
        }

        .users-table td span,
        .users-table td small,
        .users-table .tag {
            white-space: nowrap !important;
            font-size: 10px !important;
        }

        /* History View Mobile */
        #history-view:not(.hidden) {
            display: block !important;
            padding: 10px 8px 8px 8px !important;
            overflow: auto !important;
        }

        #history-view h2 {
            font-size: 16px !important;
            margin-bottom: 10px !important;
        }

        .history-filters {
            gap: 8px !important;
            margin-bottom: 10px !important;
        }

        .history-filters .form-group {
            flex: 1 !important;
            min-width: 120px !important;
        }

        .history-filters .form-label {
            font-size: 10px !important;
        }

        .history-filters .form-input,
        .history-filters .form-select {
            font-size: 12px !important;
            padding: 0 10px !important;
            height: 38px !important;
        }

        #history-table-container {
            overflow: auto !important;
            max-height: calc(100vh - 300px) !important;
        }

        .history-table {
            min-width: 1000px !important;
            font-size: 10px !important;
        }

        .history-table th,
        .history-table td {
            padding: 2px 6px !important;
        }

        .history-table th {
            font-size: 9px !important;
        }

        /* Modal Mobile */
        .modal-content {
            width: 100% !important;
            height: 100% !important;
            max-height: 100% !important;
            border-radius: 0 !important;
            padding: 20px !important;
        }

        .grid-2 {
            grid-template-columns: 1fr !important;
        }

        /* User Avatar in Top Bar */
        #top-bar .user-avatar,
        #current-user-display .user-avatar {
            position: absolute !important;
            top: 20px !important;
            right: 20px !important;
        }

        /* Keep avatars visible in task cards */
        .task-card .avatars-group {
            display: flex !important;
        }

        .task-card .user-avatar {
            width: 20px !important;
            height: 20px !important;
            font-size: 8px !important;
        }
    }

    /* CALENDAR STYLES */
    .cal-day-cell {
        background: var(--bg-secondary);
        border-radius: var(--border-radius);
        min-height: 100px;
        padding: 5px;
        position: relative;
        border: 1px solid transparent;
        overflow: hidden;
        /* Ensure truncation works */
    }

    .cal-day-cell.today {
        border-color: var(--accent-color);
        background: rgba(100, 255, 218, 0.05);
    }

    .cal-day-number {
        font-size: 12px;
        font-weight: bold;
        color: var(--text-primary);
    }

    .cal-cell-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }

    .cal-quick-add {
        width: 18px;
        height: 18px;
        font-size: 10px;
        opacity: 0.4;
        transition: opacity 0.2s;
    }

    .cal-day-cell:hover .cal-quick-add,
    .cal-day-cell:hover .btn-view-day-tasks {
        opacity: 1;
    }

    /* View Day Tasks Button */
    .btn-view-day-tasks {
        width: 22px;
        height: 22px;
        font-size: 11px;
        opacity: 0.4;
        transition: opacity 0.2s;
        background: transparent;
        border: none;
        color: var(--accent-color);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }

    .btn-view-day-tasks:hover {
        background: rgba(100, 255, 218, 0.1);
    }

    /* Day Tasks Modal */
    .day-tasks-modal {
        background: var(--bg-card);
        border-radius: var(--border-radius);
        max-width: 500px;
        width: 90%;
        max-height: 70vh;
        padding: 20px;
        position: relative;
        border: 1px solid var(--accent-color);
        box-shadow: var(--card-shadow);
    }

    .day-tasks-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.2);
    }

    .day-tasks-modal-header h3 {
        color: var(--accent-color);
        font-size: 16px;
        margin: 0;
    }

    .day-tasks-modal-close {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 20px;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .day-tasks-modal-close:hover {
        color: var(--accent-color);
    }

    .day-tasks-list {
        max-height: calc(70vh - 100px);
        overflow-y: auto;
    }

    .day-tasks-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background: var(--bg-secondary);
        border-radius: 6px;
        margin-bottom: 8px;
        cursor: pointer;
        border-left: 3px solid var(--accent-color);
        transition: all 0.2s;
    }

    .day-tasks-item:hover {
        background: rgba(100, 255, 218, 0.1);
    }

    .day-tasks-item.priority-high {
        border-left-color: var(--danger);
    }

    .day-tasks-item.priority-medium {
        border-left-color: var(--warning);
    }

    .day-tasks-item.status-done {
        opacity: 0.6;
        border-left-color: var(--success);
    }

    .day-tasks-item-content {
        flex: 1;
        min-width: 0;
    }

    .day-tasks-item-title {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .day-tasks-item-meta {
        font-size: 11px;
        color: var(--text-secondary);
        display: flex;
        gap: 10px;
        margin-top: 3px;
    }

    .day-tasks-empty {
        text-align: center;
        padding: 30px;
        color: var(--text-secondary);
    }

    .cal-task-dot {
        font-size: 10px;
        padding: 2px 4px;
        margin-bottom: 2px;
        border-radius: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        cursor: pointer;
        background: var(--bg-card);
        border-left: 2px solid var(--accent-color);
        color: var(--text-primary);
    }

    .cal-task-dot:hover {
        background: rgba(100, 255, 218, 0.1);
    }

    .cal-task-done {
        text-decoration: line-through;
        opacity: 0.6;
        border-left-color: var(--success) !important;
        background: rgba(6, 214, 160, 0.1);
    }

    /* Calendar Frequency Indicators */
    .cal-freq-daily {
        border-left-color: #3b82f6 !important;
        border-left-width: 3px !important;
        background: rgba(59, 130, 246, 0.08) !important;
    }

    .cal-freq-monthly {
        border-left-color: #a855f7 !important;
        border-left-width: 3px !important;
        background: rgba(168, 85, 247, 0.08) !important;
    }

    /* Calendar Span Days (middle/end of multi-day tasks) */
    .cal-task-span {
        opacity: 0.65;
        border-left-style: dashed !important;
        font-style: italic;
    }

    .cal-freq-icon {
        font-size: 8px;
        color: #60a5fa;
        flex-shrink: 0;
    }

    .cal-freq-monthly .cal-freq-icon {
        color: #c084fc;
    }

    .cal-task-dot {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cal-task-title {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cal-subtask-indicator {
        font-size: 8px;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
    }

    .cal-subtask-indicator.all-done {
        color: var(--success);
    }

    .cal-subtask-indicator i {
        font-size: 7px;
    }

    .cal-mini-avatar {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 7px;
        color: #0a192f;
        font-weight: bold;
        flex-shrink: 0;
    }

    @media (max-width: 768px) {

        /* Calendar View - Mobile Optimization */
        #calendar-view {
            padding: 10px !important;
        }

        #calendar-view>.flex:first-child {
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px !important;
        }

        #calendar-view h2 {
            font-size: 14px;
            min-width: auto !important;
        }

        /* Calendar Status Tabs on Mobile */
        .calendar-status-tabs {
            order: 3;
            width: 100%;
            justify-content: center;
            margin-top: 5px;
        }

        .calendar-status-tabs .list-tab {
            font-size: 9px;
            padding: 4px 6px;
        }

        /* Month Navigation */
        #calendar-view .flex.gap-2 .btn {
            padding: 4px 8px;
            font-size: 12px;
        }

        #cal-month {
            padding: 4px 8px !important;
            font-size: 12px !important;
        }

        /* Calendar Grid - Horizontal Scroll on Container */
        #calendar-view {
            overflow: hidden;
        }

        #calendar-grid-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        #calendar-grid {
            gap: 4px !important;
        }

        #calendar-grid>div:first-child,
        #calendar-grid>div:nth-child(-n+7) {
            font-size: 11px !important;
            font-weight: 600;
        }

        .cal-day-cell {
            min-height: 60px;
            padding: 3px !important;
            font-size: 9px;
        }

        .cal-day-number {
            font-size: 11px !important;
        }

        .cal-quick-add {
            width: 16px !important;
            height: 16px !important;
            font-size: 8px !important;
        }

        .cal-task-dot {
            font-size: 7px;
            padding: 1px 2px;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }

    /* USERS TABLE */
    .users-table {
        width: 100%;
        border-collapse: collapse;
        background: var(--bg-secondary);
        border-radius: var(--border-radius);
        overflow: hidden;
    }

    .users-table th,
    .users-table td {
        padding: 6px 10px;
        text-align: left;
        border-bottom: 1px solid rgba(136, 146, 176, 0.1);
        white-space: nowrap;
    }

    .users-table th {
        background: var(--bg-card);
        color: var(--accent-color);
        font-weight: 600;
        font-size: 12.5px;
        white-space: nowrap;
    }

    .permissions-card-wrapper .tag i {
        margin-right: 5px;
    }

    .users-table td {
        color: var(--text-primary);
        font-size: 13px;
        white-space: nowrap;
    }

    .users-table tr:hover td {
        background: rgba(100, 255, 218, 0.05);
    }

    .color-preview {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: inline-block;
        vertical-align: middle;
    }

    .btn-icon {
        background: transparent;
        border: none;
        padding: 6px 10px;
        cursor: pointer;
        border-radius: 4px;
        transition: background 0.2s;
        font-size: 14px;
    }

    .btn-icon-edit {
        color: var(--accent-color);
    }

    .btn-icon-edit:hover {
        background: rgba(100, 255, 218, 0.2);
    }

    .btn-icon-trash {
        color: var(--danger);
    }

    .btn-icon-trash:hover {
        background: rgba(255, 107, 107, 0.2);
    }

    /* DEADLINE WARNING COLORS */
    .task-card.deadline-overdue {
        background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%) !important;
        border-left-color: var(--danger) !important;
        border-left-width: 4px !important;
    }

    .task-card.deadline-today {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%) !important;
        border-left-color: #3b82f6 !important;
        border-left-width: 4px !important;
    }

    .task-card.deadline-soon {
        background: linear-gradient(135deg, rgba(255, 209, 102, 0.2) 0%, rgba(255, 209, 102, 0.1) 100%) !important;
        border-left-color: var(--warning) !important;
        border-left-width: 4px !important;
    }

    .task-card.task-completed {
        background: linear-gradient(135deg, rgba(6, 214, 160, 0.15) 0%, rgba(6, 214, 160, 0.08) 100%) !important;
        border-left-color: var(--success) !important;
        border-left-width: 4px !important;
    }

    /* Deadline date badge styling */
    .deadline-date {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 600;
    }

    .deadline-date.overdue {
        color: #1a1a1a;
        background: #fee2e2;
    }

    .deadline-date.today {
        color: #1a1a1a;
        background: #dbeafe;
    }

    .deadline-date.soon {
        color: #1a1a1a;
        background: #fef9c3;
    }

    .deadline-date.completed {
        color: #1a1a1a;
        background: #dcfce7;
    }

    /* List view - deadline only text color, no background */
    .list-row .deadline-date {
        background: transparent;
        padding: 0;
    }

    .list-row .deadline-date.overdue {
        color: #dc3545;
    }

    .list-row .deadline-date.today {
        color: #3b82f6;
    }

    .list-row .deadline-date.soon {
        color: #d4a200;
    }

    .list-row .deadline-date.completed {
        color: #059669;
    }

    .light-theme .list-row .deadline-date.overdue {
        color: #dc3545;
    }

    .light-theme .list-row .deadline-date.today {
        color: #2563eb;
    }

    .light-theme .list-row .deadline-date.soon {
        color: #b38600;
    }

    .light-theme .list-row .deadline-date.completed {
        color: #047857;
    }

    /* LIGHT THEME ENHANCEMENTS */
    body.light-theme .kanban-column {
        border: 1px solid var(--border-color);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    body.light-theme .task-card {
        border: 1px solid var(--border-color);
        border-left-width: 3px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    body.light-theme .task-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    body.light-theme #sidebar {
        border-right: 1px solid var(--border-color);
    }

    body.light-theme #top-bar {
        border-bottom: 1px solid var(--border-color);
    }

    body.light-theme #view-controls {
        border-bottom: 1px solid var(--border-color);
    }

    body.light-theme .search-bar {
        border: 1px solid var(--border-color);
    }

    body.light-theme .filter-select {
        border: 1px solid var(--border-color);
    }

    body.light-theme .nav-item:hover,
    body.light-theme .nav-item.active {
        background: var(--hover-bg);
    }

    body.light-theme .btn-primary {
        color: #ffffff;
    }

    body.light-theme .tag {
        border: 1px solid var(--accent-color);
    }

    body.light-theme .list-row {
        border: 1px solid var(--border-color);
    }

    body.light-theme .list-header {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
    }

    body.light-theme .stat-card {
        border: 1px solid var(--border-color);
    }

    body.light-theme .chart-box {
        border: 1px solid var(--border-color);
    }
/* ---------------------------------------------------
   Quyền truy cập Quản lý người dùng
--------------------------------------------------- */
body:not(.is-admin) #btn-add-user,
body:not(.is-admin) #nav-users {
  display: none !important;
}

body:not(.is-admin) .users-table th:last-child,
body:not(.is-admin) .users-table td:last-child {
  display: none !important;
}
    /* Light Theme Calendar */
    body.light-theme .cal-day-cell {
        background: #ffffff;
        border: 1px solid #cbd5e1;
    }
    body.light-theme .cal-day-cell.other-month {
        background: #f8fafc;
        opacity: 0.5;
    }
    body.light-theme .cal-day-cell.is-today {
        background: #eff6ff;
        border: 2px solid #3b82f6;
    }
    body.light-theme .cal-day-num {
        color: #0f172a;
        font-weight: 700;
    }
    body.light-theme .cal-header-day {
        color: #334155;
        font-weight: 700;
    }
    body.light-theme .cal-task-dot {
        color: #0f172a;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        font-weight: 600;
    }
    body.light-theme .cal-task-dot.cal-task-span {
        opacity: 0.85;
    }
    body.light-theme .cal-task-dot.cal-task-span .cal-task-title {
        color: #334155 !important;
        font-weight: 500 !important;
    }
    body.light-theme .cal-task-title {
        color: #0f172a;
        font-weight: 600;
    }
    body.light-theme .cal-subtask-indicator {
        color: #475569;
        font-weight: 600;
    }

    body.light-theme .users-table {
        border: 1px solid var(--border-color);
    }

    body.light-theme .history-table {
        border: 1px solid var(--border-color);
    }

    body.light-theme .history-table thead {
        background: var(--bg-secondary);
    }

    body.light-theme .history-table th {
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
    }

    /* NOTIFICATION BELL & DROPDOWN */
    .btn-notification {
        position: relative;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 15px;
    }

    .btn-notification:hover {
        background: var(--bg-secondary);
        color: var(--accent-color);
        border-color: var(--accent-color);
    }

    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #ef4444;
        color: #ffffff;
        border-radius: 10px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    }

    .notification-dropdown {
        position: absolute;
        top: 46px;
        right: 0;
        width: 340px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
        z-index: 1000;
    }

    #notif-modal {
        z-index: 1000;
    }

    #task-modal {
        z-index: 1050;
    }

    #confirm-modal {
        z-index: 1100;
    }

    .notification-tabs {
        display: flex;
        align-items: center;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 4px;
        gap: 6px;
    }

    .notif-tab {
        padding: 7px 14px;
        background: transparent;
        border: none;
        border-radius: 8px;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        /* Prevent tab title from breaking into multiple lines */
        transition: all 0.2s ease-in-out;
    }

    .notif-tab:hover {
        color: var(--text-primary);
    }

    .notif-tab.active {
        background: var(--bg-secondary);
        color: var(--accent-color);
        font-weight: 600;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

    .notif-tab-count {
        background: #6b7280;
        color: #ffffff;
        border-radius: 12px;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: bold;
        white-space: nowrap;
    }

    .notif-list-scroll {
        max-height: 320px;
        overflow-y: auto;
        padding: 6px 10px 10px 10px;
    }

    .notif-item {
        padding: 10px 12px;
        border-radius: 8px;
        background: var(--bg-secondary);
        margin-bottom: 6px;
        cursor: pointer;
        transition: transform 0.15s, background 0.15s;
        border-left: 3px solid var(--accent-color);
    }

    .notif-item:hover {
        background: var(--bg-primary);
        transform: translateX(3px);
    }

    .notif-item.overdue {
        border-left-color: #ef4444;
    }

    .notif-item.soon {
        border-left-color: #f59e0b;
    }

    .notif-item-title {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .notif-item-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 11px;
        color: var(--text-secondary);
    }

    /* ========================================================
       GANTT CHART STYLES (COMPACT & OPTIMIZED)
       ======================================================== */
    .gantt-wrapper {
        display: flex;
        flex: 1;
        background: var(--bg-card);
        border: 1px solid rgba(136, 146, 176, 0.2);
        border-radius: var(--border-radius);
        overflow: hidden;
        position: relative;
        min-height: 0;
        box-shadow: var(--card-shadow);
    }

    .gantt-left-panel {
        width: 370px;
        min-width: 300px;
        flex-shrink: 0;
        border-right: 2px solid rgba(136, 146, 176, 0.25);
        display: flex;
        flex-direction: column;
        background: var(--bg-secondary);
        z-index: 3;
    }

    .gantt-col-task {
        flex: 1;
        min-width: 200px;
        display: flex;
        align-items: center;
        gap: 5px;
        overflow: hidden;
    }

    .gantt-col-author {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 11px;
    }

    .gantt-col-time {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        flex-shrink: 0;
        text-align: center;
        font-size: 10px;
        white-space: nowrap;
        color: var(--text-secondary);
    }

    .gantt-left-header {
        height: 42px;
        display: flex;
        align-items: center;
        padding: 0 8px;
        background: var(--bg-primary);
        border-bottom: 2px solid rgba(136, 146, 176, 0.25);
        font-weight: 600;
        font-size: 11px;
        color: var(--text-secondary);
        flex-shrink: 0;
        user-select: none;
    }

    .gantt-left-body {
        flex: 1;
        overflow-y: hidden;
        overflow-x: hidden;
    }

    .gantt-row-meta {
        height: 36px;
        display: flex;
        align-items: center;
        padding: 0 8px;
        border-bottom: 1px solid rgba(136, 146, 176, 0.1);
        font-size: 11px;
        cursor: pointer;
        transition: background 0.15s;
    }

    .gantt-row-meta:hover {
        background: rgba(100, 255, 218, 0.08);
    }

    .gantt-right-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-x: auto;
        overflow-y: hidden;
        position: relative;
        background: var(--bg-primary);
    }

    .gantt-timeline-header {
        height: 42px;
        display: flex;
        flex-shrink: 0;
        border-bottom: 2px solid rgba(136, 146, 176, 0.25);
        background: var(--bg-secondary);
        position: sticky;
        top: 0;
        z-index: 2;
        width: max-content;
    }

    .gantt-day-col-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: 1px solid rgba(136, 146, 176, 0.12);
        font-size: 10px;
        user-select: none;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .gantt-day-col-header.weekend {
        background: rgba(0, 0, 0, 0.18);
        color: var(--text-secondary);
    }

    .gantt-day-col-header.today {
        background: rgba(100, 255, 218, 0.18);
        color: var(--accent-color);
        font-weight: 700;
    }

    .gantt-timeline-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        width: max-content;
    }

    .gantt-grid-row {
        height: 36px;
        display: flex;
        position: relative;
        border-bottom: 1px solid rgba(136, 146, 176, 0.1);
        box-sizing: border-box;
    }

    .gantt-grid-cell {
        height: 100%;
        border-right: 1px solid rgba(136, 146, 176, 0.08);
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .gantt-grid-cell.weekend {
        background: rgba(0, 0, 0, 0.12);
    }

    .gantt-grid-cell.today {
        background: rgba(100, 255, 218, 0.06);
        border-left: 1px dashed var(--accent-color);
        border-right: 1px dashed var(--accent-color);
    }

    .gantt-task-bar {
        position: absolute;
        top: 7px;
        height: 22px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        padding: 0 6px;
        font-size: 10.5px;
        font-weight: 500;
        color: #fff;
        cursor: pointer;
        z-index: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
        transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
        box-sizing: border-box;
    }

    .gantt-task-bar:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        filter: brightness(1.12);
        z-index: 10;
    }

    .gantt-bar-progress {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.22);
        border-radius: 4px 0 0 4px;
        pointer-events: none;
    }

    .gantt-bar-content {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 4px;
        width: 100%;
        overflow: hidden;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    .gantt-col-time {
        white-space: nowrap;
        font-size: 10px;
        color: var(--text-secondary);
    }

    /* Light theme adjustments for Gantt */
    body.light-theme .gantt-day-col-header.weekend {
        background: rgba(0, 0, 0, 0.04);
    }

    body.light-theme .gantt-grid-cell.weekend {
        background: rgba(0, 0, 0, 0.03);
    }

    body.light-theme .gantt-task-bar {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    body.light-theme .gantt-row-meta:hover {
        background: rgba(2, 132, 199, 0.08);
    }

/* Sửa lỗi hiển thị Tab Sơ đồ Gantt (Bị co dúm thành hình vuông trên màn hình nhỏ) */
#gantt-view .gantt-header-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 15px !important;
  height: auto !important;
  min-height: 56px !important;
  padding: 10px 15px !important;
  box-sizing: border-box !important;
}

#gantt-view .gantt-status-tabs {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  flex: 1 !important;
  flex-wrap: wrap !important; /* Quan trọng: Cho phép rớt dòng */
}

#gantt-view .gantt-status-tabs .list-tab {
  height: 32px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important; /* Quan trọng: Chống bị bóp méo hình vuông */
}

/* ÉP SIDEBAR DESKTOP HIỂN THỊ CHUẨN (Khắc phục lỗi ghi đè từ Mobile khi cửa sổ hẹp) */
@media (min-width: 769px) {
  #sidebar {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    position: relative !important;
    height: 100vh !important;
  }
  #sidebar .nav-item {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 2px !important;
  }
  #sidebar .nav-item.active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: none !important;
    border-left: 3px solid #10b981 !important;
    border-radius: 8px !important;
    width: 100% !important;
    height: auto !important;
    padding: 8px 2px !important;
  }
  #sidebar .nav-item.active i {
    font-size: 17px !important;
    margin: 0 !important;
    background: transparent !important;
  }
  #sidebar .nav-item.active span {
    display: block !important;
    font-size: 10.5px !important;
  }
  #sidebar .nav-item:not(.active) span {
    display: block !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 768px) {
  #gantt-view .gantt-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    height: auto !important;
    padding: 0 5px !important;
  }
  #gantt-view .gantt-status-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding-bottom: 5px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  #gantt-view .gantt-status-tabs::-webkit-scrollbar {
    display: none !important;
  }
  #gantt-view .gantt-status-tabs .list-tab {
    flex: 0 0 auto !important;
    padding: 0 12px !important;
  }
  #gantt-view .gantt-time-nav {
    justify-content: space-between !important;
    width: 100% !important;
  }
}
